@@ -18,6 +18,12 @@ class migrate_to_h5dpf(Operator):
1818
1919 Parameters
2020 ----------
21+ dataset_size_compression_threshold : int, optional
22+ Integer value that defines the minimum
23+ dataset size (in bytes) to use h5
24+ native compression applicable for
25+ arrays of floats, doubles and
26+ integers.
2127 h5_native_compression : int, optional
2228 Integer value that defines the h5 native
2329 compression used 0: no compression
@@ -65,6 +71,8 @@ class migrate_to_h5dpf(Operator):
6571 >>> op = dpf.operators.result.migrate_to_h5dpf()
6672
6773 >>> # Make input connections
74+ >>> my_dataset_size_compression_threshold = int()
75+ >>> op.inputs.dataset_size_compression_threshold.connect(my_dataset_size_compression_threshold)
6876 >>> my_h5_native_compression = int()
6977 >>> op.inputs.h5_native_compression.connect(my_h5_native_compression)
7078 >>> my_export_floats = bool()
@@ -86,6 +94,7 @@ class migrate_to_h5dpf(Operator):
8694
8795 >>> # Instantiate operator and connect inputs in one line
8896 >>> op = dpf.operators.result.migrate_to_h5dpf(
97+ ... dataset_size_compression_threshold=my_dataset_size_compression_threshold,
8998 ... h5_native_compression=my_h5_native_compression,
9099 ... export_floats=my_export_floats,
91100 ... filename=my_filename,
@@ -103,6 +112,7 @@ class migrate_to_h5dpf(Operator):
103112
104113 def __init__ (
105114 self ,
115+ dataset_size_compression_threshold = None ,
106116 h5_native_compression = None ,
107117 export_floats = None ,
108118 filename = None ,
@@ -118,6 +128,10 @@ def __init__(
118128 super ().__init__ (name = "hdf5::h5dpf::migrate_file" , config = config , server = server )
119129 self ._inputs = InputsMigrateToH5Dpf (self )
120130 self ._outputs = OutputsMigrateToH5Dpf (self )
131+ if dataset_size_compression_threshold is not None :
132+ self .inputs .dataset_size_compression_threshold .connect (
133+ dataset_size_compression_threshold
134+ )
121135 if h5_native_compression is not None :
122136 self .inputs .h5_native_compression .connect (h5_native_compression )
123137 if export_floats is not None :
@@ -147,6 +161,16 @@ def _spec():
147161 spec = Specification (
148162 description = description ,
149163 map_input_pin_spec = {
164+ - 5 : PinSpecification (
165+ name = "dataset_size_compression_threshold" ,
166+ type_names = ["int32" ],
167+ optional = True ,
168+ document = """Integer value that defines the minimum
169+ dataset size (in bytes) to use h5
170+ native compression applicable for
171+ arrays of floats, doubles and
172+ integers.""" ,
173+ ),
150174 - 2 : PinSpecification (
151175 name = "h5_native_compression" ,
152176 type_names = ["int32" ],
@@ -277,6 +301,8 @@ class InputsMigrateToH5Dpf(_Inputs):
277301 --------
278302 >>> from ansys.dpf import core as dpf
279303 >>> op = dpf.operators.result.migrate_to_h5dpf()
304+ >>> my_dataset_size_compression_threshold = int()
305+ >>> op.inputs.dataset_size_compression_threshold.connect(my_dataset_size_compression_threshold)
280306 >>> my_h5_native_compression = int()
281307 >>> op.inputs.h5_native_compression.connect(my_h5_native_compression)
282308 >>> my_export_floats = bool()
@@ -299,6 +325,10 @@ class InputsMigrateToH5Dpf(_Inputs):
299325
300326 def __init__ (self , op : Operator ):
301327 super ().__init__ (migrate_to_h5dpf ._spec ().inputs , op )
328+ self ._dataset_size_compression_threshold = Input (
329+ migrate_to_h5dpf ._spec ().input_pin (- 5 ), - 5 , op , - 1
330+ )
331+ self ._inputs .append (self ._dataset_size_compression_threshold )
302332 self ._h5_native_compression = Input (
303333 migrate_to_h5dpf ._spec ().input_pin (- 2 ), - 2 , op , - 1
304334 )
@@ -328,6 +358,30 @@ def __init__(self, op: Operator):
328358 )
329359 self ._inputs .append (self ._filtering_workflow )
330360
361+ @property
362+ def dataset_size_compression_threshold (self ):
363+ """Allows to connect dataset_size_compression_threshold input to the operator.
364+
365+ Integer value that defines the minimum
366+ dataset size (in bytes) to use h5
367+ native compression applicable for
368+ arrays of floats, doubles and
369+ integers.
370+
371+ Parameters
372+ ----------
373+ my_dataset_size_compression_threshold : int
374+
375+ Examples
376+ --------
377+ >>> from ansys.dpf import core as dpf
378+ >>> op = dpf.operators.result.migrate_to_h5dpf()
379+ >>> op.inputs.dataset_size_compression_threshold.connect(my_dataset_size_compression_threshold)
380+ >>> # or
381+ >>> op.inputs.dataset_size_compression_threshold(my_dataset_size_compression_threshold)
382+ """
383+ return self ._dataset_size_compression_threshold
384+
331385 @property
332386 def h5_native_compression (self ):
333387 """Allows to connect h5_native_compression input to the operator.
0 commit comments