tecio.TecplotVariableReader#
- class tecio.TecplotVariableReader#
Bases:
ABCRead-only handle to one variable’s metadata and data within a zone.
Every metadata field is resolved by the concrete subclass on each access (a single libtecio call, or a lookup in already-parsed metadata), cheap enough in every format that this base does not add its own caching layer on top. Only
valuesreads actual array data, and only when called.Note
__setattr__is blocked here, which also applies inside a subclass’s own__init__. A concrete subclass must store its private fields withobject.__setattr__(self, "_name", value)rather than plain assignment, and should declare its own__slots__for them.Attributes
Stored data type.
Variable name string.
Number of stored values, 0 for a passive variable.
0-based source zone index if shared, else None.
NODAL or CELL_CENTERED.
All values as a NumPy array, or None if passive.
Methods
get_values([value_range])Read values from disk or memory.
True unless the variable is passive.
True if this variable has no data in this zone.
- abstract property data_type#
Stored data type.
- abstractmethod get_values(value_range=(None, None))[source]#
Read values from disk or memory.
- Parameters:
value_range – 1-based
(start, end), half-open.(None, None)reads all values.- Returns:
The data array, or
Noneif the variable is passive. A shared variable resolves to its source zone’s array.- Raises:
ValueError – If only one of
start/endis given.
- is_enabled()[source]#
True unless the variable is passive.
SZL overrides this with the dataset-level enabled flag it actually stores; PLT and DAT have no such flag and use this default.
- Returns:
bool –
Truefor an active variable.
- abstract property name#
Variable name string.
- abstract property num_values#
Number of stored values, 0 for a passive variable.
0-based source zone index if shared, else None.
- abstract property value_location#
NODAL or CELL_CENTERED.
- property values#
All values as a NumPy array, or None if passive.