diff --git a/tests/test_prod_outputs.py b/tests/test_prod_outputs.py index 9294f35..737c645 100644 --- a/tests/test_prod_outputs.py +++ b/tests/test_prod_outputs.py @@ -202,10 +202,7 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None: # Make the quantum provenance graph for the first attempt qg_1 = helper.get_quantum_graph("step1", "i-attempt1") qpg1 = QuantumProvenanceGraph() - qpg1.add_new_graph(helper.butler, qg_1) - qpg1.resolve_duplicates( - helper.butler, collections=["HSC/runs/Prod/step1-i-attempt1"], where="instrument='HSC'" - ) + qpg1.assemble_quantum_provenance_graph(helper.butler, [qg_1], collections=["HSC/runs/Prod/step1-i-attempt1"], where="instrument='HSC'") qg_1_sum = qpg1.to_summary(helper.butler) # Loop through the tasks in the dict @@ -311,13 +308,7 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None: # Make an overall QPG and add the recovery attempt to the QPG qpg = QuantumProvenanceGraph() qg_2 = helper.get_quantum_graph("step1", "i-attempt2") - qpg.add_new_graph(helper.butler, qg_1) - qpg.add_new_graph(helper.butler, qg_2) - qpg.resolve_duplicates( - helper.butler, - collections=["HSC/runs/Prod/step1-i-attempt2", "HSC/runs/Prod/step1-i-attempt1"], - where="instrument='HSC'", - ) + qpg.assemble_quantum_provenance_graph(helper.butler, [qg_1, qg_2], collections=["HSC/runs/Prod/step1-i-attempt2", "HSC/runs/Prod/step1-i-attempt1"], where="instrument='HSC'") qg_sum = qpg.to_summary(helper.butler) for label, task_summary in qg_sum.tasks.items(): diff --git a/tests/test_rc2_outputs.py b/tests/test_rc2_outputs.py index 83ba14c..6bced6d 100644 --- a/tests/test_rc2_outputs.py +++ b/tests/test_rc2_outputs.py @@ -159,10 +159,7 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None: # Make the quantum provenance graph for the first attempt qg_1 = helper.get_quantum_graph("step8", "attempt1") qpg1 = QuantumProvenanceGraph() - qpg1.add_new_graph(helper.butler, qg_1) - qpg1.resolve_duplicates( - helper.butler, collections=["HSC/runs/RC2/step8-attempt1"], where="instrument='HSC'" - ) + qpg1.assemble_quantum_provenance_graph(helper.butler, qg_1, collections=["HSC/runs/RC2/step8-attempt1"], where="instrument='HSC'") qg_1_sum = qpg1.to_summary(helper.butler) # Check that expected, wonky and not attempted do not occur throughout @@ -284,18 +281,13 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None: # Before we get into that, let's see if we correctly label a successful # task whose data products do not make it into the output collection - # given as unpublished. - - qpg_unpublished = QuantumProvenanceGraph() - qpg_unpublished.add_new_graph(helper.butler, qg_1) - qpg_unpublished.add_new_graph(helper.butler, qg_2) - qpg_unpublished.resolve_duplicates( - helper.butler, collections=["HSC/runs/RC2/step8-attempt1"], where="instrument='HSC'" - ) + # given as shadowed. - qpg_u_sum = qpg_unpublished.to_summary(helper.butler) + qpg_shadowed = QuantumProvenanceGraph() + qpg_shadowed.assemble_quantum_provenance_graph(helper.butler, [qg_1, qg_2], collections=["HSC/runs/RC2/step8-attempt1"], where="instrument='HSC'") + qpg_shadowed_sum = qpg_shadowed.to_summary(helper.butler) - for dataset_type_name, dataset_type_summary in qpg_u_sum.datasets.items(): + for dataset_type_name, dataset_type_summary in qpg_shadowed_sum.datasets.items(): if dataset_type_summary.producer == "_mock_analyzeObjectTableCore": if dataset_type_name == "_mock_analyzeObjectTableCore_log": continue @@ -310,13 +302,7 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None: # Now for verifying the recovery properly -- the graph below is made # as intended. qpg2 = QuantumProvenanceGraph() - qpg2.add_new_graph(helper.butler, qg_1) - qpg2.add_new_graph(helper.butler, qg_2) - qpg2.resolve_duplicates( - helper.butler, - collections=["HSC/runs/RC2/step8-attempt2", "HSC/runs/RC2/step8-attempt1"], - where="instrument='HSC'", - ) + qpg2.assemble_quantum_provenance_graph(helper.butler, [qg_1, qg_2], collections=["HSC/runs/RC2/step8-attempt2", "HSC/runs/RC2/step8-attempt1"], where="instrument='HSC'") qg_2_sum = qpg2.to_summary(helper.butler) for label, task_summary in qg_2_sum.tasks.items():