File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 77import re
88import time
99from collections .abc import Hashable , Iterable , Mapping , Sequence
10+ from pathlib import Path
1011from typing import TYPE_CHECKING , Any
1112
1213import numpy as np
@@ -615,7 +616,7 @@ def reload_from_omx_3d(
615616 use_file_handles = []
616617 opened_file_handles = []
617618 for filename in omx :
618- if isinstance (filename , str ):
619+ if isinstance (filename , ( str , Path ) ):
619620 import openmatrix
620621
621622 h = openmatrix .open_file (filename )
@@ -642,6 +643,11 @@ def reload_from_omx_3d(
642643
643644 if time_period_sep in data_name :
644645 data_name_x , data_name_t = data_name .split (time_period_sep , 1 )
646+ if data_name_x not in dataset :
647+ logger .info (
648+ f"skipping { data_name } because { data_name_x } not in dataset"
649+ )
650+ continue
645651 if len (dataset [data_name_x ].dims ) != 3 :
646652 raise ValueError (
647653 f"dataset variable { data_name_x } has "
You can’t perform that action at this time.
0 commit comments