Skip to content

Commit

Permalink
Change not_attempted to unknown, published to visible and unpublished…
Browse files Browse the repository at this point in the history
… to shadowed
  • Loading branch information
eigerx committed Sep 12, 2024
1 parent effde14 commit d0ec038
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
28 changes: 14 additions & 14 deletions tests/test_prod_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None:

# Loop through the tasks in the dict
for label, task_summary in qg_1_sum.tasks.items():
self.assertEqual(task_summary.n_not_attempted, 0)
self.assertEqual(task_summary.n_unknown, 0)
self.assertEqual(task_summary.n_wonky, 0)
self.assertEqual(task_summary.n_expected, 36)
self.assertListEqual(task_summary.wonky_quanta, [])
Expand All @@ -219,7 +219,7 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None:
task_summary.n_expected,
task_summary.n_successful
+ task_summary.n_blocked
+ task_summary.n_not_attempted
+ task_summary.n_unknown
+ task_summary.n_wonky
+ task_summary.n_failed,
)
Expand Down Expand Up @@ -270,7 +270,7 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None:
# Check that the published datasets = expected - (unsuccessful
# + predicted_only)
self.assertEqual(
dataset_summary.n_published,
dataset_summary.n_visible,
dataset_summary.n_expected
- dataset_summary.n_unsuccessful
- dataset_summary.n_predicted_only,
Expand All @@ -289,15 +289,15 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None:
# and that they are not published
self.assertEqual(len(dataset_summary.unsuccessful_datasets), 6)
self.assertEqual(dataset_summary.n_expected, 36)
self.assertEqual(dataset_summary.n_published, 30)
self.assertEqual(dataset_summary.n_visible, 30)

# Check that all the counts add up for every task
self.assertEqual(
dataset_summary.n_expected,
sum(
[
dataset_summary.n_published,
dataset_summary.n_unpublished,
dataset_summary.n_visible,
dataset_summary.n_shadowed,
dataset_summary.n_predicted_only,
dataset_summary.n_cursed,
dataset_summary.n_unsuccessful,
Expand All @@ -324,7 +324,7 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None:
self.assertEqual(task_summary.n_successful, 36)
self.assertEqual(task_summary.n_blocked, 0)
self.assertEqual(task_summary.n_failed, 0)
self.assertEqual(task_summary.n_not_attempted, 0)
self.assertEqual(task_summary.n_unknown, 0)
self.assertEqual(task_summary.n_wonky, 0)
self.assertEqual(task_summary.n_expected, 36)
self.assertListEqual(task_summary.wonky_quanta, [])
Expand All @@ -333,7 +333,7 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None:
task_summary.n_expected,
task_summary.n_successful
+ task_summary.n_blocked
+ task_summary.n_not_attempted
+ task_summary.n_unknown
+ task_summary.n_wonky
+ task_summary.n_failed,
)
Expand All @@ -355,17 +355,17 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None:
# published should equal expected for each dataset.
self.assertEqual(
dataset_summary.n_expected,
dataset_summary.n_published,
dataset_summary.n_visible,
)
# Check that this is the expected number
self.assertEqual(dataset_summary.n_published, 36)
self.assertEqual(dataset_summary.n_visible, 36)
# Check that they all add up
self.assertEqual(
dataset_summary.n_expected,
sum(
[
dataset_summary.n_published,
dataset_summary.n_unpublished,
dataset_summary.n_visible,
dataset_summary.n_shadowed,
dataset_summary.n_predicted_only,
dataset_summary.n_cursed,
dataset_summary.n_unsuccessful,
Expand All @@ -381,8 +381,8 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None:
# Since we have recovered everything, we should have the same
# numbers for every task:
self.assertEqual(dataset_summary.n_expected, 36)
self.assertEqual(dataset_summary.n_published, 36)
self.assertEqual(dataset_summary.n_unpublished, 0)
self.assertEqual(dataset_summary.n_visible, 36)
self.assertEqual(dataset_summary.n_shadowed, 0)
self.assertEqual(dataset_summary.n_predicted_only, 0)

def test_step1_quantum_provenance_graph_qbb(self) -> None:
Expand Down
24 changes: 12 additions & 12 deletions tests/test_rc2_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
# Check that expected, wonky and not attempted do not occur throughout
# tasks:
for label, task_summary in qg_1_sum.tasks.items():
self.assertEqual(task_summary.n_not_attempted, 0)
self.assertEqual(task_summary.n_unknown, 0)
self.assertEqual(task_summary.n_wonky, 0)
self.assertListEqual(task_summary.wonky_quanta, [])
self.assertListEqual(task_summary.recovered_quanta, [])
Expand Down Expand Up @@ -239,13 +239,13 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
# in the final collection; cursed suggests that the dataset is
# published but unsuccessful.
self.assertEqual(dataset_type_summary.n_predicted_only, 0)
self.assertEqual(dataset_type_summary.n_unpublished, 0)
self.assertEqual(dataset_type_summary.n_shadowed, 0)
self.assertEqual(dataset_type_summary.n_cursed, 0)
self.assertListEqual(dataset_type_summary.cursed_datasets, [])
match dataset_type_summary.producer:
# Check that the failure was documented in expected ways:
case "_mock_analyzeObjectTableCore":
self.assertEqual(dataset_type_summary.n_published, 0)
self.assertEqual(dataset_type_summary.n_visible, 0)
self.assertEqual(dataset_type_summary.n_expected, 1)
self.assertEqual(dataset_type_summary.n_unsuccessful, 1)
self.assertListEqual(
Expand All @@ -265,16 +265,16 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
dataset_type_summary.producer == "_mock_analyzeMatchedPreVisitCore"
or dataset_type_summary.producer == "_mock_analyzeMatchedVisitCore"
):
self.assertEqual(dataset_type_summary.n_published, 4)
self.assertEqual(dataset_type_summary.n_visible, 4)
self.assertEqual(dataset_type_summary.n_expected, 4)
elif dataset_type_summary.producer == "_mock_plotPropertyMapTract":
self.assertEqual(dataset_type_summary.n_published, 2)
self.assertEqual(dataset_type_summary.n_visible, 2)
self.assertEqual(dataset_type_summary.n_expected, 2)
elif dataset_type_summary.producer == "_mock_analyzeAmpOffsetMetadata":
self.assertEqual(dataset_type_summary.n_published, 60)
self.assertEqual(dataset_type_summary.n_visible, 60)
self.assertEqual(dataset_type_summary.n_expected, 60)
else:
self.assertEqual(dataset_type_summary.n_published, 1)
self.assertEqual(dataset_type_summary.n_visible, 1)
self.assertEqual(dataset_type_summary.n_expected, 1)

# Now examine the quantum provenance graph after the recovery attempt
Expand All @@ -300,8 +300,8 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
if dataset_type_name == "_mock_analyzeObjectTableCore_log":
continue
else:
self.assertEqual(dataset_type_summary.n_published, 0)
self.assertEqual(dataset_type_summary.n_unpublished, 1)
self.assertEqual(dataset_type_summary.n_visible, 0)
self.assertEqual(dataset_type_summary.n_shadowed, 1)
self.assertEqual(dataset_type_summary.n_expected, 1)
self.assertEqual(dataset_type_summary.n_cursed, 0)
self.assertEqual(dataset_type_summary.n_predicted_only, 0)
Expand All @@ -320,7 +320,7 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
qg_2_sum = qpg2.to_summary(helper.butler)

for label, task_summary in qg_2_sum.tasks.items():
self.assertEqual(task_summary.n_not_attempted, 0)
self.assertEqual(task_summary.n_unknown, 0)
self.assertEqual(task_summary.n_wonky, 0)
self.assertEqual(task_summary.n_blocked, 0)
self.assertListEqual(task_summary.wonky_quanta, [])
Expand Down Expand Up @@ -360,8 +360,8 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
self.assertListEqual(dataset_type_summary.cursed_datasets, [])
self.assertEqual(dataset_type_summary.n_unsuccessful, 0)
self.assertListEqual(dataset_type_summary.unsuccessful_datasets, [])
self.assertEqual(dataset_type_summary.n_unpublished, 0)
self.assertEqual(dataset_type_summary.n_published, dataset_type_summary.n_expected)
self.assertEqual(dataset_type_summary.n_shadowed, 0)
self.assertEqual(dataset_type_summary.n_visible, dataset_type_summary.n_expected)

def test_step8_quantum_provenance_graph_qbb(self) -> None:
self.check_step8_qpg(self.qbb)
Expand Down

0 comments on commit d0ec038

Please sign in to comment.