Skip to content
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

Modified creation of cyclus input from PRIS data #115

Merged
merged 31 commits into from
Jan 13, 2021
Merged

Conversation

abachma2
Copy link
Contributor

I made changes to facilitate the creation of cyclus input files using data from the PRIS Year-end Report.

scripts/predicting-the-past-import.py was modified to reflect the structure of the raw data from PRIS, when saved as a .csv. scripts/create_input.py was created to perform the actions to create the input file, mirroring what is in inputs/predicting-the-past/united_states.ipynb.

@pep8speaks
Copy link
Contributor

pep8speaks commented Jan 11, 2021

Hello @abachma2! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 13:80: E501 line too long (95 > 79 characters)
Line 21:80: E501 line too long (82 > 79 characters)
Line 24:80: E501 line too long (81 > 79 characters)
Line 49:80: E501 line too long (87 > 79 characters)
Line 50:80: E501 line too long (87 > 79 characters)

Comment last updated at 2021-01-13 00:04:46 UTC

Copy link
Contributor

@samgdotson samgdotson left a comment

Choose a reason for hiding this comment

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

I've never used cyclus, so my comments are from the perspective of an outsider-ish.

My two thoughts are:

  1. Templates should be maximally flexible. (This is really an opinion)
  2. Magic numbers should not exist without very good reason (and then they're usually not magic numbers).

input/predicting-the-past/templates/reactors_template.xml Outdated Show resolved Hide resolved
@@ -63,14 +63,14 @@
</recipe>
<recipe>
<name>cool_spent_uox</name>
<basis>atom</basis>
<basis>mass</basis>
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like something that should be user specified.
E.g. allow for options when running create_input.py like

python create_input.py -a  # for atom basis

pyhton create_input.py -m # for mass basis

Copy link
Member

Choose a reason for hiding this comment

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

As long as the IAEA PRIS database is on a mass basis, this is fine. @abachma2 feel free to resolve this conversation if that's the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The recipe data doesn't come from PRIS. It comes from the vision recipes in database/vision_recipes/. I don't know where that data came from originally.

scripts/create_input.py Show resolved Hide resolved
scripts/predicting_the_past_import.py Outdated Show resolved Hide resolved
scripts/predicting_the_past_import.py Outdated Show resolved Hide resolved
scripts/create_input.py Show resolved Hide resolved
@abachma2
Copy link
Contributor Author

Thanks for the comments @samgdotson. I made most of the changes to reflect the current structure of the raw data from PRIS. I can try to modify it to match column names as opposed to numbers, allowing for some flexibility if the raw data changes format.

input/predicting-the-past/templates/reactors_template.xml Outdated Show resolved Hide resolved
scripts/create_input.py Show resolved Hide resolved
scripts/create_input.py Outdated Show resolved Hide resolved
Copy link
Contributor

@samgdotson samgdotson left a comment

Choose a reason for hiding this comment

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

I think this is better. Again, I'm not familiar with Cyclus so you might want someone else to approve before merging.

@abachma2
Copy link
Contributor Author

I changed some of the data containers to pandas DataFrames from lists. This should remove need for 'magic numbers'

@@ -63,14 +63,14 @@
</recipe>
<recipe>
<name>cool_spent_uox</name>
<basis>atom</basis>
<basis>mass</basis>
Copy link
Member

Choose a reason for hiding this comment

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

As long as the IAEA PRIS database is on a mass basis, this is fine. @abachma2 feel free to resolve this conversation if that's the case.

scripts/predicting_the_past_import.py Show resolved Hide resolved
@katyhuff
Copy link
Member

Made two minor comments. When handled, I approve.

@katyhuff katyhuff merged commit 5fe4b6e into arfc:master Jan 13, 2021
@katyhuff
Copy link
Member

Merged!

@abachma2 abachma2 mentioned this pull request Jan 13, 2021
2 tasks
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.

None yet

4 participants