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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 0 additions & 13 deletions python/lsst/obs/base/formatters/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,4 @@ def _toBytes(self, inMemoryDataset: Any) -> bytes:
filter["name"] = inMemoryDataset.getName()
filter["aliases"] = inMemoryDataset.getAliases()

# 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

Comment on lines -141 to -153
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.

return yaml.dump(filter).encode()