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

[For Discussion] Should AxisArray.axes be a frozendict? #125

Open
cboulay opened this issue Jun 3, 2024 · 2 comments
Open

[For Discussion] Should AxisArray.axes be a frozendict? #125

cboulay opened this issue Jun 3, 2024 · 2 comments

Comments

@cboulay
Copy link
Collaborator

cboulay commented Jun 3, 2024

As mentioned in ezmsg-org/ezmsg-sigproc#7 , I sometimes bungle the AxisArray creation / copying / manipulation and end up mutating an object that is referenced elsewhere. At least some of my mistakes could have been prevented if AxisArray's .axes field was a frozendict. I understand the hesitation to bring in a 3rd party dependency so I won't push on this at all, but if not frozendict then it would be nice if there was another way to prevent mutating .axes.

@griffinmilsap
Copy link
Collaborator

agreed, and also manipulating AxisArrays is a bit of a pain in general. I don't like .ax and .axes etc.. I need to put some time into an axisarray refactor including a basic coords impl. soon

@cboulay
Copy link
Collaborator Author

cboulay commented Aug 31, 2024

Just for fun (?), I made all the ezmsg-sigproc unit tests use frozendict when creating new AxisArray messages: ezmsg-org/ezmsg-sigproc#20

All the tests still pass! So if we do decide to add frozendict as a dependency to ezmsg, at least we know it should integrate seamlessly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants