tecio-python 0.3.1__py3-none-any.whl → 0.3.3__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/__init__.py CHANGED
@@ -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.3.1"
12
+ __version__ = "0.3.3"
13
13
 
14
14
  from . import cli, libtecio
15
15
  from ._constants import (
@@ -28,7 +28,20 @@ from ._constants import (
28
28
  from ._containers import VariableList, ZoneList
29
29
  from ._dat_read import TecplotDatReader
30
30
  from ._dat_write import TecplotDatWriter
31
- from ._io import AppendReadWrite, AppendWrite, open
31
+ from ._io import (
32
+ AppendReadWrite,
33
+ AppendWrite,
34
+ FileSummary,
35
+ ZoneSummary,
36
+ get_file_type,
37
+ get_num_variables,
38
+ get_num_zones,
39
+ get_title,
40
+ get_variable_list,
41
+ get_zone_list,
42
+ open,
43
+ peek,
44
+ )
32
45
  from ._plt_read import TecplotPltReader
33
46
  from ._plt_write import TecplotPltWriter
34
47
  from ._reader import (
@@ -82,6 +95,15 @@ del _cls
82
95
  __all__ = [
83
96
  "libtecio",
84
97
  "open",
98
+ "peek",
99
+ "get_variable_list",
100
+ "get_zone_list",
101
+ "get_num_zones",
102
+ "get_num_variables",
103
+ "get_title",
104
+ "get_file_type",
105
+ "FileSummary",
106
+ "ZoneSummary",
85
107
  "cli",
86
108
  "AppendWrite",
87
109
  "AppendReadWrite",
tecio/_containers.py CHANGED
@@ -1,35 +1,35 @@
1
1
  """Index- and name-based container types for Tecplot data collections.
2
2
 
3
- These containers are shared by the ``tecio`` readers: ``Read.zone`` returns a
4
- :class:`ZoneList` of ``ReadZone`` and ``ReadZone.variable`` returns a
3
+ These containers are shared by the ``tecio`` readers: ``Read.zones`` returns a
4
+ :class:`ZoneList` of ``ReadZone`` and ``ReadZone.variables`` returns a
5
5
  :class:`VariableList` of ``ReadVariable`` for every supported format (SZL, PLT, DAT).
6
- They depend only on small structural protocols (``.name`` for variables, ``.variable``
6
+ They depend only on small structural protocols (``.name`` for variables, ``.variables``
7
7
  for zones) so they import nothing from either hierarchy and cannot introduce a circular
8
8
  dependency.
9
9
 
10
10
  Access model:
11
11
 
12
- reader.zone # ZoneList
13
- reader.zone[0] # ReadZone (element)
14
- reader.zone[1:4] # ZoneList (sub-collection, same kind)
15
- reader.zone[0].variable # VariableList
16
- reader.zone[0].variable["x"] # ReadVariable (object: .values, .is_passive)
17
- reader.zone[0].variable[2] # ReadVariable (0-based index)
12
+ reader.zones # ZoneList
13
+ reader.zones[0] # ReadZone (element)
14
+ reader.zones[1:4] # ZoneList (sub-collection, same kind)
15
+ reader.zones[0].variables # VariableList
16
+ reader.zones[0].variables["x"] # ReadVariable (object: .values, .is_passive)
17
+ reader.zones[0].variables[2] # ReadVariable (0-based index)
18
18
 
19
19
  Subscripting always returns an element or a sub-collection *of the same kind* (never a
20
20
  raw array). The underlying NumPy data is pulled with ``get_array`` on a single zone,
21
21
  which mirrors the pandas ``df[...]`` split: a scalar key returns one array, a list of
22
22
  names returns a tuple of arrays (for unpacking)::
23
23
 
24
- p = reader.zone[0].get_array("p") # ndarray | None
25
- p = reader.zone[0].get_array(2) # ndarray | None (0-based index)
26
- x, y, z = reader.zone[0].get_array(["x", "y", "z"]) # tuple, one per name
24
+ p = reader.zones[0].get_array("p") # ndarray | None
25
+ p = reader.zones[0].get_array(2) # ndarray | None (0-based index)
26
+ x, y, z = reader.zones[0].get_array(["x", "y", "z"]) # tuple, one per name
27
27
 
28
28
  There is deliberately **no** cross-zone array accessor. To pull one variable across
29
29
  many zones (e.g. a transient sequence), iterate explicitly so the outer axis is owned by
30
30
  your code, and stack only when you know the result is rectangular::
31
31
 
32
- seq = [z.get_array("p") for z in reader.zone] # list[ndarray | None]
32
+ seq = [z.get_array("p") for z in reader.zones] # list[ndarray | None]
33
33
  stack = np.stack(seq) # only if shapes all match
34
34
 
35
35
  Name lookup is exact and case-sensitive throughout, so distinct variables such
@@ -78,7 +78,7 @@ class _HasVariableList(Protocol):
78
78
  """A zone element exposing a name/index-addressable variable container."""
79
79
 
80
80
  @property
81
- def variable(self) -> VariableList[Any]: ...
81
+ def variables(self) -> VariableList[Any]: ...
82
82
 
83
83
 
84
84
  _VarT = TypeVar("_VarT", bound=_HasName)
@@ -137,7 +137,7 @@ def select_variable_arrays(
137
137
  class VariableList(Generic[_VarT]):
138
138
  """Read-only sequence of variables with positional *and* named access.
139
139
 
140
- Drop-in for the ``list`` previously returned by ``ReadZone.variable``:
140
+ Drop-in for the ``list`` previously returned by ``ReadZone.variables``:
141
141
  iteration, ``len()``, and integer indexing are unchanged. A string key
142
142
  resolves a variable by its exact, case-sensitive name.
143
143
 
@@ -208,7 +208,7 @@ class VariableList(Generic[_VarT]):
208
208
  """Return the variable names in dataset order."""
209
209
  return [var.name for var in self._items]
210
210
 
211
- def __repr__(self) -> str:
211
+ def __repr__(self) -> str: # pragma: no cover
212
212
  n = len(self._items)
213
213
  if n == 0:
214
214
  return "VariableList([])"
@@ -229,16 +229,16 @@ class VariableList(Generic[_VarT]):
229
229
  class ZoneList(Generic[_ZoneT]):
230
230
  """Read-only sequence of zones: positional access and slicing only.
231
231
 
232
- Drop-in for the ``list`` previously returned by ``Read.zone``: iteration, ``len()``,
233
- and integer indexing are unchanged. Slicing returns another :class:`ZoneList` (not a
234
- plain ``list``) so navigation composes.
232
+ Drop-in for the ``list`` previously returned by ``Read.zones``: iteration,
233
+ ``len()``, and integer indexing are unchanged. Slicing returns another
234
+ :class:`ZoneList` (not a plain ``list``) so navigation composes.
235
235
 
236
236
  This container deliberately exposes **no** data-extraction method. Pulling one
237
237
  variable across many zones is an explicit loop over the zones, keeping the outer
238
238
  (zone) axis owned by the caller (see the module docs).
239
239
 
240
240
  Args:
241
- zones: Ordered list of zone elements (each exposing ``.variable``).
241
+ zones: Ordered list of zone elements (each exposing ``.variables``).
242
242
  """
243
243
 
244
244
  __slots__ = ("_items",)
@@ -277,7 +277,7 @@ class ZoneList(Generic[_ZoneT]):
277
277
  return ZoneList(self._items[key])
278
278
  return self._items[key]
279
279
 
280
- def __repr__(self) -> str:
280
+ def __repr__(self) -> str: # pragma: no cover
281
281
  n = len(self._items)
282
282
  if n == 0:
283
283
  return "ZoneList([])"