question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`_checkParamConsistency` not being used in `AssemblyBlueprint.construct()`

See original GitHub issue

There is a method inside of the AssemblyBlueprint class called _checkParamConsistency, which is supposed to check that an assembly blueprint has the same number of mesh points, heights, xs types, and material modification entries as there are blocks. This is called within AssemblyBlueprint.construct.

I think the issue is that this checking method is called after the assembly is constructed, and if there is an inconsistency in the assembly blueprint stemming from different numbers of blocks/xs-types/etc. then _constructAssembly will expose that inconsistency by bombing:

[CRIT 000 ] Stack trace: Traceback (most recent call last):
  File "c:\users\ckeckler\codes\armi\armi\__main__.py", line 34, in main
    code = ArmiCLI().run()
  File "c:\users\ckeckler\codes\armi\armi\cli\__init__.py", line 187, in run
    return self.executeCommand(args.command, args.args)
  File "c:\users\ckeckler\codes\armi\armi\cli\__init__.py", line 216, in executeCommand
    return cmd.invoke()
  File "c:\users\ckeckler\codes\armi\armi\cli\run.py", line 33, in invoke
    inputCase.run()
  File "c:\users\ckeckler\codes\armi\armi\cases\case.py", line 370, in run
    o = self.initializeOperator()
  File "c:\users\ckeckler\codes\armi\armi\cases\case.py", line 430, in initializeOperator
    r = reactors.factory(self.cs, self.bp)
  File "c:\users\ckeckler\codes\armi\armi\reactor\reactors.py", line 141, in factory
    coreDesign.construct(cs, bp, r, geom=geom)
  File "c:\users\ckeckler\codes\armi\armi\reactor\blueprints\reactorBlueprint.py", line 142, in construct
    self._loadAssemblies(cs, system, gridDesign, gridDesign.gridContents, bp)
  File "c:\users\ckeckler\codes\armi\armi\reactor\blueprints\reactorBlueprint.py", line 165, in _loadAssemblies
    newAssembly = bp.constructAssem(cs, specifier=aTypeID)
  File "c:\users\ckeckler\codes\armi\armi\reactor\blueprints\__init__.py", line 265, in constructAssem
    self._prepConstruction(cs)
  File "c:\users\ckeckler\codes\armi\armi\reactor\blueprints\__init__.py", line 303, in _prepConstruction
    a = aDesign.construct(cs, self)
  File "c:\users\ckeckler\codes\armi\armi\reactor\blueprints\assemblyBlueprint.py", line 109, in construct
    a = self._constructAssembly(cs, blueprint)
  File "c:\users\ckeckler\codes\armi\armi\reactor\blueprints\assemblyBlueprint.py", line 118, in _constructAssembly
    b = self._createBlock(cs, blueprint, bDesign, axialIndex)
  File "c:\users\ckeckler\codes\armi\armi\reactor\blueprints\assemblyBlueprint.py", line 159, in _createBlock
    meshPoints = self.axialMeshPoints[axialIndex]
  File "c:\users\ckeckler\codes\armi\.venv_armi\lib\site-packages\yamlize\sequences.py", line 41, in __getitem__
    return self.__items[index]
IndexError: list index out of range

And if _constructAssembly passes without error, then the things that _checkParamConsistency are supposed to check for are, by definition, acceptable. So effectively, _checkParamConsistency is never really used and the nice error message that it provides is never seen by the user.

Example of failing input is here. Uncomment the indicated line in the definition of the inner fuel assembly blueprint and the case passes.

Pretty sure this could be easily fixed just by swapping the order of the method calls and slightly retooling _checkParamConsistency.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kecklercommented, Dec 27, 2021

@jakehader You might want to wait until #513 is fully resolved. I made a change to the dict holding the material modifications, and so this method was also updated. Likely won’t conflict much, but just FYI.

0reactions
kecklercommented, Jan 20, 2022

Fixed with the closure of #517

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should you check for wrong parameter values in the ...
It's perfectly reasonable to check parameters in a constructor and throw an exception once an illegal value has been detected.
Read more >
Optimize Options (Using the GNU Compiler Collection (GCC))
Inlining is actually controlled by a number of parameters, which may be specified individually by using --param name = value .
Read more >
Read consistency - Amazon DynamoDB - AWS Documentation
When you request a strongly consistent read, DynamoDB returns a response with the most up-to-date data, reflecting the updates from all prior write...
Read more >
PTX ISA :: CUDA Toolkit Documentation
PTX supports integer and floating-point constants and constant expressions. These constants may be used in data initialization and as operands to instructions.
Read more >
User Manual - Midjourney Documentation - GitBook
This document does not cover everything in the official Midjourney Discord server (#rules, #faq, #announcements, #status channels), so make sure you check ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found