tecio-python 0.2.0__py3-none-any.whl → 0.2.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tecio/_containers.py +2 -2
- tecio/_io.py +46 -38
- tecio/_meta.py +4 -4
- tecio/cli/__init__.py +3 -3
- tecio/cli/tec2mat.py +21 -21
- tecio/cli/tecaux.py +971 -0
- tecio/cli/tecdump.py +4 -4
- tecio/cli/tecextract.py +6 -6
- tecio/cli/tecfix.py +4 -4
- tecio/cli/tecmerge.py +12 -12
- tecio/cli/teconvert.py +3 -3
- tecio/cli/tecscale.py +7 -7
- tecio/cli/tecslice.py +12 -12
- tecio/cli/tecstats.py +4 -4
- tecio/dat/__init__.py +1 -1
- tecio/dat/_read.py +33 -21
- tecio/dat/_write.py +22 -22
- tecio/libtecio.py +73 -16
- tecio/plt/_read.py +21 -21
- tecio/plt/_write.py +35 -35
- tecio/szl/_read.py +3 -3
- tecio/szl/_write.py +50 -28
- {tecio_python-0.2.0.dist-info → tecio_python-0.2.2.dist-info}/METADATA +1 -1
- tecio_python-0.2.2.dist-info/RECORD +33 -0
- {tecio_python-0.2.0.dist-info → tecio_python-0.2.2.dist-info}/entry_points.txt +1 -0
- {tecio_python-0.2.0.dist-info → tecio_python-0.2.2.dist-info}/licenses/NOTICE +2 -2
- tecio_python-0.2.0.dist-info/RECORD +0 -32
- {tecio_python-0.2.0.dist-info → tecio_python-0.2.2.dist-info}/WHEEL +0 -0
- {tecio_python-0.2.0.dist-info → tecio_python-0.2.2.dist-info}/licenses/LICENSE +0 -0
- {tecio_python-0.2.0.dist-info → tecio_python-0.2.2.dist-info}/top_level.txt +0 -0
tecio/plt/_write.py
CHANGED
|
@@ -82,7 +82,7 @@ def _normalize_precision(precision: DataType | str) -> DataType:
|
|
|
82
82
|
def _infer_data_type(dt: DataType | np.dtype) -> DataType:
|
|
83
83
|
"""Return a C-supported :class:`DataType` for a :class:`DataType` or NumPy dtype.
|
|
84
84
|
|
|
85
|
-
Maps NumPy dtypes to the closest supported Tecplot data type.
|
|
85
|
+
Maps NumPy dtypes to the closest supported Tecplot data type. For PLT format only
|
|
86
86
|
FLOAT and DOUBLE are supported; all integer types are upcast to DOUBLE. precision
|
|
87
87
|
is promoted to ``FLOAT``; 64-bit integers are promoted to ``INT32``; ``int8`` and
|
|
88
88
|
``uint8`` map to ``BYTE``.
|
|
@@ -128,7 +128,7 @@ def _write_data(data: npt.ArrayLike, dtype: np.dtype | DataType | None = None) -
|
|
|
128
128
|
"""Write a single variable's data using ``tecdat142``.
|
|
129
129
|
|
|
130
130
|
``tecdat142`` only accepts ``float32`` or ``float64``; integer types are
|
|
131
|
-
upcast to ``float64``.
|
|
131
|
+
upcast to ``float64``. The array is ravelled in Fortran (column-major)
|
|
132
132
|
order before writing, which matches Tecplot's expected BLOCK layout.
|
|
133
133
|
|
|
134
134
|
Args:
|
|
@@ -198,12 +198,12 @@ class Write:
|
|
|
198
198
|
"""Write Tecplot PLT (``.plt``) files using the classic TecIO API.
|
|
199
199
|
|
|
200
200
|
The classic TecIO API maintains a single implicit global file context;
|
|
201
|
-
only one PLT file may be open at a time.
|
|
201
|
+
only one PLT file may be open at a time. This class wraps that
|
|
202
202
|
procedural API behind the same interface as :class:`szl.Write`.
|
|
203
203
|
|
|
204
204
|
Dataset- and variable-level auxiliary data can be set at any time before
|
|
205
|
-
the first zone is written.
|
|
206
|
-
when the first zone header is created.
|
|
205
|
+
the first zone is written. They are buffered and flushed automatically
|
|
206
|
+
when the first zone header is created. Zone-level auxiliary data is
|
|
207
207
|
passed directly to each zone-writing method.
|
|
208
208
|
|
|
209
209
|
Like :class:`szl.Write`, the file can be opened *eagerly* (when
|
|
@@ -214,10 +214,10 @@ class Write:
|
|
|
214
214
|
Args:
|
|
215
215
|
path: Output file path (should end in ``.plt``).
|
|
216
216
|
title: Dataset title string.
|
|
217
|
-
variables: Variable name list.
|
|
218
|
-
immediately.
|
|
217
|
+
variables: Variable name list. If provided the file is opened
|
|
218
|
+
immediately. If ``None``, the file is opened on the first
|
|
219
219
|
zone write.
|
|
220
|
-
file_type: :class:`~libtecio.FileType` enum.
|
|
220
|
+
file_type: :class:`~libtecio.FileType` enum. Defaults to
|
|
221
221
|
:attr:`~libtecio.FileType.FULL`.
|
|
222
222
|
|
|
223
223
|
Attributes:
|
|
@@ -226,8 +226,8 @@ class Write:
|
|
|
226
226
|
variables: Variable name list, or ``None`` if the file has not been opened
|
|
227
227
|
yet.
|
|
228
228
|
file_type: File type (FULL, GRID, or SOLUTION).
|
|
229
|
-
current_zone: The index of the most recently written zone.
|
|
230
|
-
have been written, ``current_zone`` is ``0``.
|
|
229
|
+
current_zone: The index of the most recently written zone. Before any zones
|
|
230
|
+
have been written, ``current_zone`` is ``0``. During a call to a
|
|
231
231
|
zone writing method, ``current_zone`` still refers to the
|
|
232
232
|
previously written zone. ``current_zone`` is incremented only
|
|
233
233
|
after a zone writing method successfully completes.
|
|
@@ -238,7 +238,7 @@ class Write:
|
|
|
238
238
|
|
|
239
239
|
Caution:
|
|
240
240
|
Unlike the SZL writer, zone data must be written strictly in order: header →
|
|
241
|
-
variable data → connectivity.
|
|
241
|
+
variable data → connectivity. This is enforced internally by the write methods.
|
|
242
242
|
|
|
243
243
|
Examples:
|
|
244
244
|
Define file header fields on open.
|
|
@@ -325,7 +325,7 @@ class Write:
|
|
|
325
325
|
self._opened: bool = False
|
|
326
326
|
|
|
327
327
|
# Running record of everything committed to the file so far (header,
|
|
328
|
-
# aux counts, per-zone dimensions/sharing).
|
|
328
|
+
# aux counts, per-zone dimensions/sharing). Used to validate
|
|
329
329
|
# var_sharing / con_sharing on later zones against what an earlier
|
|
330
330
|
# zone actually wrote, rather than trusting the caller's arrays
|
|
331
331
|
# alone.
|
|
@@ -349,7 +349,7 @@ class Write:
|
|
|
349
349
|
"""Close the file on context-manager exit.
|
|
350
350
|
|
|
351
351
|
The file is closed regardless of whether an exception was raised in
|
|
352
|
-
the ``with`` block.
|
|
352
|
+
the ``with`` block. If closing itself raises, that secondary
|
|
353
353
|
exception is only re-raised when the ``with`` block completed without
|
|
354
354
|
error; otherwise the original exception takes precedence.
|
|
355
355
|
"""
|
|
@@ -419,7 +419,7 @@ class Write:
|
|
|
419
419
|
"""Write buffered dataset- and variable-level aux data to the file.
|
|
420
420
|
|
|
421
421
|
Must be called *after* ``tecini142`` and *before* the first
|
|
422
|
-
``teczne142``.
|
|
422
|
+
``teczne142``. The zone-writing methods call this automatically;
|
|
423
423
|
users need not call it directly unless flushing explicitly.
|
|
424
424
|
|
|
425
425
|
In the classic API:
|
|
@@ -433,7 +433,7 @@ class Write:
|
|
|
433
433
|
for name, value in self.auxdataset.items():
|
|
434
434
|
libtecio.tecauxstr142(str(name), str(value))
|
|
435
435
|
|
|
436
|
-
# Variable-level aux data.
|
|
436
|
+
# Variable-level aux data. Keys may be 1-based int indices or names.
|
|
437
437
|
for key, subdict in self.auxvar.items():
|
|
438
438
|
if isinstance(key, int):
|
|
439
439
|
var_idx = key - 1 # Convert to 0-based
|
|
@@ -492,22 +492,22 @@ class Write:
|
|
|
492
492
|
produce an ``(I, J, 1)`` zone.
|
|
493
493
|
|
|
494
494
|
Args:
|
|
495
|
-
data: Sequence of NumPy arrays, one per active variable.
|
|
496
|
-
arrays must all share the same shape.
|
|
495
|
+
data: Sequence of NumPy arrays, one per active variable. NODAL
|
|
496
|
+
arrays must all share the same shape. CELL_CENTERED arrays
|
|
497
497
|
must have shape ``(imax-1, jmax-1, kmax-1)`` (minimum 1 in
|
|
498
498
|
each dimension).
|
|
499
|
-
title: Zone title.
|
|
500
|
-
variables: Variable name list.
|
|
501
|
-
been opened yet (lazy-open path).
|
|
499
|
+
title: Zone title. Defaults to ``"IJK_Zone_{current_zone + 1}"``.
|
|
500
|
+
variables: Variable name list. Required only when the file has not
|
|
501
|
+
been opened yet (lazy-open path). Ignored on subsequent
|
|
502
502
|
zones once the file is already initialised. Default to
|
|
503
503
|
``[V1, V2, V3, ...]`` if not provided in open or zone call.
|
|
504
|
-
value_locations: Per-variable :class:`ValueLocation`.
|
|
504
|
+
value_locations: Per-variable :class:`ValueLocation`. Defaults to all
|
|
505
505
|
:attr:`~ValueLocation.NODAL`.
|
|
506
506
|
passive_vars: Per-variable passive flags (one per dataset variable, not
|
|
507
|
-
just active variables).
|
|
507
|
+
just active variables). Defaults to all active
|
|
508
508
|
(``False``).
|
|
509
509
|
var_sharing: Per-variable source-zone sharing indices (one per dataset
|
|
510
|
-
variable). ``0`` means no sharing.
|
|
510
|
+
variable). ``0`` means no sharing. Defaults to no
|
|
511
511
|
sharing.
|
|
512
512
|
solution_time: Solution time for transient data (``0.0`` indicates
|
|
513
513
|
steady-state).
|
|
@@ -540,7 +540,7 @@ class Write:
|
|
|
540
540
|
if datapacking != DataPacking.BLOCK:
|
|
541
541
|
raise NotImplementedError(
|
|
542
542
|
"DATAPACKING=POINT is an ASCII-only layout and is not supported "
|
|
543
|
-
"by the PLT binary format.
|
|
543
|
+
"by the PLT binary format. Use DataPacking.BLOCK (the default) "
|
|
544
544
|
"or write to a .dat file instead."
|
|
545
545
|
)
|
|
546
546
|
|
|
@@ -797,27 +797,27 @@ class Write:
|
|
|
797
797
|
Args:
|
|
798
798
|
data: Sequence of 1-D NumPy arrays, one per active variable.
|
|
799
799
|
NODAL arrays must have length ``num_nodes``; CELL_CENTERED
|
|
800
|
-
arrays must have length ``num_cells``.
|
|
800
|
+
arrays must have length ``num_cells``. Both counts are
|
|
801
801
|
inferred from *node_map* (or from the ``con_sharing``
|
|
802
802
|
source zone when *node_map* is omitted).
|
|
803
|
-
zone_type: FE zone type from the ZoneType enum.
|
|
803
|
+
zone_type: FE zone type from the ZoneType enum. Must be one of the
|
|
804
804
|
types in ``_FE_SIMPLE``.
|
|
805
805
|
node_map: Integer array of shape ``(num_cells, nodes_per_cell)`` with
|
|
806
|
-
1-based node indices.
|
|
806
|
+
1-based node indices. Required unless ``con_sharing`` is
|
|
807
807
|
set, in which case the connectivity -- and the node/cell
|
|
808
808
|
counts derived from it -- are inherited from the source
|
|
809
809
|
zone instead.
|
|
810
|
-
title: Zone title.
|
|
811
|
-
variables: Variable name list.
|
|
812
|
-
been opened yet (lazy-open path).
|
|
810
|
+
title: Zone title. Defaults to ``"FE_Zone_{current_zone + 1}"``.
|
|
811
|
+
variables: Variable name list. Required only when the file has not
|
|
812
|
+
been opened yet (lazy-open path). Ignored on subsequent
|
|
813
813
|
zones once the file is already initialised. Default to
|
|
814
814
|
``[V1, V2, V3, ...]`` if not provided in open or zone call.
|
|
815
|
-
value_locations: Per-variable :class:`ValueLocation`.
|
|
815
|
+
value_locations: Per-variable :class:`ValueLocation`. Defaults to all
|
|
816
816
|
:attr:`~ValueLocation.NODAL`.
|
|
817
|
-
passive_vars: Per-variable passive flags (dataset-length).
|
|
817
|
+
passive_vars: Per-variable passive flags (dataset-length). Defaults to
|
|
818
818
|
all active.
|
|
819
819
|
var_sharing: Per-variable sharing zone indices (dataset-length).
|
|
820
|
-
Defaults to no sharing.
|
|
820
|
+
Defaults to no sharing. Cross-checked against
|
|
821
821
|
``node_map`` / ``con_sharing`` for a consistent node/cell
|
|
822
822
|
count.
|
|
823
823
|
con_sharing: Optional zone index that the connectivity is shared from.
|
|
@@ -827,7 +827,7 @@ class Write:
|
|
|
827
827
|
neighbor mode is set to global. Connectivity cannot be
|
|
828
828
|
shared between cell-based and face-based finite element
|
|
829
829
|
zones.
|
|
830
|
-
face_neighbors: Optional face-neighbour connection array.
|
|
830
|
+
face_neighbors: Optional face-neighbour connection array. Its length sets
|
|
831
831
|
``num_face_connections`` in the zone header automatically.
|
|
832
832
|
face_nbr_mode: Face-neighbour mode; used only when *face_neighbors* is
|
|
833
833
|
provided.
|
|
@@ -863,7 +863,7 @@ class Write:
|
|
|
863
863
|
if datapacking != DataPacking.BLOCK:
|
|
864
864
|
raise NotImplementedError(
|
|
865
865
|
"DATAPACKING=POINT is an ASCII-only layout and is not supported "
|
|
866
|
-
"by the PLT binary format.
|
|
866
|
+
"by the PLT binary format. Use DataPacking.BLOCK (the default) "
|
|
867
867
|
"or write to a .dat file instead."
|
|
868
868
|
)
|
|
869
869
|
if zone_type not in _FE_SIMPLE:
|
tecio/szl/_read.py
CHANGED
|
@@ -395,7 +395,7 @@ class ReadZone:
|
|
|
395
395
|
) -> npt.NDArray | None | tuple[npt.NDArray | None, ...]:
|
|
396
396
|
"""Return variable data array(s) for this zone.
|
|
397
397
|
|
|
398
|
-
A single key (0-based index or exact name) returns one array.
|
|
398
|
+
A single key (0-based index or exact name) returns one array. A list of exact
|
|
399
399
|
names returns a tuple of arrays in the order given, suitable for unpacking::
|
|
400
400
|
|
|
401
401
|
p = zone.get_array("p")
|
|
@@ -403,8 +403,8 @@ class ReadZone:
|
|
|
403
403
|
|
|
404
404
|
Returns:
|
|
405
405
|
One array (or ``None`` only if the variable is passive) for a scalar
|
|
406
|
-
key; a tuple of such arrays for a list of names.
|
|
407
|
-
yields a 1-tuple, not a bare array.
|
|
406
|
+
key; a tuple of such arrays for a list of names. A single-element list
|
|
407
|
+
yields a 1-tuple, not a bare array. A shared variable resolves to its
|
|
408
408
|
source zone's array, per :attr:`ReadVariable.values`.
|
|
409
409
|
|
|
410
410
|
Raises:
|
tecio/szl/_write.py
CHANGED
|
@@ -235,7 +235,7 @@ def _write_connectivity(
|
|
|
235
235
|
|
|
236
236
|
Note:
|
|
237
237
|
Both arrays are written using the minimum integer width capable of
|
|
238
|
-
representing the maximum index value present in each array.
|
|
238
|
+
representing the maximum index value present in each array. No copy
|
|
239
239
|
is made for C-contiguous input arrays — ravel(order="C") returns a flat
|
|
240
240
|
view of the node_map or face_neighbors without making a copy
|
|
241
241
|
|
|
@@ -392,8 +392,8 @@ class Write:
|
|
|
392
392
|
file_type: File type (FULL, GRID, or SOLUTION).
|
|
393
393
|
precision: Whole-file floating-point override, or ``None`` for automatic
|
|
394
394
|
per-variable inference.
|
|
395
|
-
current_zone: The index of the most recently written zone.
|
|
396
|
-
have been written, ``current_zone`` is ``0``.
|
|
395
|
+
current_zone: The index of the most recently written zone. Before any zones
|
|
396
|
+
have been written, ``current_zone`` is ``0``. During a call to a
|
|
397
397
|
zone writing method, ``current_zone`` still refers to the
|
|
398
398
|
previously written zone. ``current_zone`` is incremented only
|
|
399
399
|
after a zone writing method successfully completes.
|
|
@@ -505,7 +505,7 @@ class Write:
|
|
|
505
505
|
# -- File lifecycle ----------------------------------------------------------------
|
|
506
506
|
|
|
507
507
|
def _open(self, var_names: list[str]) -> None:
|
|
508
|
-
"""Open the file handle.
|
|
508
|
+
"""Open the file handle. Called exactly once on the first zone."""
|
|
509
509
|
self.variables = var_names
|
|
510
510
|
self.handle = libtecio.tec_file_writer_open(
|
|
511
511
|
filename=self.path,
|
|
@@ -534,7 +534,7 @@ class Write:
|
|
|
534
534
|
def flush_aux(self) -> None:
|
|
535
535
|
"""Write buffered dataset and variable aux data to the file.
|
|
536
536
|
|
|
537
|
-
Called automatically before the first zone is created.
|
|
537
|
+
Called automatically before the first zone is created. You only
|
|
538
538
|
need to call this directly if you want to be explicit.
|
|
539
539
|
|
|
540
540
|
The C library requires dataset and variable aux data to be written
|
|
@@ -550,7 +550,7 @@ class Write:
|
|
|
550
550
|
str(value),
|
|
551
551
|
)
|
|
552
552
|
|
|
553
|
-
# Variable-level aux data.
|
|
553
|
+
# Variable-level aux data. Keys may be 1-based int indices or names.
|
|
554
554
|
for key, subdict in self.auxvar.items():
|
|
555
555
|
if isinstance(key, int):
|
|
556
556
|
var_idx = key - 1 # Convert to 0-based
|
|
@@ -599,6 +599,7 @@ class Write:
|
|
|
599
599
|
strand_id: int = 0,
|
|
600
600
|
aux: dict[str, Any] | None = None,
|
|
601
601
|
datapacking: DataPacking | str = DataPacking.BLOCK,
|
|
602
|
+
flush: bool = False,
|
|
602
603
|
) -> None:
|
|
603
604
|
"""Write a complete IJK-ordered zone.
|
|
604
605
|
|
|
@@ -606,24 +607,24 @@ class Write:
|
|
|
606
607
|
3-D; missing trailing dimensions default to 1.
|
|
607
608
|
|
|
608
609
|
Args:
|
|
609
|
-
data: One NumPy array per dataset variable.
|
|
610
|
+
data: One NumPy array per dataset variable. Array shape is used
|
|
610
611
|
to infer ``imax``, ``jmax``, and ``kmax``; Fortran
|
|
611
|
-
(column-major) order is assumed.
|
|
612
|
+
(column-major) order is assumed. Pass ``None`` to write a
|
|
612
613
|
zone header only.
|
|
613
|
-
title: Zone title.
|
|
614
|
-
variables: Variable name list.
|
|
614
|
+
title: Zone title. Defaults to ``"IJK_Zone_{current_zone + 1}"``.
|
|
615
|
+
variables: Variable name list. Required on the first call when the
|
|
615
616
|
file has not been opened yet (lazy-open path); ignored once
|
|
616
617
|
the file is already initialised. Default to ``[V1, V2, V3,
|
|
617
618
|
...]`` if not provided in open or zone call.
|
|
618
|
-
value_locations: Per-variable :class:`~libtecio.ValueLocation`.
|
|
619
|
+
value_locations: Per-variable :class:`~libtecio.ValueLocation`. Defaults to
|
|
619
620
|
all ``NODAL``.
|
|
620
|
-
passive_vars: Per-variable passive flags.
|
|
621
|
+
passive_vars: Per-variable passive flags. Defaults to all active
|
|
621
622
|
(``False``).
|
|
622
|
-
var_sharing: Per-variable share-from zone index (1-based).
|
|
623
|
+
var_sharing: Per-variable share-from zone index (1-based). Defaults to
|
|
623
624
|
no sharing (all zeros).
|
|
624
|
-
solution_time: Solution time for transient data.
|
|
625
|
+
solution_time: Solution time for transient data. Use ``0.0`` for static
|
|
625
626
|
zones. Default to ``0.0`` if not defined.
|
|
626
|
-
strand_id: Strand ID for transient data.
|
|
627
|
+
strand_id: Strand ID for transient data. Use ``0`` for static
|
|
627
628
|
zones. Default to ``0`` (static) if not defined.
|
|
628
629
|
aux: Zone-level auxiliary data as ``{name: value}`` string
|
|
629
630
|
pairs.
|
|
@@ -631,6 +632,12 @@ class Write:
|
|
|
631
632
|
default). :attr:`~tecio.libtecio.DataPacking.POINT` is an
|
|
632
633
|
ASCII-only layout and is not supported by the SZL binary
|
|
633
634
|
format. Defined only for parity with ASCII writer.
|
|
635
|
+
flush: If ``True``, flush this zone and all previous data to a
|
|
636
|
+
temporary intermediate file immediately after writing,
|
|
637
|
+
releasing data from memory. Defaults to ``False``. Useful
|
|
638
|
+
when memory is a concern, but adds the overhead of a disk
|
|
639
|
+
write. Temporary files are merged back into the final
|
|
640
|
+
output file when :meth:`close` is called.
|
|
634
641
|
|
|
635
642
|
Raises:
|
|
636
643
|
NotImplementedError: If *datapacking* is
|
|
@@ -642,11 +649,11 @@ class Write:
|
|
|
642
649
|
|
|
643
650
|
Note:
|
|
644
651
|
If the file is already open, ``data`` and ``variables`` may be omitted to
|
|
645
|
-
write a zone header only.
|
|
652
|
+
write a zone header only. If the file has not been opened yet,
|
|
646
653
|
``variables`` must be provided on this call.
|
|
647
654
|
|
|
648
655
|
Note:
|
|
649
|
-
Data arrays are written as DOUBLE precision by default.
|
|
656
|
+
Data arrays are written as DOUBLE precision by default. To write other
|
|
650
657
|
types, cast the NumPy arrays before calling (e.g.
|
|
651
658
|
``arr.astype(np.float32)``).
|
|
652
659
|
|
|
@@ -666,7 +673,7 @@ class Write:
|
|
|
666
673
|
if datapacking != DataPacking.BLOCK:
|
|
667
674
|
raise NotImplementedError(
|
|
668
675
|
"DATAPACKING=POINT is an ASCII-only layout and is not supported "
|
|
669
|
-
"by the SZL binary format.
|
|
676
|
+
"by the SZL binary format. Use DataPacking.BLOCK (the default) "
|
|
670
677
|
"or write to a .dat file instead."
|
|
671
678
|
)
|
|
672
679
|
|
|
@@ -878,6 +885,10 @@ class Write:
|
|
|
878
885
|
dt=dtype,
|
|
879
886
|
)
|
|
880
887
|
|
|
888
|
+
# Flush zone data, releasing memory
|
|
889
|
+
if flush:
|
|
890
|
+
libtecio.tec_file_writer_flush(self._check_handle())
|
|
891
|
+
|
|
881
892
|
# Finally set zone metadata after successfully completing TecIO calls
|
|
882
893
|
self._meta.record_zone(
|
|
883
894
|
ZoneMeta(
|
|
@@ -915,6 +926,7 @@ class Write:
|
|
|
915
926
|
strand_id: int = 0,
|
|
916
927
|
aux: dict[str, Any] | None = None,
|
|
917
928
|
datapacking: DataPacking | str = DataPacking.BLOCK,
|
|
929
|
+
flush: bool = False,
|
|
918
930
|
) -> None:
|
|
919
931
|
"""Write a complete finite-element zone.
|
|
920
932
|
|
|
@@ -923,12 +935,12 @@ class Write:
|
|
|
923
935
|
chosen automatically from the max index.
|
|
924
936
|
|
|
925
937
|
Args:
|
|
926
|
-
data: Sequence of 1-D arrays, one per dataset variable.
|
|
938
|
+
data: Sequence of 1-D arrays, one per dataset variable. NODAL
|
|
927
939
|
arrays must have length ``num_nodes``; CELL_CENTERED arrays
|
|
928
940
|
must have length ``num_cells``. ``num_nodes`` and
|
|
929
941
|
``num_cells`` are inferred from ``node_map`` (or from the
|
|
930
942
|
``con_sharing`` source zone when ``node_map`` is omitted).
|
|
931
|
-
zone_type: FE zone type from the ZoneType enum.
|
|
943
|
+
zone_type: FE zone type from the ZoneType enum. Must be one of the
|
|
932
944
|
types in ``_FE_SIMPLE``.
|
|
933
945
|
node_map: Integer array of shape ``(num_cells, nodes_per_cell)``
|
|
934
946
|
containing 1-based node indices. 32- or 64-bit write is
|
|
@@ -936,17 +948,17 @@ class Write:
|
|
|
936
948
|
Required unless ``con_sharing`` is set, in which case the
|
|
937
949
|
connectivity -- and the node/cell counts derived from it --
|
|
938
950
|
are inherited from the source zone instead.
|
|
939
|
-
title: Zone title string.
|
|
951
|
+
title: Zone title string. Defaults to ``"FE_Zone_{current_zone +
|
|
940
952
|
1}"`` if not provided.
|
|
941
|
-
variables: Variable name list.
|
|
942
|
-
been opened yet (lazy-open path).
|
|
953
|
+
variables: Variable name list. Required only when the file has not
|
|
954
|
+
been opened yet (lazy-open path). Ignored on subsequent
|
|
943
955
|
zones once the file is already initialised. Default to
|
|
944
956
|
``[V1, V2, V3, ...]`` if not provided in open or zone call.
|
|
945
|
-
value_locations: Per-variable ValueLocation.
|
|
946
|
-
passive_vars: Per-variable passive flags.
|
|
957
|
+
value_locations: Per-variable ValueLocation. Defaults to all NODAL.
|
|
958
|
+
passive_vars: Per-variable passive flags. Defaults to all active
|
|
947
959
|
(False).
|
|
948
|
-
var_sharing: Per-variable share from zone index.
|
|
949
|
-
sharing.
|
|
960
|
+
var_sharing: Per-variable share from zone index. Defaults to no
|
|
961
|
+
sharing. A shared variable's type and value location are
|
|
950
962
|
inherited from its source zone and are cross-checked
|
|
951
963
|
against ``node_map`` / ``con_sharing`` for a consistent
|
|
952
964
|
node/cell count.
|
|
@@ -970,6 +982,12 @@ class Write:
|
|
|
970
982
|
default). :attr:`~tecio.libtecio.DataPacking.POINT` is an
|
|
971
983
|
ASCII-only layout and is not supported by the SZL binary
|
|
972
984
|
format. Defined only for parity with ASCII writer.
|
|
985
|
+
flush: If ``True``, flush this zone and all previous data to a
|
|
986
|
+
temporary intermediate file immediately after writing,
|
|
987
|
+
releasing data from memory. Defaults to ``False``. Useful
|
|
988
|
+
when memory is a concern, but adds the overhead of a disk
|
|
989
|
+
write. Temporary files are merged back into the final
|
|
990
|
+
output file when :meth:`close` is called.
|
|
973
991
|
|
|
974
992
|
Raises:
|
|
975
993
|
NotImplementedError: For FEPOLYGON, FEPOLYHEDRON, or if *datapacking*
|
|
@@ -1001,7 +1019,7 @@ class Write:
|
|
|
1001
1019
|
if datapacking != DataPacking.BLOCK:
|
|
1002
1020
|
raise NotImplementedError(
|
|
1003
1021
|
"DATAPACKING=POINT is an ASCII-only layout and is not supported "
|
|
1004
|
-
"by the SZL binary format.
|
|
1022
|
+
"by the SZL binary format. Use DataPacking.BLOCK (the default) "
|
|
1005
1023
|
"or write to a .dat file instead."
|
|
1006
1024
|
)
|
|
1007
1025
|
if zone_type not in _FE_SIMPLE:
|
|
@@ -1215,6 +1233,10 @@ class Write:
|
|
|
1215
1233
|
face_neighbors_arr,
|
|
1216
1234
|
)
|
|
1217
1235
|
|
|
1236
|
+
# Flush zone data, releasing memory
|
|
1237
|
+
if flush:
|
|
1238
|
+
libtecio.tec_file_writer_flush(self._check_handle())
|
|
1239
|
+
|
|
1218
1240
|
# Finally set zone metadata after successfully completing TecIO calls
|
|
1219
1241
|
self._meta.record_zone(
|
|
1220
1242
|
ZoneMeta(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tecio-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Python interface for reading and writing Tecplot data files
|
|
5
5
|
Project-URL: Homepage, https://github.com/meersman/tecio
|
|
6
6
|
Project-URL: Documentation, https://meersman.github.io/tecio/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
tecio/__init__.py,sha256=aTfvQBQ9YJ1eUw0WDNRSktqx1D2fRTcoWqzvMbMtBLw,918
|
|
2
|
+
tecio/_containers.py,sha256=T-wAycLtjVJKC_ieM_bW0yIn9MI-Vu_rXlkSidk5uRU,10441
|
|
3
|
+
tecio/_io.py,sha256=TSVn3UQ_gd7QF4d9urrCaS-RvEOG2dYIeGp6Srqh_J0,31126
|
|
4
|
+
tecio/_meta.py,sha256=yR21qg7evwxnYZOmmz5txgdDBs8X0Gd1zo78uxebXCg,7356
|
|
5
|
+
tecio/_utils.py,sha256=rPK5w2SxwQQCxRKdwhBDNdl8QTup1HLCCSnC1pzgdRI,8755
|
|
6
|
+
tecio/libtecio.py,sha256=LB-C4FpaSG8Q5YEHneIk4VSXJf_RLu8iEV4C5uzbs3c,114505
|
|
7
|
+
tecio/cli/__init__.py,sha256=jC0QuRCfZ8EJNgk_Lsc8VWathE0yhmt9uSUl346Su9o,1087
|
|
8
|
+
tecio/cli/tec2mat.py,sha256=uqc8Z5VMYSk8wAIeWxlqebUPXzJDw-cV18vabJh6aZM,18157
|
|
9
|
+
tecio/cli/tecaux.py,sha256=cA5ALdsNJOORtDNALvM-2Cg-pkuMAGkQINBpHKnvvoE,35913
|
|
10
|
+
tecio/cli/tecdump.py,sha256=YmcRN-6swB0f0A5k5eVSxLaawkcKRKZXxEMmnh_7C6Y,10945
|
|
11
|
+
tecio/cli/tecextract.py,sha256=-oy3b8yw6K099cb5Y5MFzeclYKQE5YqgtRDXOQSg1G0,15394
|
|
12
|
+
tecio/cli/tecfix.py,sha256=NdLb00EQLE_Oawla4GenjXUvaMGUB_T5d52l8HDsCNI,19456
|
|
13
|
+
tecio/cli/tecmerge.py,sha256=Bpusvt9yXnNBcfBXLvb2HX47L4rsu7j7RdU3XSdl4MA,19735
|
|
14
|
+
tecio/cli/teconvert.py,sha256=7R4vvGyM_hvgRVvxZCgnJOM4Yw_5iKSDn1ViHlF5RxY,12008
|
|
15
|
+
tecio/cli/tecscale.py,sha256=3j-BmQiQVy2V36XpZaTXfwwZjopRBRVm5D89c62Es38,13977
|
|
16
|
+
tecio/cli/tecslice.py,sha256=KTMqmfL-NzMr0g7_9eaXqZFVw6_qkpi6ISBrAePSDRM,34775
|
|
17
|
+
tecio/cli/tecstats.py,sha256=kdpYea6RuEcFf775kJQmiG0sjU9pnnDAizmGnl7bDfU,18355
|
|
18
|
+
tecio/dat/__init__.py,sha256=vSSwGS9lE72hnkuX3nAu_tUUp9fwe7uAxgzDicdvBo0,2671
|
|
19
|
+
tecio/dat/_read.py,sha256=SHmxUZcHJ2vl0hqQxvSUrRA5_QCQ_MR-HAC_-j-SdkU,59435
|
|
20
|
+
tecio/dat/_write.py,sha256=RNuRwp8RO4tbHjr1DFRYaNGwRClRiM0uzwxDbgPNaIk,47706
|
|
21
|
+
tecio/plt/__init__.py,sha256=13aEKPaShMzV4_5kyohhsmSqeA5Aur0oF6P0DGispSA,1078
|
|
22
|
+
tecio/plt/_read.py,sha256=una-rHk5XA_TMzBwddj3eLK9uSIGHdiqdOfpTw2uYg4,56790
|
|
23
|
+
tecio/plt/_write.py,sha256=SVMhneFxNZWzxDDyr3BtW7Lc6b7pzVUqFh6d6bDaWGo,46378
|
|
24
|
+
tecio/szl/__init__.py,sha256=03chcSDXZoBZ3j1vygBkgjjuPqJvth2yoWYbnpdqhHw,1406
|
|
25
|
+
tecio/szl/_read.py,sha256=6tdqNTNzEczSazN8sgq0AfPkGBuovib9pk_0H-MdD5c,27935
|
|
26
|
+
tecio/szl/_write.py,sha256=pRtDELr88gRpOiV8jPDLRbXOdy31d1QPwliX3_7j4oI,53596
|
|
27
|
+
tecio_python-0.2.2.dist-info/licenses/LICENSE,sha256=WYmcYJG1QFgu1hfo7qrEkZ3Jhcz8NUWe6XUraZvlIFs,10172
|
|
28
|
+
tecio_python-0.2.2.dist-info/licenses/NOTICE,sha256=bDcDOguk8dYN4FpHJCHuCsDgR2VnP5XlK2C4BzVCtwg,340
|
|
29
|
+
tecio_python-0.2.2.dist-info/METADATA,sha256=pHyrJXiNYJSkpMjSvbCYQdPZuFFh6mWa8tGSNt2MDmQ,5078
|
|
30
|
+
tecio_python-0.2.2.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
31
|
+
tecio_python-0.2.2.dist-info/entry_points.txt,sha256=TH2UnRF700KO0GjeRFwkBBtFKN1PyP2tgrc11OsVNAc,362
|
|
32
|
+
tecio_python-0.2.2.dist-info/top_level.txt,sha256=ayCfhWQNUimgwyaTSyamJ3LbgjloZRWl2vlcZCjYWmQ,6
|
|
33
|
+
tecio_python-0.2.2.dist-info/RECORD,,
|
|
@@ -2,8 +2,8 @@ tecio-python
|
|
|
2
2
|
Copyright 2025 John Meersman
|
|
3
3
|
|
|
4
4
|
This product requires the Tecplot TecIO library, which is proprietary software
|
|
5
|
-
owned by Tecplot, Inc. and is not covered by this license.
|
|
6
|
-
|
|
5
|
+
owned by Tecplot, Inc. and is not covered by this license. Tecplot and TecIO
|
|
6
|
+
are trademarks of Tecplot, Inc.
|
|
7
7
|
|
|
8
8
|
The license agreement for the TecIO compiled shared libraries is located at:
|
|
9
9
|
lib/tecio_license_agreement.txt
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
tecio/__init__.py,sha256=aTfvQBQ9YJ1eUw0WDNRSktqx1D2fRTcoWqzvMbMtBLw,918
|
|
2
|
-
tecio/_containers.py,sha256=bEW0fu0fiCQnAJNveiaGYbSs1F4lpKOr40ijm5O8UOM,10443
|
|
3
|
-
tecio/_io.py,sha256=c6bY6nnlKsKAYP7HFCl66wcyzdnQryJHVNCI1DRB7d0,30566
|
|
4
|
-
tecio/_meta.py,sha256=4_88COTceqI7woPNGeXF_KJ9JlEWLg9jmzsYZJDuHzI,7360
|
|
5
|
-
tecio/_utils.py,sha256=rPK5w2SxwQQCxRKdwhBDNdl8QTup1HLCCSnC1pzgdRI,8755
|
|
6
|
-
tecio/libtecio.py,sha256=iK2aaUAC5flINc8O1FatvNLRblDhDcfr5S-f6MFwWKY,111742
|
|
7
|
-
tecio/cli/__init__.py,sha256=lS6d-vlA64CshzmtrRw3YVGqjMedB-ST7rkbm11UVIA,1090
|
|
8
|
-
tecio/cli/tec2mat.py,sha256=CypQGKfArMFZg5LkZRpXHQD0PUaKuUSQBqrOLkkxkN8,18178
|
|
9
|
-
tecio/cli/tecdump.py,sha256=Ry3FYSblshgOwjtPfH71536lhKIqjgA1HJqK7zrO4Qo,10949
|
|
10
|
-
tecio/cli/tecextract.py,sha256=1bqQi6AkabGawslsqUtdOX0__Sx_dD9pUrNCWCHxSbA,15400
|
|
11
|
-
tecio/cli/tecfix.py,sha256=lwin4d5pPN30ZyVvVfBmRLCkSnURwGMAG_Ny7nMF37w,19460
|
|
12
|
-
tecio/cli/tecmerge.py,sha256=2O69lWVtp5aDepKQGUIhib-mIAv--Y12AQfem_4nHno,19747
|
|
13
|
-
tecio/cli/teconvert.py,sha256=0THQ0KggobElif3am3Nq_Kdhq0pLNSrNBLUikKPTZzk,12011
|
|
14
|
-
tecio/cli/tecscale.py,sha256=jjv2GUQ0CeRvgRTWaVKnk4Ot5iZnlXU8VNUgYJXAg8E,13984
|
|
15
|
-
tecio/cli/tecslice.py,sha256=_OqRls6HZ_lJ6-COQ9P2G6qVuo0LNBWaLj_pb0UMzTk,34787
|
|
16
|
-
tecio/cli/tecstats.py,sha256=NXAInnDvv6UveOHuCjFUw2frlrlNnJDwZ6_DrzizK4E,18359
|
|
17
|
-
tecio/dat/__init__.py,sha256=nkjRnmvevjpxX7fj_iCHAxKrzPIrFqLgpnYDwiLRExY,2672
|
|
18
|
-
tecio/dat/_read.py,sha256=Qk7QGMictGOC8GMfxwHuvG0DzYw83-vNO5Ui2450LXk,58779
|
|
19
|
-
tecio/dat/_write.py,sha256=Bs_HSobk7NvbUFoPlLOQrGpB4wEf3uQjxPPCUT253nM,47729
|
|
20
|
-
tecio/plt/__init__.py,sha256=13aEKPaShMzV4_5kyohhsmSqeA5Aur0oF6P0DGispSA,1078
|
|
21
|
-
tecio/plt/_read.py,sha256=EYpSKostFTwLWUZc0-CkdqPnhvmvI35RHnQVgXGVIh4,56811
|
|
22
|
-
tecio/plt/_write.py,sha256=ugXqzuMe-vHOrZjrwZPVz4izXsDc_7KkjDrXZsX3t2o,46413
|
|
23
|
-
tecio/szl/__init__.py,sha256=03chcSDXZoBZ3j1vygBkgjjuPqJvth2yoWYbnpdqhHw,1406
|
|
24
|
-
tecio/szl/_read.py,sha256=rTbwo2FSbc4T8kEKYMpPgK36zsNfVrUZeuWNvBy9Cok,27938
|
|
25
|
-
tecio/szl/_write.py,sha256=aSgxZ0E23yGdeBL4v4qt9lpxEOH7dQmvgt6-ajWvuD4,52316
|
|
26
|
-
tecio_python-0.2.0.dist-info/licenses/LICENSE,sha256=WYmcYJG1QFgu1hfo7qrEkZ3Jhcz8NUWe6XUraZvlIFs,10172
|
|
27
|
-
tecio_python-0.2.0.dist-info/licenses/NOTICE,sha256=94EJ-1hUlQE8JyLtMbaVpmj8EMDjJ1jGr_9OBZQnQ-c,340
|
|
28
|
-
tecio_python-0.2.0.dist-info/METADATA,sha256=W9_Fn8nh73vqi6w34TkgKGIL7qvAD5AX1WOu9HmQfb4,5078
|
|
29
|
-
tecio_python-0.2.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
30
|
-
tecio_python-0.2.0.dist-info/entry_points.txt,sha256=s_LNBH5m4lCgwxEMcD4wAUKbz5KjlFXFBPzULV_aStY,331
|
|
31
|
-
tecio_python-0.2.0.dist-info/top_level.txt,sha256=ayCfhWQNUimgwyaTSyamJ3LbgjloZRWl2vlcZCjYWmQ,6
|
|
32
|
-
tecio_python-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|