Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 18 Aug 15:38
· 70 commits to main since this release
e3c67c5

0.3.0

Major internal reorganization: reader and writer classes now share a common,
enforced interface across all three formats, and zone readers are split by
topology. tecio.szl, tecio.plt, and tecio.dat no longer exist as public
submodules.

Added

  • TecplotReader / TecplotWriter — shared abstract base classes defining
    the interface every format's reader/writer implements. A subclass cannot be
    instantiated unless it implements every required property and method, so the
    three formats can no longer drift out of sync with each other.
  • TecplotZoneReader — shared zone interface (title, zone_type,
    solution_time, strand_id, variable, auxdata, get_array(), ...),
    split into two concrete shapes by topology:
    • TecplotOrderedZoneReader — adds I, J, K, dimensions.
    • TecplotFEZoneReader — adds node_map, nodes_per_cell,
      shared_connectivity, and num_nodes/num_elements.
  • TecplotVariableReader, TecplotAuxDataReader — shared variable and
    auxiliary-data interfaces, identical for every format. Not split by value
    location or zone topology: nodal vs. cell-centered and dataset- vs.
    zone-level data only change what one method returns, never which properties
    exist.
  • TecplotSzlReader, TecplotPltReader, TecplotDatReader,
    TecplotSzlWriter, TecplotPltWriter, TecplotDatWriter — concrete,
    per-format classes, imported directly from tecio. tecio.open() returns
    one of these; construct one directly to bypass extension-based dispatch.
  • Zone, variable, and auxiliary-data reader objects are now immutable,
    assigning to any attribute raises AttributeError.
  • zone_index is now part of the shared TecplotZoneReader interface on
    every format (previously present on some formats' zone objects but not
    guaranteed on all three).

Changed

  • Breaking: a zone's topology-specific properties now only exist on the
    matching subclass. zone.node_map / .shared_connectivity /
    .nodes_per_cell raise AttributeError on an ordered zone (previously
    returned None); zone.I / .J / .K / .dimensions raise
    AttributeError on an FE zone (previously unused placeholder values on some
    formats). Use isinstance(zone, TecplotOrderedZoneReader) /
    isinstance(zone, TecplotFEZoneReader) to branch on topology.
  • CLI tools (tecdump, tecextract, tecfix, tecscale, teconvert,
    tec2mat, tecaux, tecmerge, tecslice) updated to use the new classes
    internally; command-line interfaces are unchanged.

Fixed

  • Auxiliary data added with add_auxdataset_dict() / add_auxvar_dict()
    after a writer was opened with an explicit variables list (rather than
    left to open lazily on the first zone write) was silently never written to
    the file, on all three formats. Auxiliary data is now always flushed before
    the first zone regardless of how the writer was opened.
  • A zone type whose connectivity a format cannot resolve (currently PLT's
    FEPOLYGON/FEPOLYHEDRON) re-read node_map from disk on every access instead
    of caching the None result.

Removed

  • Breaking: tecio.szl, tecio.plt, and tecio.dat submodules.
    szl.Read, szl.Write, plt.Read, plt.Write, dat.Read, dat.Write
    no longer exist. Use TecplotSzlReader / TecplotSzlWriter, etc.,
    imported directly from tecio:

    # Before
    from tecio.szl import Read
    
    r = Read("flow.szplt")
    
    # After
    from tecio import TecplotSzlReader
    
    r = TecplotSzlReader("flow.szplt")

    tecio.open() is unaffected and remains the recommended entry point for
    most use cases.

Full changelog: v0.2.4...v0.3.0