Skip to content

Commit a931426

Browse files
author
ahmedk
committed
test: Refactor full_path to file_path and add test for better change coverage.
1 parent acd9a6c commit a931426

File tree

3 files changed

+685
-11
lines changed

3 files changed

+685
-11
lines changed

src/extra/calibration.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,15 @@ def from_response(cls, ccv: dict) -> "SingleConstant":
277277
_have_calcat_metadata=True,
278278
)
279279

280-
def full_path(self, caldb_root=None):
280+
def file_path(self, caldb_root=None) -> Path:
281281
if caldb_root is not None:
282282
caldb_root = Path(caldb_root)
283283
else:
284284
caldb_root = _get_default_caldb_root()
285285
return caldb_root / self.path
286286

287287
def dataset_obj(self, caldb_root=None) -> h5py.Dataset:
288-
calpath = self.full_path(caldb_root)
288+
calpath = self.file_path(caldb_root)
289289
f = h5py.File(calpath, "r")
290290
return f[self.dataset]["data"]
291291

@@ -545,15 +545,14 @@ def to_float_or_string(value):
545545
}
546546

547547
@classmethod
548-
def from_condition(
549-
cls,
550-
condition: "ConditionsBase",
551-
detector_name,
552-
calibrations=None,
553-
client=None,
554-
event_at=None,
555-
pdu_snapshot_at=None,
556-
begin_at_strategy="closest",
548+
def from_condition(cls,
549+
condition: "ConditionsBase",
550+
detector_name,
551+
calibrations=None,
552+
client=None,
553+
event_at=None,
554+
pdu_snapshot_at=None,
555+
begin_at_strategy="closest",
557556

558557
):
559558
"""Look up constants for the given detector conditions & timestamp.

0 commit comments

Comments
 (0)