1717
1818import copy
1919import html
20- import math
2120import os
2221from collections import Counter , defaultdict
2322from enum import auto
@@ -177,9 +176,10 @@ def __init__(self,
177176 filename ,
178177 trajectory_format : ValidFormats | None = None ,
179178 hdf5_driver : str | None = None ,
179+ * ,
180180 rdcc_nbytes : int | None = None ,
181- rdcc_w0 : float | None = None ,
182181 rdcc_nslots : int | None = None ,
182+ rdcc_w0 : float | None = None ,
183183 fast_load : bool = False ):
184184 self ._filename = filename
185185 self ._hdf5_driver = hdf5_driver
@@ -192,9 +192,9 @@ def __init__(self,
192192
193193 self ._trajectory = self .open_trajectory (self ._format ,
194194 self ._hdf5_driver ,
195- self ._rdcc_nbytes ,
196- self ._rdcc_w0 ,
197- self ._rdcc_nslots ,
195+ rdcc_nbytes = self ._rdcc_nbytes ,
196+ rdcc_nslots = self ._rdcc_nslots ,
197+ rdcc_w0 = self ._rdcc_w0 ,
198198 fast_load = fast_load
199199 )
200200 self ._min_span = None
@@ -469,9 +469,10 @@ def guess_correct_format(self) -> ValidFormats:
469469 def open_trajectory (self ,
470470 trajectory_format ,
471471 hdf5_driver ,
472- rdcc_nbytes ,
473- rdcc_w0 ,
474- rdcc_nslots ,
472+ * ,
473+ rdcc_nbytes : int | None = None ,
474+ rdcc_nslots : int | None = None ,
475+ rdcc_w0 : float | None = None ,
475476 fast_load : bool = False
476477 ):
477478 trajectory_class = available_formats [trajectory_format ]
@@ -510,7 +511,12 @@ def __getstate__(self):
510511
511512 def __setstate__ (self , state ):
512513 self .__dict__ = state
513- self ._trajectory = self .open_trajectory (self ._format , self ._hdf5_driver , self ._rdcc_nbytes , self ._rdcc_w0 , self ._rdcc_nslots , fast_load = True )
514+ self ._trajectory = self .open_trajectory (self ._format ,
515+ self ._hdf5_driver ,
516+ rdcc_nbytes = self ._rdcc_nbytes ,
517+ rdcc_nslots = self ._rdcc_nslots ,
518+ rdcc_w0 = self ._rdcc_w0 ,
519+ fast_load = True )
514520
515521 def __len__ (self ):
516522 return len (self ._trajectory )
@@ -1026,10 +1032,12 @@ def __init__(
10261032 chemical_system : ChemicalSystem ,
10271033 n_steps ,
10281034 selected_atoms = None ,
1035+ * ,
10291036 positions_dtype = np .float64 ,
10301037 chunking_limit = (1 ,128 ),
10311038 compression = "none" ,
10321039 initial_charges = None ,
1040+ meta_block_size : int = 65536
10331041 ):
10341042 """Constructor.
10351043
@@ -1044,7 +1052,7 @@ def __init__(
10441052 """
10451053 self ._h5_filename = Path (h5_filename )
10461054 PLATFORM .create_directory (self ._h5_filename .parent )
1047- self ._h5_file = h5py .File (self ._h5_filename , "w" , meta_block_size = 65536 )
1055+ self ._h5_file = h5py .File (self ._h5_filename , "w" , meta_block_size = meta_block_size )
10481056
10491057 self ._chemical_system = chemical_system
10501058 self ._last_configuration = None
0 commit comments