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

Warnings in tests #2041

Open
opotowsky opened this issue Dec 31, 2024 · 8 comments
Open

Warnings in tests #2041

opotowsky opened this issue Dec 31, 2024 · 8 comments
Labels
cleanup Code/comment cleanup: Low Priority testing Related to tests

Comments

@opotowsky
Copy link
Member

opotowsky commented Dec 31, 2024

I have two types of warnings I see here:

(1)

image

and (2)

image

I don't want to fix (1) without some advice because that's an issue with the code itself (in multiple locations, but it's the same SORT of problem and will likely be handled in the same way in all locations).

And (2), I don't know HOW to fix.

Help?

@opotowsky opotowsky added the testing Related to tests label Dec 31, 2024
@opotowsky
Copy link
Member Author

These are the remaining ~23 warnings in the ARMI unit tests so we are fairly close to being warning free 💃

@john-science john-science added the cleanup Code/comment cleanup: Low Priority label Dec 31, 2024
@john-science
Copy link
Member

john-science commented Dec 31, 2024

Well, the source of number (2) above is the legend:

plt.legend()

If you remove that line, those warnings go away.

When I make the plot from the test test_xsHistoryVsTime(), the legend has missing symbols:

image

Okay, the problem is the xsType variable that we inject into the legend, that comes from crossSectionGroupManager.getXSTypeLabelFromNumber(typeNum):

xsType = crossSectionGroupManager.getXSTypeLabelFromNumber(typeNum)
color = next(colors)
plt.plot(times, burnups, color + ".", label="Type {0} XS".format(xsType))

For me, in that test, the xsType is an empty string. Which is... wrong? But I'm not sure why that shows up as anything funny in the legend.

@john-science
Copy link
Member

Okay, the problem for your number (2) here is our tests are stupid. They are providing invalid type numbers:

1: [[0, 1], [0, 2], [0, 3]],
2: [[0, 5], [0, 6], [0, 7]],

That should read something more like:

        65: [[0, 1], [0, 2], [0, 3]],
        6570: [[0, 5], [0, 6], [0, 7]],

Or whatever. Just valid type numbers.

@ntouran
Copy link
Member

ntouran commented Jan 1, 2025

Sending in a PR for the reportPlotting issue.

ntouran added a commit to ntouran/armi that referenced this issue Jan 1, 2025
Also fix invalid test fixture data that was triggering
a warning.

Part of terrapower#2041
@john-science
Copy link
Member

Update: Nick's PR fixed problem (2).

So, only (1) is left.

But if I were a gambling man, I would disagree with Arrielle here. I bet all these "divide by zero" warnings are not related. I bet there are many tests with silly default values chunked in, and those cause the warnings.

My guess is that each of these tests will have to be tweaked individually, so they have better defaults. Or, in some cases, a more complete reactor will have to be provided to the test.

@john-science
Copy link
Member

Also, as a matter of "what to attack first", I want to focus on the warnings from the unit tests in Python 3.13 first.

example

@opotowsky
Copy link
Member Author

opotowsky commented Jan 5, 2025

But if I were a gambling man, I would disagree with Arrielle here. I bet all these "divide by zero" warnings are not related. I bet there are many tests with silly default values chunked in, and those cause the warnings.

My guess is that each of these tests will have to be tweaked individually, so they have better defaults. Or, in some cases, a more complete reactor will have to be provided to the test.

There are just a handful (not even) of places in the code where this needs to be handled, not the tests themselves. So it's not all the same root cause of warning, but I think we would resolve most of them in the same way (most are divide by 0 warnings)

@opotowsky
Copy link
Member Author

hey it's down to 18 warnings tho! better place than I thought we'd be!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code/comment cleanup: Low Priority testing Related to tests
Projects
None yet
Development

No branches or pull requests

3 participants