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-28092: Document that DiaPipeTask can only handle specific bands #103

Merged
merged 2 commits into from Feb 10, 2021

Conversation

morriscb
Copy link
Contributor

@morriscb morriscb commented Feb 4, 2021

No description provided.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

Is there a way to write a test for this?

I think you want to squash the commits?

datasetRefMap : `NamedKeyDict`
Mapping from dataset type to a `set` of
`lsst.daf.butler.DatasetRef` objects
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Need a Raises here, since it specifically can raise; maybe a note in there too that it calls the parent and thus can raise whatever the parent raises. I'm not sure what the best way to do that would be: just copying and pasting the parent's Raises isn't ideal, since it could change later.

Also a Returns.

of the activator.

This implementation checks to make sure that the filters in the dataset
are compatible with AP processing as set by the Apdb/DPDD schema.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is Apdb not all-caps for a reason, like DPDD is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I'm using the name of the task in dax_apdb. Not sure it there is a standard for how to name stuff like so I will go with what the interface object is called.

dtype=str,
default=["u", "g", "r", "i", "z", "y"],
doc="List of bands that are valid for AP processing. To process a "
"band not on this list, the appropriate, band specific columns "
Copy link
Contributor

Choose a reason for hiding this comment

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

No comma after "appropriate", I think.

default=["u", "g", "r", "i", "z", "y"],
doc="List of bands that are valid for AP processing. To process a "
"band not on this list, the appropriate, band specific columns "
"must be added to the Apdb schema in dax_apdb.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Apdb all caps nor no caps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above

if ref.dataId["band"] not in self.config.validBands:
raise ValueError(
f"Requested '{ref.dataId['band']}' not in validBands list "
"in DiaPipelineTask config. To process bands not in the "
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just say "not in DiaPipelineConfig.validBands"

raise ValueError(
f"Requested '{ref.dataId['band']}' not in validBands list "
"in DiaPipelineTask config. To process bands not in the "
"standard Rubin set, ugrizy, you must add the band to the "
Copy link
Contributor

Choose a reason for hiding this comment

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

Parentheses instead of commas around "ugrizy"?

@morriscb
Copy link
Contributor Author

morriscb commented Feb 9, 2021

Fixed the commit history.

I've got a ticket, DM-22743, to implement runQuantum unittests. I can do the unittest for that.

validBands = pexConfig.ListField(
dtype=str,
default=["u", "g", "r", "i", "z", "y"],
doc="List of bands that are valid for AP processing. To process a "
Copy link
Contributor

Choose a reason for hiding this comment

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

double space between are valid

"DiaPipelineConfig.validBands. To process bands not in the "
"standard Rubin set (ugrizy) you must add the band to the "
"validBands list in DiaPipelineConfig and add the "
"appropriate columns to the Apdb schema.")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this ValueError should include the dataId and/or ref that failed. Otherwise the user might not know exactly where that particular band came from.

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 don't think that would be too helpful. As is it would just report the first dataId it encountered which would possibly just prompt the user to remove them one after the other vs removing them all.

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'll add a --show-data to the error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, re-reading my error message. I'm fine with keeping it as is.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

One more typo and an addition to the ValueError.

Please squash the commits and cleanup the commit message (a lot of unnecessary "debug X" in there).

Please do add a test for this when you implement runQuantum tests. Maybe add a note to that ticket as a reminder?

Add filter list config.

Expand docstring for filter limitations.

Fix linting and debug config.
@morriscb morriscb merged commit bbacd0a into master Feb 10, 2021
@morriscb morriscb deleted the tickets/DM-28092 branch February 10, 2021 21:04
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