fix: consolidate adapter metadata into self.options (#12)#63
Merged
jc-macdonald merged 3 commits intomainfrom Apr 13, 2026
Merged
fix: consolidate adapter metadata into self.options (#12)#63jc-macdonald merged 3 commits intomainfrom
jc-macdonald merged 3 commits intomainfrom
Conversation
Remove bare instance attributes (axis_order, axis_sizes, axis_coords,
state_shape, flatten, unflatten, mixing_kernels) and expose them
exclusively via self.options dict.
Fix overwrite bug where individual option assignments were clobbered
by a subsequent self.options = {...} reassignment. Capture
mixing_kernels as a local in the stepper closure.
Cover axis_order, axis_sizes, axis_coords, state_shape, flatten, and unflatten options for both bare SIR specs and specs with explicit axes. Include flatten/unflatten roundtrip test.
flepimop2 is an implicit namespace package, so mypy cannot locate py.typed. Add a [[tool.mypy.overrides]] entry to follow imports for flepimop2.* modules, resolving both the import-untyped and the missing-override-base errors.
TimothyWillard
approved these changes
Apr 13, 2026
pearsonca
approved these changes
Apr 13, 2026
Comment on lines
+76
to
+78
| "axis_order": axes_meta.axis_order, | ||
| "axis_sizes": axes_meta.axis_sizes, | ||
| "axis_coords": axes_meta.axis_coords, |
Member
There was a problem hiding this comment.
fine for now, but ideally these get pulled into the axes field on SystemABC
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.
Upgrades the flepimop2 provider adapter to expose all metadata through
self.optionsinstead of bare instance attributes, per flepimop2 discussion #129 and theModuleABC.option()API (ACCIDDA/flepimop2#118).Changes
Adapter (
flepimop2-op_system/src/.../op_system/__init__.py)self.axis_order,self.axis_sizes,self.axis_coords,self.state_shape,self.flatten,self.unflatten,self.mixing_kernels, plusoperatorsandoperator_axis) into a singleself.options = {...}dictmixing_kernelsas a local variable instead of referencing the (now removed)self.mixing_kernelsTests (
flepimop2-op_system/tests/test_system.py)system.option():test_option_axis_order_bare_spec/test_option_axis_order_with_axestest_option_axis_sizes_bare_spec/test_option_axis_sizes_with_axestest_option_axis_coords_bare_spec/test_option_axis_coords_with_axestest_option_state_shape_bare_spec/test_option_state_shape_with_axestest_option_flatten_unflatten_roundtripmypy (
flepimop2-op_system/pyproject.toml)[[tool.mypy.overrides]]forflepimop2.*withfollow_imports = "normal"to handle flepimop2's implicit namespace package (see docs: add mypy/type-checking guidance for external provider packages flepimop2#205)Closes #12