Add DRESS Monte Carlo integration for DT and DD thermal neutron spectra#59
Merged
aidancrilly merged 6 commits intodress_integrationfrom Mar 1, 2026
Merged
Add DRESS Monte Carlo integration for DT and DD thermal neutron spectra#59aidancrilly merged 6 commits intodress_integrationfrom
aidancrilly merged 6 commits intodress_integrationfrom
Conversation
Co-authored-by: aidancrilly <20111148+aidancrilly@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Integrate PyDress as primary source in NeSST
Add DRESS Monte Carlo integration for DT and DD thermal neutron spectra
Feb 28, 2026
added 2 commits
February 28, 2026 19:16
aidancrilly
added a commit
that referenced
this pull request
Mar 1, 2026
* Initial DRESS integration * Add DRESS Monte Carlo integration for DT and DD thermal neutron spectra (#59) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: aidancrilly <20111148+aidancrilly@users.noreply.github.com> Co-authored-by: aidancrilly <a.crilly16@imperial.ac.uk> * Updated guide etc. * DRESS in CI install --------- Co-authored-by: aidancrilly <a.crilly16@imperial.ac.uk> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrates pydress as an optional backend for computing primary neutron spectra, complementing the existing Ballabio/Brysk analytical fits with a full Monte Carlo treatment. Supports separate deuteron and triton temperatures for DT — not possible with the scalar Ballabio moments.
Changes
dress_interface.py— Replaces the preliminary stub with three functions:DRESS_DT_spec(T_D, T_T, n_samples, bins)— DT spectrum with independent D/T temperaturesDRESS_DD_spec(T, n_samples, bins)— DD thermal spectrumDRESS_DT_spec_single_T— thin backward-compatible wrapperbins /= 1e3) from the original stub; adds type hints; raises a clearImportErrorwhen pydress is absentcore.py— Two new public routines (eV throughout, matching NeSST conventions):QDress_DT(Ein, T_D, T_T=None, n_samples=1e6)—T_Tdefaults toT_DQDress_DD(Ein, Tion, n_samples=1e6)__init__.py— dress import wrapped intry/except; NeSST loads normally without pydress.pyproject.toml— pydress added as optional[dress]extra.tests/test_dress.py— Five new tests comparing DRESS moments (mean ±1 %, σ ±5 %) against Ballabio for DT and DD, plus a check that asymmetric T_D ≠ T_T produces a different spectrum.Usage
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.