Skip to content

Add nuclear data for other datasets#53

Open
LukeSeifert wants to merge 180 commits into
arfc:mainfrom
LukeSeifert:add-data
Open

Add nuclear data for other datasets#53
LukeSeifert wants to merge 180 commits into
arfc:mainfrom
LukeSeifert:add-data

Conversation

@LukeSeifert

Copy link
Copy Markdown
Collaborator

Summary of changes

Adds multiple new datasets and fixes some small bugs.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Associated Issues and PRs

Do not merge until PR #48 is merged.

Associated Developers

  • Dev: @

Checklist for Reviewers

Reviewers should use this link to get to the
Review Checklist before they begin their review.

@LukeSeifert LukeSeifert mentioned this pull request Apr 22, 2026
9 tasks
@katyhuff
katyhuff requested a review from ElijahCapps April 29, 2026 19:05
@katyhuff

Copy link
Copy Markdown
Member

@ElijahCapps I've suggested you could be a good reviewer for this. Hopefully you agree.

@ElijahCapps ElijahCapps left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a lot of comments in places that I had questions/suggestions on. This was a big PR, so I skipped over the .json inputs and .csv files, assuming they were formatted correctly. I glanced over the tests briefly, but did not look too deep into them. For additions to the core of Mosden (from what I could read), I mainly looked at new function descriptions/variable names to see if they made sense. Let me know if there is anything you would like me to look at closer. At some point, I think it might be a good idea if I tried to build this myself and see where it might hitch.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there is a better name for this than "results_generator" considering it generates inputs. Also, does this generate several inputs for several runs for one larger analysis? I am a little confused on what the input to this module actually is.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually writes the inputs and then runs mosden to generate results from those inputs. This is separate from the main mosden build, which is why there are results_generators in different example directories. The user is intended to run the results_generator to run many simulations one after another and have some nicely formatted figures and results once it finishes.

'overwrite': True,
},
'half_life': ['endfb71/decay/', 'endfb80/decay/', 'jeff311/decay/', 'jendl5/decay/', 'iaea/eval.csv'],
'emission_probability': ['endfb71/decay/', 'endfb80/decay/', 'jeff311/decay/', 'jendl5/decay/', 'iaea/eval.csv'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these the correct library directories? I am not familiar with how these libraries are structured.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I could have renamed/restructured them, but I left them in the default structure as how they are when the download_data script collects them.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just output?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no. For this example, this is an input. That is because it is four_dnps, so I have to provide the four DNPs it will model. For this case, it is Br87, I137, Rb94, and As86. The input file here is configured to not overwrite this file, so it will always be these four. If the user wanted to use other nuclides, they would simply need to alter this file to use the nuclides they want to see modeled.

set(emission_nucs) & set(half_life_nucs) & set(conc_nucs))
for nuc in net_similar_nucs:
data = conc_data[nuc]
Pn = pn_data[nuc]['emission probability']

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One convention uses spaces ('emission probability') and the other uses underscores ('half_life')?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I do have an issue (#21) that notes this. I think using a more consistent notation would be much better, but I think that may need to be its own PR.

Pn = pn_data[nuc]['emission probability']
hl = hl_data[nuc]['half_life']
decay_const = np.log(2) / hl
if np.allclose(list(data.values()), 0.0):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh so that checks if the concentration of the nuclide is close to 0.0 at all times, indicating that it has a negligible cumulative fission yield and does not needed to be tracked since it will emit approximately 0 delayed neutrons.

Comment thread mosden/preprocessing.py

def jendl_preprocess(self, data_val: str, unprocessed_path: str) -> None:
"""
Processes JENDL data

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Processes" is a bit of a vague descriptor

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I see what you mean. Most of the preprocess functions are written this way though, since the purpose of the class is to preprocessing the files into the MoSDeN accepted formatting. Do you have suggestions for how I could make this a bit clearer?

Comment thread mosden/preprocessing.py

def _jendl_nfy_preprocess(self, data_val: str, path: str) -> None:
"""
Processes JENDL fission yield data for the specified fissile target.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick but some descriptions have punctuation while others don't

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh darn you're right. Added Issue #62 to handle this at a later date.

Comment thread mosden/preprocessing.py
return None


def _jendl_nfy_preprocess(self, data_val: str, path: str) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several functions begin with an underscore but many other do not. What does the format call for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! It's a way of indicating privacy (see https://stackoverflow.com/questions/1547145/defining-private-module-functions-in-python). It doesn't change anything, but it signals that this function generally shouldn't be called elsewhere, but rather there is a different function that calls this function (jendl_preprocess in this case) that users should be using.

Comment thread tests/unit/test_base.py
index = base.get_irrad_index(False)
assert index == 3

def test_get_irrad_index_with_min_time():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should tests have descriptions? I am not sure what the expectation here is.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! Generally no (see https://softwareengineering.stackexchange.com/questions/406570/pep8-d103-i-need-docstrings-for-my-unit-test-functions-too), but they should have sufficiently descriptive names.

Comment thread README.md Outdated
measures of the summed data than an in-core residence time of 30 seconds (30
OpenMC simulations).
This can be resolved by using a smaller minimum OpenMC timestep.
The minimum timestep should be set such that approximately 100 simulations are

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this specific number?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had initially run an analysis that evaluated how varying the number of simulations affected this calculation, which showed that increasing the number of simulations improved this calculation. However, I think generally users are better off just utilizing the group values, so I have updated the documentation to indicate that.

@LukeSeifert

Copy link
Copy Markdown
Collaborator Author

@ElijahCapps Thanks for the review! Apologies for the length, I forgot how many new things I had included in this PR. Feel free to merge if it looks good, or let me know if there's anything you'd prefer I take another look at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants