fix: 2D-vector setter writes nothing (- instead of =)#471
Merged
Conversation
_accessor_2d_vector's setter branch in the numba object-code generator emitted
`data[start:end] - value` -- a subtraction whose result is discarded -- instead
of `data[start:end] = value`. Every other generated accessor (_accessor_1d,
_accessor_2d, _accessor_3d_*) correctly emits `= value`, so all generated
*_vector setters silently failed to write.
Fixed the generator template and regenerated the affected checked-in modules
(mcdc_set/{table_data,multigroup_material,source,neutron_inelastic_scattering_reaction,surface}.py).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
|
Thanks, @steps-re! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_accessor_2d_vectorinmcdc/code_factory/numba_objects_generator.pygenerates its setter with:That emits
data[start:end] - value— a subtraction whose result is thrown away — instead ofdata[start:end] = value. Every sibling accessor generator (_accessor_1d,_accessor_2d,_accessor_3d_element, ...) correctly emits= value, so this one is the odd one out and every generated*_vectorsetter silently writes nothing.This fixes the generator template and the checked-in generated modules where the broken setter already landed:
mcdc/mcdc_set/table_data.pymcdc/mcdc_set/multigroup_material.py(4 setters)mcdc/mcdc_set/source.py(2)mcdc/mcdc_set/neutron_inelastic_scattering_reaction.pymcdc/mcdc_set/surface.py(2)If those modules are meant to be regenerated from the template rather than hand-edited, let me know and I'll drop the generated-file changes and keep only the template fix.