-
Notifications
You must be signed in to change notification settings - Fork 12
added mass reading and test #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
thomasms
merged 7 commits into
fispact:master
from
shimwell:adding-input-reading-for-mass
Apr 21, 2025
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4d91d22
added mass reading and test
shimwell b29640f
min diff
shimwell 35a011e
reviewer comments on input file mass
shimwell d2ed141
removed unused parts
shimwell d43ec80
added test input file
shimwell 215a95c
Merge branch 'fispact:master' into adding-input-reading-for-mass
shimwell eaa3e64
added missing self
shimwell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| << CONTROL PHASE >> | ||
| << enable JSON output >> | ||
| JSON | ||
| << overwrite existing output files of same name >> | ||
| CLOBBER | ||
| << read gamma groups from file, specify ggbins in files file >> | ||
| READGG | ||
| << monitor FISPACT-II progress >> | ||
| MONITOR 1 | ||
| << the minimum cross section (barns) for inclusion in pathways analysis >> | ||
| XSTHRESHOLD 1e-12 | ||
| << perform collapse >> | ||
| GETXS 1 709 | ||
| << get decay data >> | ||
| GETDECAY 1 | ||
| << enable logging at level 1 >> | ||
| LOGLEVEL 1 | ||
| << approximate spectra when not available >> | ||
| SPEK | ||
| << end control >> | ||
| FISPACT | ||
| * test | ||
|
|
||
| << INITIALIZATION PHASE >> | ||
| << output half life values >> | ||
| HALF | ||
| << output ingestion and inhalation values >> | ||
| HAZARDS | ||
| << set the target via MASS >> | ||
| MASS 1.0 3 | ||
| Ti 80.0 | ||
| Fe 14.8 | ||
| Cr 5.2 | ||
| << set the target density >> | ||
| DENSITY 19.5 | ||
| << set the threshold for atoms in the inventory >> | ||
| MIND 100000.0 | ||
| << output the initial inventory >> | ||
| ATOMS | ||
|
|
||
| << INVENTORY PHASE >> | ||
| << irradiation schedule >> | ||
| FLUX 1100000000000000.0 | ||
| TIME 300.0 SECS | ||
| ATOMS | ||
| << end of irradiation >> | ||
| FLUX 0.0 | ||
| ZERO | ||
| TIME 10.0 SECS | ||
| ATOMS | ||
| TIME 100.0 SECS | ||
| ATOMS | ||
| TIME 1000.0 SECS | ||
| ATOMS | ||
| TIME 10000.0 SECS | ||
| ATOMS | ||
| TIME 100000.0 SECS | ||
| ATOMS | ||
| << end of cooling >> | ||
|
|
||
| << end of input >> | ||
| END | ||
| * end |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import pypact as pp | ||
|
|
||
| from tests.testerbase import Tester | ||
|
|
||
|
|
||
| class InputFileTest(Tester): | ||
|
|
||
| def test_reading_in_mass(): | ||
| ff = pp.InputData() | ||
| pp.from_file(ff, 'reference/test.i') | ||
|
|
||
| # Assert that the inventory is set to mass mode | ||
| assert ff._inventoryismass is True, "Inventory should be set to mass mode" | ||
| assert ff._inventoryisfuel is False, "Inventory should not be set to fuel mode" | ||
|
|
||
| # Assert the total mass | ||
| assert ff._inventorymass.totalMass == 1.0, "Total mass should be 1.0" | ||
|
|
||
| # Assert the number of elements | ||
| assert len(ff._inventorymass.entries) == 3, "There should be 3 elements in the inventory" | ||
|
|
||
| # Assert the elements and their percentages | ||
| expected_elements = [ | ||
| ("Ti", 80.0), | ||
| ("Fe", 14.8), | ||
| ("Cr", 5.2) | ||
| ] | ||
| for i, (element, percentage) in enumerate(expected_elements): | ||
| assert ff._inventorymass.entries[i][0] == element, f"Element {i} should be {element}" | ||
| assert ff._inventorymass.entries[i][1] == percentage, f"Percentage of {element} should be {percentage}" | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.