Skip to content

Commit

Permalink
Update variable names and function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
eigerx committed Oct 14, 2024
1 parent fba7e3b commit e3a5cc4
Show file tree
Hide file tree
Showing 2 changed files with 211 additions and 240 deletions.
31 changes: 18 additions & 13 deletions python/lsst/pipe/base/quantum_provenance_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import itertools
import logging
import uuid
from collections.abc import Iterator, Iterable, Sequence
from collections.abc import Iterable, Iterator, Sequence
from enum import Enum
from typing import TYPE_CHECKING, ClassVar, Literal, NamedTuple, TypedDict, cast

Expand Down Expand Up @@ -484,10 +484,10 @@ def add_quantum_info(self, info: QuantumInfo, butler: Butler, do_store_logs: boo
self.n_unknown += 1
case unrecognized_state:
raise AssertionError(f"Unrecognized quantum status {unrecognized_state!r}")

def add_data_id_group(self, other: TaskSummary) -> None:
"""Add information from a `TaskSummary` over one dataquery-identified
group to another, as part of aggregating `Summary` reports.
group to another, as part of aggregating `Summary` reports.
Parameters
----------
Expand All @@ -496,13 +496,13 @@ def add_data_id_group(self, other: TaskSummary) -> None:
"""
self.n_successful += other.n_successful
self.n_blocked += other.n_blocked
self.n_not_attempted += other.n_not_attempted
self.n_unknown += other.n_unknown
self.n_expected += other.n_expected

self.wonky_quanta.extend(other.wonky_quanta)
self.recovered_quanta.extend(other.recovered_quanta)
self.failed_quanta.extend(other.failed_quanta)


class CursedDatasetSummary(pydantic.BaseModel):
"""A summary of all the relevant information on a cursed dataset."""
Expand Down Expand Up @@ -567,7 +567,7 @@ class DatasetTypeSummary(pydantic.BaseModel):
runs.
"""

producer: str
producer: str = ""
"""The name of the task which produced this dataset.
"""

Expand Down Expand Up @@ -643,27 +643,32 @@ def add_dataset_info(self, info: DatasetInfo, producer_info: QuantumInfo) -> Non
self.n_predicted_only += 1
case unrecognized_state:
raise AssertionError(f"Unrecognized dataset status {unrecognized_state!r}")

def add_data_id_group(self, other: DatasetTypeSummary) -> None:
"""Add information from a `DatasetTypeSummary` over one
dataquery-identified group to another, as part of aggregating `Summary`
reports.
reports.
Parameters
----------
other : `DatasetTypeSummary`
`DatasetTypeSummary` to aggregate.
"""
if self.producer:
if self.producer and other.producer:
# Guard against empty string
if self.producer != other.producer:
_LOG.warning("Producer for dataset type is not consistent: %r != %r.", self.producer, other.producer)
_LOG.warning(
"Producer for dataset type is not consistent: %r != %r.", self.producer, other.producer
)
_LOG.warning("Ignoring %r.", other.producer)
else:
self.producer = other.producer
if other.producer and not self.producer:
self.producer = other.producer
if self.producer and not other.producer:
pass

Check warning on line 668 in python/lsst/pipe/base/quantum_provenance_graph.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/quantum_provenance_graph.py#L668

Added line #L668 was not covered by tests

self.n_published += other.n_published
self.n_unpublished += other.n_unpublished
self.n_visible += other.n_visible
self.n_shadowed += other.n_shadowed
self.n_predicted_only += other.n_predicted_only
self.n_expected += other.n_expected

Expand Down
Loading

0 comments on commit e3a5cc4

Please sign in to comment.