-
Notifications
You must be signed in to change notification settings - Fork 0
DM-34017: Use the butler API and mock data for run_pipeline tests #19
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
Conversation
3372548
to
d219100
Compare
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.
Looks good, though the current collection handling will cause problems in integration. I also agree with both of K-T's points.
result = pipeline.run(register_dataset_types=False) | ||
# If this is a fresh (local) repo, then types like calexp, | ||
# *Diff_diaSrcTable, etc. have not been registered. | ||
result = pipeline.run(register_dataset_types=True) |
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.
Can we do that type registration in prep_butler, possibly as part of _prep_collections
?
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.
That would require a list of every connection used by every task in the pipeline (or a traversal of the pipeline itself, which is what I assume the executor does).
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.
Doesn't the QuantumGraph know that, though?
The skip is harder to miss than a comment in the test code, so that we can revisit it once the missing MiddlewareInterface functionality is added.
def __init__(self, central_butler: Butler, image_bucket: str, instrument: str, | ||
butler: Butler, | ||
prefix: str = "gs://"): | ||
prefix: str = "s3://"): |
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.
This change is no longer necessary after the last weekly, and I've removed S3 support from the Cloud service [restored]. (Sorry for not realizing this branch was using it!)
* remove PIPELINE_MAP * Move code out of init and _prep_butler into _prep_pipeline
501d704
to
99f4521
Compare
@kfindeisen : please have another (final?) look. I'll try to combine commits somewhat post-review |
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.
Looks good, but please make sure the tests pass (the flake8 error should have appeared locally), and please avoid special-casing the unit tests. There's not much point to having them if they're free to make different assumptions from the prototype environment.
|
||
# Refresh butler after configuring it, to ensure all required | ||
# dimensions are available. | ||
# collections are available. |
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.
This one really should be "dimensions"; my earlier correction applied only to the comment in _prep_collections
.
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.
As it stands, init_butler has nothing to do, since we have to put off all the work for prep_butler right now. We can leave it around while we wait for middleware fixes, etc. that will let us do more things here, but I've added a note to the method docs about whether it's worth keeping the method.
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.
My above comment is now out of date, since Jim gave us a fix for the instrument.register
problem, so _init_butler
now has things to do.
tests/test_middleware_interface.py
Outdated
mock_executor.from_pipeline.assert_called_once_with( | ||
self.interface.pipeline, | ||
where=f"detector={self.next_visit.detector} and exposure in (1)", | ||
butler=self.interface.butler | ||
) |
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 is a useful test (with maybe some more use of mock.ANY
), since the restriction to a specific pipeline and data ID is a key part of this method's purpose. It seems a shame to remove it.
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 actually building the pipeline now, though: that's how I discovered some of the bugs (like DM-34202). The only thing being mocked is run
.
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.
Ok, but does that tell you that you built the right executor, or just any executor? The where
clause seems like it would be hard to test by any means other than direct introspection.
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.
Based on the work we did today, I believe we're now doing a good job testing that where
.
99f4521
to
6515e78
Compare
fixup run_pipeline test
Thanks to Jim Bosch for the `elements=[]` fix for this, allowing us to register the instrument on init. However, the skymap has a similar problem that is harder to work around.
fixup local appipe
We need valid metadata for defineVisits.
6515e78
to
12d6db9
Compare
On the team-coding call, we all agreed on not trying to clean up the git history on this across the Eric->John handoff. I cleaned up my own commits as best I could. |
No description provided.