-
Notifications
You must be signed in to change notification settings - Fork 92
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 a bug in database compare. #1258
Conversation
@@ -329,7 +329,7 @@ def _diffSpecialData( | |||
diffResults.addStructureDiffs(nDiffs) | |||
|
|||
if not keysMatch: | |||
diffResults.addDiff(name, name, [numpy.inf], [numpy.inf], [numpy.inf]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you describe in the PR why the brackets were removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, addDiff
expects three floats based on the type hints:
armi/armi/bookkeeping/db/compareDB3.py
Lines 114 to 116 in 199d250
def addDiff( | |
self, compType: str, paramName: str, absMean: float, mean: float, absMax: float | |
) -> None: |
And it compares these three parameters with >
, which doesn't work on a list.
I was able to add a unit test for one of the bad function calls. For the second one, where the name of the function was wrong ( |
* main: (23 commits) block converters preserve flags (terrapower#1271) Fixed float decimals v3 (terrapower#1283) Fixed string format error for snapshots (terrapower#1277) Pinning the versions of yamlize and ruamel (terrapower#1281) Releasing v0.2.7 (terrapower#1276) Creating verisons setting section (terrapower#1274) Adding to GlobalFluxOptions docstring (terrapower#1273) Harmonize material names and class names (terrapower#1270) Removing Component.getMassDensity (terrapower#1266) Cleaning up language for our versioning rules (terrapower#1175) Fixing the Settings Report in the Docs (terrapower#1264) Fixing getTemperatureAtDensity to use non-pseduo density (terrapower#1262) Fixing settings report docs from terrapower#1207 (terrapower#1263) Update test_components.py (terrapower#1261) Update gamma Uniform Mesh Converter (terrapower#1213) Updating way that settings report defaults are printed (terrapower#1207) Fixing UserPlugins.defineFlag (terrapower#1241) quick bug fix for PR 1239 (terrapower#1260) New Option to Control Lattice Physics Update Frequency (terrapower#1239) Fix a bug in database compare. (terrapower#1258) ...
Description
There's a line in compareDB3.py that tries to call a method that doesn't exist,
DiffResults.add()
This has been around for a long time, but we have somehow just coincidentally not been hitting it.
Also, another call to
addDiff
needed to be updated to passnumpy.inf
as a scalar instead of a list.Checklist
doc/release/0.X.rst
) are up-to-date with any bug fixes or new features.doc
folder.setup.py
.