You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to open series with the viewer results in (same for trying the %T syntax directly):
fromopenpmd_viewerimportOpenPMDTimeSeriests=OpenPMDTimeSeries("opmd.00007.bp/",backend="openpmd-api")
[AbstractIOHandlerImpl] IOTaskREAD_ATTfailedwithexception. ClearingIOqueueandpassingontheexception.
---------------------------------------------------------------------------RuntimeErrorTraceback (mostrecentcalllast)
CellIn[3], line1---->1ts=OpenPMDTimeSeries("opmd.00007.bp[/](http://localhost:8798/)",backend="openpmd-api")
File [~/venv/lib/python3.11/site-packages/openpmd_viewer/openpmd_timeseries/main.py:73](python3.11/site-packages/openpmd_viewer/openpmd_timeseries/main.py#line=72), in OpenPMDTimeSeries.__init__(self, path_to_dir, check_all_files, backend)70self.data_reader=DataReader(backend)
72# Extract the iterations available in this timeseries--->73self.iterations=self.data_reader.list_iterations(path_to_dir)
75# Check that there are files in this directory76iflen(self.iterations) ==0:
File [~/venv/lib/python3.11/site-packages/openpmd_viewer/openpmd_timeseries/data_reader/data_reader.py:116](http://localhost:8798/home/pgrete/venv/lib/python3.11/site-packages/openpmd_viewer/openpmd_timeseries/data_reader/data_reader.py#line=115), in DataReader.list_iterations(self, path_to_dir)113file_path=re.sub(r'(\d+)(\.(?!\d).+$)', r'%T\2', first_file_name)
114series_name=os.path.join( path_to_dir, file_path)
-->116self.series=io.Series(
117series_name,
118#"opmd.%T.bp,119io.Access.read_only )
120iterations=np.array( self.series.iterations )
122returniterationsRuntimeError: [json.exception.type_error.305] cannotuseoperator[] withastringargumentwitharray
Hardcoding the series name fixes it:
if is_single_file:
file_path = path_to_dir
series_name = file_path
else:
# match last occurance of integers and replace with %T wildcards
# examples: data00000100.h5 diag4_00000500.h5 io12.0.bp
# te42st.1234.yolo.json scan7_run14_data123.h5
file_path = re.sub(r'(\d+)(\.(?!\d).+$)', r'%T\2', first_file_name)
series_name = os.path.join( path_to_dir, file_path)
self.series = io.Series(
#series_name,
"opmd.%T.bp/",
io.Access.read_only )
iterations = np.array( self.series.iterations )
Am I doing sth wrong or is the regex parsing not working as expected?
The text was updated successfully, but these errors were encountered:
Trying to open series with the
viewer
results in (same for trying the%T
syntax directly):Hardcoding the series name fixes it:
Am I doing sth wrong or is the regex parsing not working as expected?
The text was updated successfully, but these errors were encountered: