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

Fix bug where cf.Field.subspace doesn't always correctly handle global cyclic subspaces #830

Merged
merged 15 commits into from
Nov 14, 2024

Conversation

davidhassell
Copy link
Collaborator

Fixes #828.

This PR fixes and simplifies the treatment of cyclic subspaces in cf.mixin.fielddomain._indices. In the process, it refactors cf.mixin.fielddomain.anchor by moving the business-end of that to the new cf.DimensionCoordinate.anchor. This new method also allows for "cell" anchoring, which we might like to use later (see #824).

@davidhassell davidhassell added the bug Something isn't working label Nov 4, 2024
@davidhassell davidhassell added this to the NEXT VERSION milestone Nov 4, 2024
Copy link
Member

@sadielbartholomew sadielbartholomew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of confusing talk of wardrobes (see in-line comments 😄) here, otherwise all good in that the fix works with good implementation and new testing coverage, but I think we have the case of a without/wo query to also fix up in a similar way (see my in-line comment with the code snippet example) so please check that comment and let me know what you think.

Changelog.rst Outdated Show resolved Hide resolved
cf/test/test_Field.py Outdated Show resolved Hide resolved
cf/test/test_Field.py Outdated Show resolved Hide resolved
cf/dimensioncoordinate.py Outdated Show resolved Hide resolved
cf/dimensioncoordinate.py Outdated Show resolved Hide resolved
cf/dimensioncoordinate.py Outdated Show resolved Hide resolved
cf/dimensioncoordinate.py Outdated Show resolved Hide resolved
cf/dimensioncoordinate.py Outdated Show resolved Hide resolved
cf/dimensioncoordinate.py Outdated Show resolved Hide resolved
cf/mixin/fielddomain.py Show resolved Hide resolved
davidhassell and others added 7 commits November 11, 2024 21:35
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Copy link
Member

@sadielbartholomew sadielbartholomew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my feedback. I've done a final sanity check after the new commits. All good, please merge.

@davidhassell davidhassell merged commit a66687f into NCAS-CMS:main Nov 14, 2024
@davidhassell davidhassell deleted the fix-cyclic-subspace branch November 14, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Field.subspace sometimes fails for a global cyclic subspace
2 participants