tecio-python 0.2.2__tar.gz → 0.2.3__tar.gz
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_python-0.2.2/tecio_python.egg-info → tecio_python-0.2.3}/PKG-INFO +2 -2
- {tecio_python-0.2.2 → tecio_python-0.2.3}/pyproject.toml +12 -2
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/__init__.py +1 -1
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/tec2mat.py +2 -2
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/tecdump.py +1 -1
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/tecfix.py +2 -2
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/tecmerge.py +4 -3
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/teconvert.py +2 -2
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/tecscale.py +1 -1
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/tecslice.py +10 -9
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/tecstats.py +2 -2
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/dat/_read.py +17 -5
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/plt/_read.py +1 -1
- tecio_python-0.2.3/tecio/plugins/paraview/TecplotTecioReader.py +1070 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3/tecio_python.egg-info}/PKG-INFO +2 -2
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio_python.egg-info/SOURCES.txt +1 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/LICENSE +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/NOTICE +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/README.md +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/setup.cfg +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/_containers.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/_io.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/_meta.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/_utils.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/__init__.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/tecaux.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/cli/tecextract.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/dat/__init__.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/dat/_write.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/libtecio.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/plt/__init__.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/plt/_write.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/szl/__init__.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/szl/_read.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio/szl/_write.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio_python.egg-info/dependency_links.txt +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio_python.egg-info/entry_points.txt +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio_python.egg-info/requires.txt +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tecio_python.egg-info/top_level.txt +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tests/test_cli.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tests/test_io.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tests/test_libtecio.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tests/test_read.py +0 -0
- {tecio_python-0.2.2 → tecio_python-0.2.3}/tests/test_write.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tecio-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
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/
|
|
@@ -21,7 +21,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
21
21
|
Classifier: Typing :: Typed
|
|
22
22
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
23
23
|
Classifier: Operating System :: OS Independent
|
|
24
|
-
Requires-Python: >=3.
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
License-File: LICENSE
|
|
27
27
|
License-File: NOTICE
|
|
@@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tecio-python"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.3"
|
|
8
8
|
description = "Python interface for reading and writing Tecplot data files"
|
|
9
9
|
|
|
10
10
|
readme = "README.md"
|
|
11
|
-
requires-python = ">=3.
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
12
|
dependencies = [
|
|
13
13
|
"numpy",
|
|
14
14
|
]
|
|
@@ -101,9 +101,19 @@ ignore = ["D203", "D213", "SIM105"]
|
|
|
101
101
|
[tool.ruff.lint.pydocstyle]
|
|
102
102
|
convention = "google"
|
|
103
103
|
|
|
104
|
+
[tool.ty.environment]
|
|
105
|
+
root = ["."]
|
|
106
|
+
python-version = "3.11"
|
|
107
|
+
|
|
104
108
|
[tool.ty.terminal]
|
|
105
109
|
output-format = "concise"
|
|
106
110
|
|
|
111
|
+
[[tool.ty.overrides]]
|
|
112
|
+
include = ["tecio/plugins/**"]
|
|
113
|
+
|
|
114
|
+
[tool.ty.overrides.rules]
|
|
115
|
+
unresolved-import = "ignore"
|
|
116
|
+
|
|
107
117
|
[tool.pytest.ini_options]
|
|
108
118
|
pythonpath = ["tecio"]
|
|
109
119
|
testpaths = ["tests"]
|
|
@@ -9,7 +9,7 @@ from importlib import metadata
|
|
|
9
9
|
try:
|
|
10
10
|
__version__ = metadata.version("tecio")
|
|
11
11
|
except metadata.PackageNotFoundError:
|
|
12
|
-
__version__ = "0.
|
|
12
|
+
__version__ = "0.2.3"
|
|
13
13
|
|
|
14
14
|
from . import cli, dat, libtecio, plt, szl
|
|
15
15
|
from ._containers import VariableList, ZoneList
|
|
@@ -136,9 +136,9 @@ Examples:
|
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
See Also:
|
|
139
|
-
* :mod:`tecio.cli.teconvert
|
|
139
|
+
* :mod:`tecio.cli.teconvert` - Convert between Tecplot file formats (``.szplt``,
|
|
140
140
|
``.plt``, ``.dat``) without leaving the Tecplot ecosystem.
|
|
141
|
-
* :mod:`tecio.cli.tecdump
|
|
141
|
+
* :mod:`tecio.cli.tecdump` - Inspect the full contents and metadata of a file before
|
|
142
142
|
converting it.
|
|
143
143
|
|
|
144
144
|
Note:
|
|
@@ -70,7 +70,7 @@ Examples:
|
|
|
70
70
|
See Also:
|
|
71
71
|
* :mod:`tecio.cli.tecstats` - Compute per-zone min, max, and mean statistics without
|
|
72
72
|
printing raw values.
|
|
73
|
-
* :mod:`tecio.cli.tecfix
|
|
73
|
+
* :mod:`tecio.cli.tecfix` - Rewrite a file with invalid variable
|
|
74
74
|
arrays set to passive once bad values have been identified.
|
|
75
75
|
"""
|
|
76
76
|
|
|
@@ -66,9 +66,9 @@ Examples:
|
|
|
66
66
|
tecfix(["flow.szplt", "--output", "clean.szplt"])
|
|
67
67
|
|
|
68
68
|
See Also:
|
|
69
|
-
* :mod:`tecio.cli.tecdump
|
|
69
|
+
* :mod:`tecio.cli.tecdump` - Inspect file contents and metadata to
|
|
70
70
|
identify zones or variables that may require fixing.
|
|
71
|
-
* :mod:`tecio.cli.tecstats
|
|
71
|
+
* :mod:`tecio.cli.tecstats` - Compute per-zone min, max, and mean
|
|
72
72
|
statistics without printing raw values.
|
|
73
73
|
|
|
74
74
|
Note:
|
|
@@ -83,10 +83,10 @@ Examples:
|
|
|
83
83
|
tecmerge(["part1.szplt", "part2.szplt", "--output", "combined.szplt"])
|
|
84
84
|
|
|
85
85
|
See Also:
|
|
86
|
-
* :mod:`tecio.cli.tecextract
|
|
86
|
+
* :mod:`tecio.cli.tecextract` - Extract a zone/variable subset from a single file —
|
|
87
87
|
the inverse of merging.
|
|
88
|
-
* :mod:`tecio.cli.tecsplit
|
|
89
|
-
* :mod:`tecio.cli.tecslice
|
|
88
|
+
* :mod:`tecio.cli.tecsplit` - Split a file into separate grid and solution files.
|
|
89
|
+
* :mod:`tecio.cli.tecslice` - Extract planar slices from volumetric zone data.
|
|
90
90
|
|
|
91
91
|
"""
|
|
92
92
|
|
|
@@ -155,6 +155,7 @@ def _parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace:
|
|
|
155
155
|
),
|
|
156
156
|
)
|
|
157
157
|
parser.add_argument(
|
|
158
|
+
"-f",
|
|
158
159
|
"--force",
|
|
159
160
|
action="store_true",
|
|
160
161
|
default=False,
|
|
@@ -71,7 +71,7 @@ Examples:
|
|
|
71
71
|
teconvert(["-dat", "-o", "flow.dat", "flow.szplt"])
|
|
72
72
|
|
|
73
73
|
See Also:
|
|
74
|
-
:mod:`tecio.cli.tecextract
|
|
74
|
+
:mod:`tecio.cli.tecextract` - Extract a zone/variable subset while simultaneously
|
|
75
75
|
converting format via the output file extension.
|
|
76
76
|
"""
|
|
77
77
|
|
|
@@ -132,7 +132,7 @@ def _parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace:
|
|
|
132
132
|
" Explicit output path\n"
|
|
133
133
|
" $ teconvert -plt -o /tmp/out.plt flow.dat\n"
|
|
134
134
|
" Overwrite existing\n"
|
|
135
|
-
"
|
|
135
|
+
" $ teconvert --force -dat flow.szplt\n"
|
|
136
136
|
),
|
|
137
137
|
formatter_class=lambda prog: argparse.RawDescriptionHelpFormatter(
|
|
138
138
|
prog, width=70, max_help_position=24
|
|
@@ -80,7 +80,7 @@ Examples:
|
|
|
80
80
|
tecscale(["-variable", "Pressure", "-scale", "1e-3", "flow.szplt"])
|
|
81
81
|
|
|
82
82
|
See Also:
|
|
83
|
-
:mod:`tecio.cli.teconvert
|
|
83
|
+
:mod:`tecio.cli.teconvert` - Convert between Tecplot file formats without applying
|
|
84
84
|
any variable transformation.
|
|
85
85
|
|
|
86
86
|
"""
|
|
@@ -114,10 +114,10 @@ Examples:
|
|
|
114
114
|
tecslice(["-i", "::2", "-o", "thinned.szplt", "flow.szplt"])
|
|
115
115
|
|
|
116
116
|
See Also:
|
|
117
|
-
* :mod:`tecio.cli.tecextract
|
|
117
|
+
* :mod:`tecio.cli.tecextract` - Extract a subset of zones or variables by index
|
|
118
118
|
rather than by positional slice.
|
|
119
|
-
* :mod:`tecio.cli.tecsplit
|
|
120
|
-
* :mod:`tecio.cli.tecmerge
|
|
119
|
+
* :mod:`tecio.cli.tecsplit` - Split a file into separate grid and solution files.
|
|
120
|
+
* :mod:`tecio.cli.tecmerge` - Merge zones from multiple files into a single output.
|
|
121
121
|
"""
|
|
122
122
|
|
|
123
123
|
from __future__ import annotations
|
|
@@ -277,7 +277,7 @@ def _parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace:
|
|
|
277
277
|
description=(
|
|
278
278
|
# -|--------------------|---------------------------------------------|
|
|
279
279
|
"Slice a Tecplot file along IJK indices (ordered zones) and/or\n"
|
|
280
|
-
"solution time (all zone types).\n"
|
|
280
|
+
"solution time (all zone types).\n\n"
|
|
281
281
|
"Slice notation: start:end:skip (any component may be omitted)."
|
|
282
282
|
),
|
|
283
283
|
epilog=(
|
|
@@ -329,9 +329,9 @@ def _parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace:
|
|
|
329
329
|
ijk = parser.add_argument_group(
|
|
330
330
|
"IJK slicing",
|
|
331
331
|
(
|
|
332
|
-
|
|
333
|
-
"Indices are 1-based and
|
|
334
|
-
"Applied only to ordered (structured) zones."
|
|
332
|
+
# -|--------------------|---------------------------------------------|
|
|
333
|
+
"Colon-notation slices for structured axes. Indices are 1-based and\n"
|
|
334
|
+
"inclusive. Applied only to ordered (structured) zones."
|
|
335
335
|
),
|
|
336
336
|
)
|
|
337
337
|
for axis in ("i", "j", "k"):
|
|
@@ -351,8 +351,9 @@ def _parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace:
|
|
|
351
351
|
tslice = parser.add_argument_group(
|
|
352
352
|
"solution-time slicing",
|
|
353
353
|
(
|
|
354
|
-
|
|
355
|
-
"Strand-0 zones are always
|
|
354
|
+
# -|--------------------|---------------------------------------------|
|
|
355
|
+
"Applied per strand to all zone types. Strand-0 zones are always\n"
|
|
356
|
+
"written unchanged."
|
|
356
357
|
),
|
|
357
358
|
)
|
|
358
359
|
tslice.add_argument(
|
|
@@ -85,9 +85,9 @@ Examples:
|
|
|
85
85
|
tecstats(["-zone", "2", "-variable", "3", "flow.szplt"])
|
|
86
86
|
|
|
87
87
|
See Also:
|
|
88
|
-
* :mod:`tecio.cli.tecdump
|
|
88
|
+
* :mod:`tecio.cli.tecdump` - Inspect the full contents and metadata of a file,
|
|
89
89
|
including auxiliary data and raw variable arrays.
|
|
90
|
-
* :mod:`tecio.cli.tecfix
|
|
90
|
+
* :mod:`tecio.cli.tecfix` - Rewrite a file with invalid variable arrays set to
|
|
91
91
|
passive once bad values have been identified via statistics.
|
|
92
92
|
|
|
93
93
|
"""
|
|
@@ -706,20 +706,23 @@ class ReadAuxData:
|
|
|
706
706
|
class ReadVariable:
|
|
707
707
|
"""Variable metadata and data for one zone parsed from an ASCII DAT file.
|
|
708
708
|
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
>>> var = ReadVariable(name, data, value_location, ...)
|
|
709
|
+
Args:
|
|
710
|
+
zone_index: 1-based index of the zone this variable belongs to.
|
|
711
|
+
var_index: 1-based dataset variable index.
|
|
713
712
|
"""
|
|
714
713
|
|
|
715
714
|
def __init__(
|
|
716
715
|
self,
|
|
716
|
+
zone_index: int,
|
|
717
|
+
var_index: int,
|
|
717
718
|
name: str,
|
|
718
719
|
data: npt.NDArray | None,
|
|
719
720
|
value_location: ValueLocation = ValueLocation.NODAL,
|
|
720
721
|
is_passive: bool = False,
|
|
721
722
|
shared_zone: int | None = None,
|
|
722
723
|
) -> None:
|
|
724
|
+
self.zone_index: int = zone_index
|
|
725
|
+
self.var_index: int = var_index
|
|
723
726
|
self._name: str = name
|
|
724
727
|
self._data: npt.NDArray | None = data
|
|
725
728
|
self._value_location: ValueLocation = value_location
|
|
@@ -844,6 +847,7 @@ class ReadZone:
|
|
|
844
847
|
"""Zone data parsed from a Tecplot ASCII DAT file.
|
|
845
848
|
|
|
846
849
|
Attributes:
|
|
850
|
+
zone_index: 1-based dataset zone index.
|
|
847
851
|
datapacking: :class:`~tecio.libtecio.DataPacking` member reflecting the
|
|
848
852
|
``DATAPACKING`` keyword found in the zone header (``BLOCK`` or
|
|
849
853
|
``POINT``). The data arrays are identical either way; this attribute
|
|
@@ -853,11 +857,12 @@ class ReadZone:
|
|
|
853
857
|
automatically resolves to the source zone's array.
|
|
854
858
|
|
|
855
859
|
Example:
|
|
856
|
-
>>> zone = ReadZone(title, zone_type, I, J, K, ...)
|
|
860
|
+
>>> zone = ReadZone(zone_index, title, zone_type, I, J, K, ...)
|
|
857
861
|
"""
|
|
858
862
|
|
|
859
863
|
def __init__(
|
|
860
864
|
self,
|
|
865
|
+
zone_index: int,
|
|
861
866
|
title: str,
|
|
862
867
|
zone_type: ZoneType,
|
|
863
868
|
I: int, # noqa: E741
|
|
@@ -871,6 +876,7 @@ class ReadZone:
|
|
|
871
876
|
datapacking: DataPacking = DataPacking.BLOCK,
|
|
872
877
|
shared_connectivity: int | None = None,
|
|
873
878
|
) -> None:
|
|
879
|
+
self.zone_index: int = zone_index
|
|
874
880
|
self.title: str = title
|
|
875
881
|
self.zone_type: ZoneType = zone_type
|
|
876
882
|
self.I: int = I
|
|
@@ -1459,8 +1465,13 @@ class Read:
|
|
|
1459
1465
|
self._zones[src_zone_1based - 1].variable[var_idx].values
|
|
1460
1466
|
)
|
|
1461
1467
|
|
|
1468
|
+
# This zone's own 1-based index
|
|
1469
|
+
zone_index = len(self._zones) + 1
|
|
1470
|
+
|
|
1462
1471
|
read_vars = [
|
|
1463
1472
|
ReadVariable(
|
|
1473
|
+
zone_index=zone_index,
|
|
1474
|
+
var_index=idx + 1,
|
|
1464
1475
|
name=name,
|
|
1465
1476
|
data=_shaped(
|
|
1466
1477
|
var_arrays[idx],
|
|
@@ -1475,6 +1486,7 @@ class Read:
|
|
|
1475
1486
|
|
|
1476
1487
|
self._zones.append(
|
|
1477
1488
|
ReadZone(
|
|
1489
|
+
zone_index=zone_index,
|
|
1478
1490
|
title=zone_title,
|
|
1479
1491
|
zone_type=zone_type,
|
|
1480
1492
|
I=I,
|
|
@@ -552,7 +552,7 @@ class ReadVariable:
|
|
|
552
552
|
|
|
553
553
|
# Byte-swap if needed so the result is always native-endian
|
|
554
554
|
if data.dtype.byteorder not in ("=", "|", np.dtype(dt).str[0]):
|
|
555
|
-
data = data.byteswap().newbyteorder()
|
|
555
|
+
data = data.byteswap().view(data.dtype.newbyteorder())
|
|
556
556
|
|
|
557
557
|
# Reshape for full reads of ordered zones, using the owning zone's dimensions
|
|
558
558
|
# and value location (they describe the on-disk layout including cell-centered
|