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

Fix the bug in the Material.from_xml_element function #3278

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

cn-skywalker
Copy link
Contributor

Description

Fixed the error in the Material.from_xml_element function that occurred while reading the depletable attribute from the XML file.

In the original function, the script performed a forced boolean conversion on the depletable attribute in the XML, but since the value of the depletable attribute is usually a string, regardless of what the value of the depletable attribute is, it will ultimately be converted to True (even if depletable=“false” is set). This is clearly a bug. Now this bug has been fixed in this PR.

Checklist

  • [√] I have performed a self-review of my own code

  • [√] I have added tests that prove my fix is effective or that my feature works (if applicable)

@cn-skywalker cn-skywalker changed the title Fixed the error in the Material.from_xml_element function that occurred while reading the depletable attribute from the XML file. Fixed the bug in the Material.from_xml_element function that occurred while reading the depletable attribute from the XML file. Jan 25, 2025
@cn-skywalker cn-skywalker changed the title Fixed the bug in the Material.from_xml_element function that occurred while reading the depletable attribute from the XML file. Fixed the bug in the Material.from_xml_element function Jan 25, 2025
@cn-skywalker cn-skywalker changed the title Fixed the bug in the Material.from_xml_element function Fix the bug in the Material.from_xml_element function Jan 25, 2025
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 @cn-skywalker!

@paulromano paulromano enabled auto-merge (squash) January 28, 2025 04:49
@paulromano paulromano merged commit 27f3afe into openmc-dev:develop Jan 28, 2025
15 checks passed
@cn-skywalker cn-skywalker deleted the fix_bug_mat branch January 29, 2025 14:26
ahnaf-tahmid-chowdhury pushed a commit to ahnaf-tahmid-chowdhury/OpenMC that referenced this pull request Feb 6, 2025
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