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

Override del_construct to update cyclic axes set when due #763

Conversation

sadielbartholomew
Copy link
Member

Fix #758 and #756 (the former being the underlying issue and the latter a specific bug as a downstream effect) by overriding the del_construct inherited from cfdm to account for and update the store of cyclic axes. Previously we used the inherited method as-is so cyclic axes weren't updated and could get out of sync, notably contain axes which no longer existed due to deletion.

Note:

@sadielbartholomew
Copy link
Member Author

Just going to add one commit to fix a few style/formatting issues detected by the CI linting.

Copy link
Member Author

@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.

@davidhassell one note to consider for your review. Thanks.

cf/mixin/fielddomain.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@davidhassell davidhassell left a comment

Choose a reason for hiding this comment

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

Hi Sadie - look good - I've made some suggestions on handling the construct-doesn't exist case.

cf/mixin/fielddomain.py Outdated Show resolved Hide resolved
cf/mixin/fielddomain.py Show resolved Hide resolved
cf/mixin/fielddomain.py Outdated Show resolved Hide resolved
cf/mixin/fielddomain.py Outdated Show resolved Hide resolved
cf/mixin/fielddomain.py Outdated Show resolved Hide resolved
@sadielbartholomew
Copy link
Member Author

Thanks for your feedback @davidhassell. I'll update the PR shortly according to your excellent suggestions, though I will get the halo PR review in first, so do it after that.

@sadielbartholomew
Copy link
Member Author

All ready for your re-review, @davidhassell. Thanks.

Copy link
Collaborator

@davidhassell davidhassell left a comment

Choose a reason for hiding this comment

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

Look great. Thanks!

@sadielbartholomew
Copy link
Member Author

Thanks David. In that case, merging!

@sadielbartholomew sadielbartholomew merged commit a5f91ab into NCAS-CMS:main Apr 23, 2024
@sadielbartholomew sadielbartholomew deleted the del-construct-cyclic-consideration branch April 23, 2024 13:40
@davidhassell davidhassell added this to the 3.16.2 milestone Apr 24, 2024
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

Successfully merging this pull request may close these issues.

Post-regrids Field.cyclic() retains removed domain axes
2 participants