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-16828: Add Job viewer to lsst.verify #31

Merged
merged 2 commits into from Jan 2, 2019
Merged

Conversation

kfindeisen
Copy link
Member

This PR adds the inspect_job.py script for getting a quick and uncluttered summary of a persisted job. User documentation has been added to the Sphinx build.

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.

This looks handy, thanks for writing it.

My primary concern is preventing bitrot on this: is there a way to write a simple test of it with a sample job output? You could either lift the "working code" out into lsst.verify.something or maybe just run this as an executable from a test via subprocess.run().

bin.src/inspect_job.py Outdated Show resolved Hide resolved
bin.src/inspect_job.py Outdated Show resolved Hide resolved
print("Syntax: %s <job file> [[job file]...]" % sys.argv[0])
sys.exit(1)
for filename in sys.argv[1:]:
if len(sys.argv) > 2:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe better off putting this logic in main() and using ArgumentParser to manage the argv stuff.

Copy link
Member Author

Choose a reason for hiding this comment

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

ArgumentParser seems kind of overkill here, don't you think? It's not a proper CLI, just a list of files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Either way. I find using argparse to even handle "just a list of files" to be more robust, but its your call.

@jonathansick
Copy link
Member

About putting the core business code into the Python package itself, see https://github.com/lsst/verify/blob/master/python/lsst/verify/report.py for something similar.

Report has slightly different information content (it so far focusses on tabulating pass/fail status). But it shows how you might create a class that could either render plain text on the command line, or something like HTML in a notebook.

@kfindeisen
Copy link
Member Author

Ok, I'll try to move everything into python/ and make it an object that could potentially have multiple representations. Though I'm not sure I can get to the second part before the break.

@kfindeisen
Copy link
Member Author

On second thought, I think creating a display object may be best deferred to a separate ticket. Making a display class that's specific to Job feels way too specialized, but creating an abstract interface that is Report-like will be inflexible if we want to add a third (or is that fourth?) output mode.

So I think it would be better to just add a unit test, and solve the problem of multiple output formats later.

@parejkoj
Copy link
Contributor

That seems like a good approach.

The output is unit tested for basic properties, but not an exact match
to any particular formatting.
@kfindeisen kfindeisen merged commit 6093eba into master Jan 2, 2019
@kfindeisen kfindeisen deleted the tickets/DM-16828 branch January 2, 2019 20:45
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

3 participants