Skip to content

Commit

Permalink
Remove compatibility code for old asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Feb 5, 2025
1 parent 15f7659 commit 7b19803
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions dkist/dataset/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
ASDF_FILENAME_PATTERN = r"^(?P<instrument>[A-Z-]+)_L1_(?P<timestamp>\d{8}T\d{6})_(?P<datasetid>[A-Z]{5,})(?P<suffix>_user_tools|_metadata)?.asdf$"


def asdf_open_memory_mapping_kwarg(memmap: bool) -> dict:
if asdf.__version__ > "3.1.0":
return {"memmap": memmap}
return {"copy_arrays": not memmap}


@singledispatch
def load_dataset(target):
"""
Expand Down Expand Up @@ -241,7 +235,7 @@ def _load_from_asdf(filepath):
try:
with importlib_resources.as_file(importlib_resources.files("dkist.io") / "level_1_dataset_schema.yaml") as schema_path:
with asdf.open(filepath, custom_schema=schema_path.as_posix(),
lazy_load=False, **asdf_open_memory_mapping_kwarg(memmap=False)) as ff:
lazy_load=False, memmap=False) as ff:
ds = ff.tree["dataset"]
ds.meta["history"] = ff.tree["history"]
if isinstance(ds, TiledDataset):
Expand Down

0 comments on commit 7b19803

Please sign in to comment.