-
Notifications
You must be signed in to change notification settings - Fork 7
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
KeyError when accessing section_text
for certain sections
#17
Comments
Which nuclear data library are you using? I want to verify that the data are present first. The MF=31/35 warnings are not relevant here. MF 31/35 would appear much later in the file and would have no impact on MF=12. |
So MF=12, MT=75 is there for U-235 in ENDF/B-VIII.0, but not ENDF/B-VII.1. I suspect this is what is causing the raise MissingDataError(f"The requested data: MAT={MAT}, MF={MF}, MT={MT} does not exist in this ENDF.") would be a good idea. |
The |
Maybe the |
Yes, I think it will be a nice feature. We can develop a fallback function that provides verbose logs about the file, which will also help people like me who are just starting to learn about different data formats. |
Logging seems look far too big of a hammer. Like @paulromano said the information is there for the user, and I don't see the value in producing a log that would duplicate would could be queried directly. |
@MicahGale, I apologize if I wasn’t clear in my earlier comment, and I appreciate your feedback. I didn’t mean to suggest extensive logging. My idea was more about having a fallback function that triggers when a Instead of full logging, this fallback could simply explain why the error occurred and, perhaps, point out which sections are available for the material being queried. It wouldn’t duplicate what’s already in place but would help users better understand the issue when encountering missing data. |
Oh ok that makes sense. |
Description
I encountered a
KeyError
while trying to access specific sections of an ENDF material. Below is a summary of the issue:Steps to Reproduce:
Load a material using
endf.Material()
, for example:The following warnings appear:
Attempt to access a specific section:
This raises the following error:
Attempting to access other sections like:
works as expected and returns data.
Expected Behavior:
mat.section_text[12, 75]
should return the corresponding section data, or provide a clearer error if this section is not available.Actual Behavior:
A
KeyError
is raised when trying to accesssection_text
for certain sections.System Information:
n-092_U_235.endf
Additional Context:
The warnings related to MF=31 and MF=35 might be linked to the issue, but it's unclear if this is the cause.
The text was updated successfully, but these errors were encountered: