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-12853: Review design questions in ap_verify #19

Merged
merged 6 commits into from Feb 9, 2018

Conversation

kfindeisen
Copy link
Member

This PR updates the ap_verify documentation to comply with the decisions made on DM-12853. Two changes require concurrent updates to source code: renaming --dataIdString to --id and removing self-setup capability from datasets.

The built documentation is available in zip format.

Per discussion on DM-12853, data package management shall be decided
by the LSST Project at a later date.
Per discussion on DM-12853, there doesn't seem to be any urgency surrounding
the current behavior. It can be deferred until ap_verify's error-handling
behavior is better-decided.
try:
self._dataRootDir = getPackageDir(datasetPackage)
self._validatePackage()
except pexExcept.NotFoundError as e:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can _validatePackage throw a pexExcept.NotFoundError? If it can (which I'm dubious about), would it mean that the package hasn't been set up, as the RuntimeError below claims?

Copy link
Member

Choose a reason for hiding this comment

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

It's getPackageDir that is throwing the NotFoundError if the package is not set up.

Copy link
Contributor

@jdswinbank jdswinbank Feb 9, 2018

Choose a reason for hiding this comment

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

Yes, of course. Hence my comment indicating that there's no point having the try .. except block around _validatePackage...

Copy link
Member Author

@kfindeisen kfindeisen Feb 9, 2018

Choose a reason for hiding this comment

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

I put them in the same try block because self._dataRootDir being initialized is a precondition for _validatePackage, and this way it's easier to see that the precondition will always be satisfied. As noted, _validatePackage will never raise NotFoundError, so the exception handling is unambiguous.

Copy link
Member

Choose a reason for hiding this comment

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

The usual recommendation is to use an else block with the try. Fluent Python makes an explicit case for doing that (the else only triggers if the try block completed).

Copy link
Member Author

Choose a reason for hiding this comment

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

Fine, I'll do that.

@kfindeisen kfindeisen merged commit 146042c into master Feb 9, 2018
@kfindeisen kfindeisen deleted the tickets/DM-12853 branch November 30, 2018 22: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
3 participants