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

DM-27168: Phase out use of FilterProperty #326

Merged
merged 1 commit into from Nov 12, 2020
Merged

DM-27168: Phase out use of FilterProperty #326

merged 1 commit into from Nov 12, 2020

Conversation

czwa
Copy link
Contributor

@czwa czwa commented Nov 10, 2020

End usage of FilterProperty, as per RFC-730.

@czwa czwa requested a review from kfindeisen November 10, 2020 21:15
Copy link
Member

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

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

I'm not sure any of the changes on this PR are appropriate -- they relate not to science code that uses filter information, but to infrastructure we need to support the Filter class.

Comment on lines -141 to -153
# This can fail if the filter is no longer available in the
# Singleton
try:
filterProperty = inMemoryDataset.getFilterProperty()
except LookupError:
pass
else:
properties = {}
properties["lambdaEff"] = filterProperty.getLambdaEff()
properties["lambdaMax"] = filterProperty.getLambdaMax()
properties["lambdaMin"] = filterProperty.getLambdaMin()
filter["properties"] = properties

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's safe to remove this code yet. If somebody does still need FilterProperty (e.g., third-party code), this change to the persistence format will break things.

Copy link
Member

@timj timj Nov 10, 2020

Choose a reason for hiding this comment

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

I think this can be removed. I only use canonicalName from the YAML on read. It was in the YAML file as a record of what the state of the singleton was when it was written out but it's not used anywhere.

Comment on lines 40 to 44
self.assertEqual(lsst.afw.image.Filter('abc').getFilterProperty().getLambdaEff(), 123)
self.assertEqual(lsst.afw.image.Filter('def').getFilterProperty().getLambdaEff(), 456)
self.filters1.defineFilters() # this should not change anything
self.assertEqual(lsst.afw.image.Filter('abc').getFilterProperty().getLambdaEff(), 123)
self.assertEqual(lsst.afw.image.Filter('def').getFilterProperty().getLambdaEff(), 456)
Copy link
Member

Choose a reason for hiding this comment

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

I think this test should stay for as long as FilterDefinition contains filter wavelengths (i.e., until DM-27177). Same with the two tests below.

@czwa czwa merged commit 8f355a9 into master Nov 12, 2020
@timj timj deleted the tickets/DM-27168 branch March 30, 2021 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants