-
Notifications
You must be signed in to change notification settings - Fork 4
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-38210: Use butler.get() rather than deprecated getDirect() #227
Changes from all commits
a4d777f
eb60108
d712735
e6a9c8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ | |
""" | ||
|
||
import contextlib | ||
import copy | ||
import logging | ||
import os | ||
import pickle | ||
|
@@ -739,7 +738,7 @@ def testSimpleQGraphReplaceRun(self): | |
self.assertEqual(len(qgraph), self.nQuanta) | ||
|
||
# deep copy is needed because quanta are updated in place | ||
fwk.runPipeline(copy.deepcopy(qgraph), taskFactory, args) | ||
fwk.runPipeline(qgraph, taskFactory, args) | ||
self.assertEqual(taskFactory.countExec, self.nQuanta) | ||
|
||
# need to refresh collections explicitly (or make new butler/registry) | ||
|
@@ -762,7 +761,8 @@ def testSimpleQGraphReplaceRun(self): | |
# changed) | ||
args.replace_run = True | ||
args.output_run = "output/run2" | ||
fwk.runPipeline(copy.deepcopy(qgraph), taskFactory, args) | ||
qgraph = fwk.makeGraph(self.pipeline, args) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made this change to demonstrate the fix but I wonder if we are punting to fixing this properly with unresolved ref removal that maybe I should not include this change here. @andy-slac would you rather this test failed once you remove unresolved refs or are you happy that this is the right fix for replace-run testing anyhow and so should keep this fix? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm OK with this change. I guess once we have the ability to rewrite output run in a graph we will add a new unit test for that. |
||
fwk.runPipeline(qgraph, taskFactory, args) | ||
|
||
butler.registry.refresh() | ||
collections = set(butler.registry.queryCollections(...)) | ||
|
@@ -780,7 +780,8 @@ def testSimpleQGraphReplaceRun(self): | |
args.replace_run = True | ||
args.prune_replaced = "unstore" | ||
args.output_run = "output/run3" | ||
fwk.runPipeline(copy.deepcopy(qgraph), taskFactory, args) | ||
qgraph = fwk.makeGraph(self.pipeline, args) | ||
fwk.runPipeline(qgraph, taskFactory, args) | ||
|
||
butler.registry.refresh() | ||
collections = set(butler.registry.queryCollections(...)) | ||
|
@@ -810,7 +811,8 @@ def testSimpleQGraphReplaceRun(self): | |
args.replace_run = True | ||
args.prune_replaced = "purge" | ||
args.output_run = "output/run4" | ||
fwk.runPipeline(copy.deepcopy(qgraph), taskFactory, args) | ||
qgraph = fwk.makeGraph(self.pipeline, args) | ||
fwk.runPipeline(qgraph, taskFactory, args) | ||
|
||
butler.registry.refresh() | ||
collections = set(butler.registry.queryCollections(...)) | ||
|
@@ -828,7 +830,8 @@ def testSimpleQGraphReplaceRun(self): | |
args.prune_replaced = None | ||
args.replace_run = True | ||
args.output_run = "output/run5" | ||
fwk.runPipeline(copy.deepcopy(qgraph), taskFactory, args) | ||
qgraph = fwk.makeGraph(self.pipeline, args) | ||
fwk.runPipeline(qgraph, taskFactory, args) | ||
butler.registry.refresh() | ||
collections = set(butler.registry.queryCollections(...)) | ||
self.assertEqual(collections, {"test", "output", "output/run1", "output/run2", "output/run4"}) | ||
|
@@ -837,7 +840,8 @@ def testSimpleQGraphReplaceRun(self): | |
args.prune_replaced = None | ||
args.replace_run = True | ||
args.output_run = "output/run6" | ||
fwk.runPipeline(copy.deepcopy(qgraph), taskFactory, args) | ||
qgraph = fwk.makeGraph(self.pipeline, args) | ||
fwk.runPipeline(qgraph, taskFactory, args) | ||
butler.registry.refresh() | ||
collections = set(butler.registry.queryCollections(...)) | ||
self.assertEqual(collections, {"test", "output", "output/run1", "output/run2", "output/run4"}) | ||
|
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.
@TallJimbo this fails if we don't unresolve the ref because of this test code for replace run in test_cmdLineFwk:
and you get a resolved ref for run
output/run1
being put intooutput/run2
and it failing because it wants to put it intooutput/run1
.@andy-slac Interestingly we also get another failure in the simplest possible test:
where the problem is:
with error:
No collection with name 'output/20230330T204714Z' found.
which makes me wonder how we are generating two different versions of that timestamped output 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.
Of course that second test failure with the timestamp is random because it depends on timing. I can also get
testSimpleQGraphClobberOutputs
to fail with the same timestamp mismatch astestSimpleQGraph
. (it's the_metadata
dataset each time)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.
If we don't unresolve refs then in
runPipeline
we should probably take output run from QuantumGraph. But I'm not sure how this will interact with all other options.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 I say on Slack, recalculating the graph each time in the
--replace-run
test does work. This is going to have to be required unless--replace-run
calls some kind of method on the graph to recalculate all the output dataset refs with a new run (and then you lose provenance in the graph that is on disk).