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

Support for NCrystal material in from_xml_element #2496

Merged
merged 10 commits into from
Jul 10, 2023

Conversation

nicriz
Copy link
Contributor

@nicriz nicriz commented Apr 26, 2023

Added support for cfg string from ncrystal-generated materials in from_xml_element

Added support for NCrystal cfg string in from_xml_element
Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

Thanks for this fix @nicriz! We definitely overlooked this before.

It would be good to update the ncrystal test (tests/regression_tests/ncrystal/test.py) to make sure we're testing for this.

openmc/material.py Outdated Show resolved Hide resolved
nicriz and others added 2 commits April 27, 2023 10:34
paulromano return

Co-authored-by: Paul Romano <[email protected]>
removed else block after adding return
@paulromano
Copy link
Contributor

@nicriz Are you able to add/update a test as suggested above?

@nicriz
Copy link
Contributor Author

nicriz commented Jun 6, 2023

Hi @paulromano, sorry for the long silence. I need to have a look to the other tests first to understand how to do it properly. Not a strong coder here.
@marquezj was proposing to create an xml file from the cfg, delete the material, read a new material from the xml file, create another xml file and check they are the same. How does it sound to you?

@paulromano
Copy link
Contributor

Yes, that sounds like a reasonable test. Alternatively you can just compare the Python material objects, the one that you started with and the one that was read back from XML.

Update NCrystal test.py for cfg string from_xml
tests/regression_tests/ncrystal/test.py Show resolved Hide resolved
tests/regression_tests/ncrystal/test.py Outdated Show resolved Hide resolved
tests/regression_tests/ncrystal/test.py Outdated Show resolved Hide resolved
nicriz and others added 3 commits June 13, 2023 21:03
PEP8 style guidelines import

Co-authored-by: Paul Romano <[email protected]>
blank lines PEP8

Co-authored-by: Paul Romano <[email protected]>
Separate test_cfg_from_xml
Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

Thanks @nicriz!

@paulromano paulromano enabled auto-merge (squash) June 13, 2023 20:46
@paulromano paulromano merged commit 3e1a5a5 into openmc-dev:develop Jul 10, 2023
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.

2 participants