Skip to content

Commit

Permalink
Fix dropped skims (#56)
Browse files Browse the repository at this point in the history
* allow ignoring skims

* update min numba

* add tests and doc for ignore

* shared memory pre-init

* non-dask reload of data

* improved logging

* log bytes loaded so far

* fix bug

* docs and tests

* fix dropped skims
  • Loading branch information
jpn-- authored May 14, 2024
1 parent 05c3ce9 commit 5b968ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sharrow/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import re
import time
from collections.abc import Hashable, Iterable, Mapping, Sequence
from pathlib import Path
from typing import TYPE_CHECKING, Any

import numpy as np
Expand Down Expand Up @@ -615,7 +616,7 @@ def reload_from_omx_3d(
use_file_handles = []
opened_file_handles = []
for filename in omx:
if isinstance(filename, str):
if isinstance(filename, (str, Path)):
import openmatrix

h = openmatrix.open_file(filename)
Expand All @@ -642,6 +643,11 @@ def reload_from_omx_3d(

if time_period_sep in data_name:
data_name_x, data_name_t = data_name.split(time_period_sep, 1)
if data_name_x not in dataset:
logger.info(
f"skipping {data_name} because {data_name_x} not in dataset"
)
continue
if len(dataset[data_name_x].dims) != 3:
raise ValueError(
f"dataset variable {data_name_x} has "
Expand Down

0 comments on commit 5b968ae

Please sign in to comment.