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
Conversation
There was a problem hiding this 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.
# 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 | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
tests/test_filters.py
Outdated
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) |
There was a problem hiding this comment.
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.
5d245ad
to
ccfea89
Compare
End usage of FilterProperty, as per RFC-730.