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

Change 'filters' to 'bands' for multiband images and exposures #773

Merged
merged 2 commits into from
Mar 20, 2025

Conversation

fred3m
Copy link
Contributor

@fred3m fred3m commented Mar 18, 2025

No description provided.

Copy link
Member

@arunkannawadi arunkannawadi left a comment

Choose a reason for hiding this comment

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

This is a breaking API change but smoothly transitioning this in constructor methods is definitely cumbersome. But let's atleast continue to support accessor methods like filters with a proper deprecation warning.

"""
return self._filters
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest keeping this for now, but deprecating it while adding bands as a new property.

Copy link
Member

@arunkannawadi arunkannawadi Mar 19, 2025

Choose a reason for hiding this comment

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

This appeared a few rows below where I intended. I meant to keep filters as a property, not _filters attribute.

@fred3m fred3m force-pushed the tickets/DM-36099 branch 2 times, most recently from 48afcbc to edd15db Compare March 19, 2025 22:43
Use `bands` instead.
"""
warnings.warn("Use `bands` instead of `filters`", DeprecationWarning)
Copy link
Member

@arunkannawadi arunkannawadi Mar 20, 2025

Choose a reason for hiding this comment

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

You could use the same prescription to deprecate the staticmethod so it appears in the documentation as well.
https://developer.lsst.io/stack/deprecating-interfaces.html#python-deprecation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I initially tried that but unfortunately it doesn't work for properties.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I tried it locally before commenting this. The order matters - property on top and deprecated below that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh... it's because I forgot to import deprecated. :(

@fred3m fred3m force-pushed the tickets/DM-36099 branch from edd15db to c52281b Compare March 20, 2025 02:21
@fred3m fred3m merged commit a2bc5ad into main Mar 20, 2025
2 checks passed
@fred3m fred3m deleted the tickets/DM-36099 branch March 20, 2025 10:54
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.

None yet

2 participants