tecio-python 0.3.3__tar.gz → 0.4.1__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.
Files changed (54) hide show
  1. {tecio_python-0.3.3/tecio_python.egg-info → tecio_python-0.4.1}/PKG-INFO +25 -9
  2. tecio_python-0.3.3/plugins/matlab/fecplot.m → tecio_python-0.4.1/plugins/matlab/contourfe.m +3 -3
  3. tecio_python-0.4.1/plugins/matlab/tecmat2struct.m +137 -0
  4. {tecio_python-0.3.3 → tecio_python-0.4.1}/plugins/paraview/TecplotTecioReader.py +463 -38
  5. tecio_python-0.4.1/plugins/paraview/TecplotTecioWriter.py +1026 -0
  6. {tecio_python-0.3.3 → tecio_python-0.4.1}/pyproject.toml +57 -13
  7. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/__init__.py +10 -3
  8. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_dat_read.py +306 -45
  9. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_dat_write.py +518 -153
  10. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_io.py +147 -99
  11. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_meta.py +42 -23
  12. tecio_python-0.4.1/tecio/_plt_legacy.py +408 -0
  13. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_plt_read.py +456 -121
  14. tecio_python-0.4.1/tecio/_plt_write.py +1038 -0
  15. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_reader.py +387 -55
  16. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_szl_read.py +124 -75
  17. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_szl_write.py +304 -193
  18. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_utils.py +69 -6
  19. tecio_python-0.4.1/tecio/_writer.py +1829 -0
  20. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/tec2mat.py +70 -41
  21. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/tecaux.py +90 -122
  22. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/tecdump.py +45 -6
  23. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/tecextract.py +105 -99
  24. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/tecfix.py +62 -78
  25. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/tecmerge.py +154 -95
  26. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/teconvert.py +40 -52
  27. tecio_python-0.4.1/tecio/cli/tecscale.py +513 -0
  28. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/tecslice.py +199 -156
  29. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/tecstats.py +47 -43
  30. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/libtecio.py +117 -61
  31. {tecio_python-0.3.3 → tecio_python-0.4.1/tecio_python.egg-info}/PKG-INFO +25 -9
  32. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio_python.egg-info/SOURCES.txt +5 -1
  33. tecio_python-0.4.1/tecio_python.egg-info/requires.txt +35 -0
  34. {tecio_python-0.3.3 → tecio_python-0.4.1}/tests/test_cli.py +798 -145
  35. {tecio_python-0.3.3 → tecio_python-0.4.1}/tests/test_io.py +29 -82
  36. {tecio_python-0.3.3 → tecio_python-0.4.1}/tests/test_libtecio.py +77 -47
  37. {tecio_python-0.3.3 → tecio_python-0.4.1}/tests/test_read.py +213 -12
  38. tecio_python-0.4.1/tests/test_read_legacy.py +694 -0
  39. tecio_python-0.4.1/tests/test_write.py +2953 -0
  40. tecio_python-0.3.3/tecio/_plt_write.py +0 -723
  41. tecio_python-0.3.3/tecio/_writer.py +0 -953
  42. tecio_python-0.3.3/tecio/cli/tecscale.py +0 -425
  43. tecio_python-0.3.3/tecio_python.egg-info/requires.txt +0 -18
  44. tecio_python-0.3.3/tests/test_write.py +0 -1417
  45. {tecio_python-0.3.3 → tecio_python-0.4.1}/LICENSE +0 -0
  46. {tecio_python-0.3.3 → tecio_python-0.4.1}/NOTICE +0 -0
  47. {tecio_python-0.3.3 → tecio_python-0.4.1}/README.md +0 -0
  48. {tecio_python-0.3.3 → tecio_python-0.4.1}/setup.cfg +0 -0
  49. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_constants.py +0 -0
  50. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/_containers.py +0 -0
  51. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio/cli/__init__.py +0 -0
  52. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio_python.egg-info/dependency_links.txt +0 -0
  53. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio_python.egg-info/entry_points.txt +0 -0
  54. {tecio_python-0.3.3 → tecio_python-0.4.1}/tecio_python.egg-info/top_level.txt +0 -0
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tecio-python
3
- Version: 0.3.3
3
+ Version: 0.4.1
4
4
  Summary: Python interface for reading and writing Tecplot data files
5
- Project-URL: Homepage, https://github.com/meersman/tecio
6
- Project-URL: Documentation, https://meersman.github.io/tecio/
7
- Project-URL: Repository, https://github.com/meersman/tecio
8
- Project-URL: Issues, https://github.com/meersman/tecio/issues
9
- Project-URL: Changelog, https://github.com/meersman/tecio/blob/main/docs/changelog.md
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/meersman/tecio-python
7
+ Project-URL: Documentation, https://meersman.github.io/tecio-python/
8
+ Project-URL: Repository, https://github.com/meersman/tecio-python
9
+ Project-URL: Issues, https://github.com/meersman/tecio-python/issues
10
+ Project-URL: Changelog, https://github.com/meersman/tecio-python/blob/main/docs/changelog.md
10
11
  Keywords: tecplot,tecio,cfd,data,visualization,szplt,plt
11
12
  Classifier: Development Status :: 3 - Alpha
12
13
  Classifier: Intended Audience :: Science/Research
@@ -19,7 +20,6 @@ Classifier: Programming Language :: Python :: 3.11
19
20
  Classifier: Programming Language :: Python :: 3.12
20
21
  Classifier: Programming Language :: Python :: 3.13
21
22
  Classifier: Typing :: Typed
22
- Classifier: License :: OSI Approved :: Apache Software License
23
23
  Classifier: Operating System :: OS Independent
24
24
  Requires-Python: >=3.11
25
25
  Description-Content-Type: text/markdown
@@ -29,17 +29,33 @@ Requires-Dist: numpy
29
29
  Provides-Extra: dev
30
30
  Requires-Dist: build; extra == "dev"
31
31
  Requires-Dist: twine; extra == "dev"
32
- Requires-Dist: ruff; extra == "dev"
33
- Requires-Dist: ty; extra == "dev"
32
+ Requires-Dist: ruff>=0.17.3; extra == "dev"
33
+ Requires-Dist: ty>=0.0.95; extra == "dev"
34
34
  Requires-Dist: pytest; extra == "dev"
35
35
  Requires-Dist: pytest-cov; extra == "dev"
36
36
  Provides-Extra: docs
37
37
  Requires-Dist: sphinx>=7.0; extra == "docs"
38
38
  Requires-Dist: sphinx-book-theme>=1.1; extra == "docs"
39
39
  Requires-Dist: sphinx-autodoc-typehints>=2.0; extra == "docs"
40
+ Requires-Dist: sphinx-copybutton>=0.5.2; extra == "docs"
41
+ Requires-Dist: sphinxcontrib-matlabdomain>=0.22; extra == "docs"
40
42
  Requires-Dist: myst-parser>=3.0; extra == "docs"
41
43
  Provides-Extra: mat
42
44
  Requires-Dist: scipy; extra == "mat"
45
+ Provides-Extra: all
46
+ Requires-Dist: build; extra == "all"
47
+ Requires-Dist: twine; extra == "all"
48
+ Requires-Dist: ruff; extra == "all"
49
+ Requires-Dist: ty; extra == "all"
50
+ Requires-Dist: pytest; extra == "all"
51
+ Requires-Dist: pytest-cov; extra == "all"
52
+ Requires-Dist: sphinx>=7.0; extra == "all"
53
+ Requires-Dist: sphinx-book-theme>=1.1; extra == "all"
54
+ Requires-Dist: sphinx-autodoc-typehints>=2.0; extra == "all"
55
+ Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
56
+ Requires-Dist: sphinxcontrib-matlabdomain>=0.22; extra == "all"
57
+ Requires-Dist: myst-parser>=3.0; extra == "all"
58
+ Requires-Dist: scipy; extra == "all"
43
59
  Dynamic: license-file
44
60
 
45
61
  # tecio
@@ -1,8 +1,8 @@
1
- function f = fecplot(dim, x, y, z, c, node_map, varargin)
1
+ function f = contourfe(dim, x, y, z, c, node_map, varargin)
2
2
  % Filled patch contour for unstructured 2D/3D surface zones
3
3
  %
4
4
  % Call:
5
- % h = feplot(dim, x, y, z, c, node_map, ...)
5
+ % h = contourfe(dim, x, y, z, c, node_map, ...)
6
6
  %
7
7
  % Args:
8
8
  % dim: 2 or 3
@@ -108,4 +108,4 @@ if dim == 3
108
108
  lighting gouraud
109
109
  end
110
110
  colorbar
111
- end
111
+ end
@@ -0,0 +1,137 @@
1
+ function zones = tecmat2struct(d)
2
+ % Reshape a loaded tec2mat .mat struct into a struct array of zones with
3
+ % dataset variables accessible by name.
4
+ %
5
+ % tec2mat outputs (info, zone_1, zone_2, ...) and variables by position
6
+ % (var_1, var_2, ...) because valid Tecplot variable names can include
7
+ % characters that are not valid MATLAB identifiers (e.g. "X [ft]"). When the
8
+ % variable names are known to be valid identifiers, this function lets you
9
+ % reformat the structures such that variables can be accessed by name, e.g.
10
+ % plot(zones(1).x, zones(1).pressure) instead of plot(zone_1.var_1,
11
+ % zone_1.var_3).
12
+ %
13
+ % Call:
14
+ % zones = tecmat2struct(d)
15
+ %
16
+ % Args:
17
+ % d: struct returned by load() on a tec2mat .mat file, i.e. the struct
18
+ % has fields info, zone_1, zone_2, ...
19
+ %
20
+ % Returns:
21
+ % zones: A 1 x info.num_zones struct array with identical fields in every
22
+ % element, so zones(i) and [zones.<varname>] both work. Fields::
23
+ %
24
+ % .title, .zone_type, .solution_time, .strand_id
25
+ % .I, .J, .K ordered zones; [] for FE zones
26
+ % .num_nodes, .num_elements FE zones; [] for ordered zones
27
+ % .node_map FE zones (resolved through
28
+ % node_map_shared_from if the zone
29
+ % shares connectivity); [] otherwise
30
+ % .face_neighbor_mode, .num_face_connections, .face_connections
31
+ % FE zones with face-neighbor data;
32
+ % '' / [] / [] otherwise
33
+ % .<variable name> one field per dataset variable
34
+ % whose real name is a valid MATLAB
35
+ % identifier (see isvarname). Passive
36
+ % in a zone -> []. Shared -> resolved
37
+ % to the source zone's data, so every
38
+ % zones(i) is self-contained.
39
+ %
40
+ % Notes:
41
+ % - A variable name that is not a valid MATLAB identifier is skipped with a
42
+ % warning; it remains accessible the original way, via zone_<n>.var_<k> and
43
+ % info.var_names{k}.
44
+ % - Shared variables/connectivity are branched (copied from referenced zone's
45
+ % data into every zone that shares it). This can create large memory
46
+ % usage for files whose zones heavily share a static grid across many time
47
+ % steps.
48
+ %
49
+ % Example:
50
+ % d = load('flow.mat');
51
+ % zones = tecmat2struct(d);
52
+ % plot(zones(1).x, zones(1).pressure);
53
+
54
+ if ~isfield(d, 'info')
55
+ error('tecmat2struct:badInput', ...
56
+ 'Input does not look like a tec2mat output struct (no ''info'' field).');
57
+ end
58
+
59
+ numZones = double(d.info.num_zones);
60
+ numVars = double(d.info.num_vars);
61
+ varNames = d.info.var_names;
62
+
63
+ % Reserved field names already used for zone metadata (variable names that
64
+ % collides with a reserved metadat name is skipped).
65
+ reserved = {'title', 'zone_type', 'solution_time', 'strand_id', ...
66
+ 'I', 'J', 'K', 'num_nodes', 'num_elements', 'node_map', ...
67
+ 'face_neighbor_mode', 'num_face_connections', 'face_connections'};
68
+
69
+ % Validate variable names up once so every zone gets the exact same set of
70
+ % variable fields in the same order.
71
+ validName = false(1, numVars);
72
+ for vi = 1:numVars
73
+ name = strtrim(char(varNames{vi}));
74
+ if ~isvarname(name)
75
+ warning('tecmat2struct:invalidName', ...
76
+ ['Variable %d (''%s'') is not a valid MATLAB identifier; skipping. ' ...
77
+ 'Access it via zone_<n>.var_%d instead.'], vi, name, vi);
78
+ elseif any(strcmp(name, reserved))
79
+ warning('tecmat2struct:reservedName', ...
80
+ ['Variable %d (''%s'') collides with a zone metadata field; skipping. ' ...
81
+ 'Access it via zone_<n>.var_%d instead.'], vi, name, vi);
82
+ else
83
+ validName(vi) = true;
84
+ end
85
+ end
86
+ varIdx = find(validName);
87
+
88
+ for zi = numZones:-1:1 % descending so the first iteration preallocates zones(1)
89
+ zsrc = d.(sprintf('zone_%d', zi));
90
+
91
+ out = struct( ...
92
+ 'title', zsrc.title, ...
93
+ 'zone_type', zsrc.zone_type, ...
94
+ 'solution_time', zsrc.solution_time, ...
95
+ 'strand_id', zsrc.strand_id, ...
96
+ 'I', [], 'J', [], 'K', [], ...
97
+ 'num_nodes', [], 'num_elements', [], 'node_map', [], ...
98
+ 'face_neighbor_mode', '', 'num_face_connections', [], ...
99
+ 'face_connections', []);
100
+
101
+ if isfield(zsrc, 'I')
102
+ out.I = zsrc.I;
103
+ out.J = zsrc.J;
104
+ out.K = zsrc.K;
105
+ end
106
+ if isfield(zsrc, 'num_nodes')
107
+ out.num_nodes = zsrc.num_nodes;
108
+ out.num_elements = zsrc.num_elements;
109
+ end
110
+ if isfield(zsrc, 'node_map')
111
+ out.node_map = zsrc.node_map;
112
+ elseif isfield(zsrc, 'node_map_shared_from')
113
+ srcZone = d.(sprintf('zone_%d', zsrc.node_map_shared_from));
114
+ out.node_map = srcZone.node_map;
115
+ end
116
+ if isfield(zsrc, 'face_neighbor_mode')
117
+ out.face_neighbor_mode = zsrc.face_neighbor_mode;
118
+ out.num_face_connections = zsrc.num_face_connections;
119
+ out.face_connections = zsrc.face_connections;
120
+ end
121
+
122
+ for vi = varIdx
123
+ name = strtrim(char(varNames{vi}));
124
+ status = zsrc.var_status{vi};
125
+ if strcmp(status, 'shared')
126
+ srcIdx = zsrc.var_shared_from(vi);
127
+ srcZone = d.(sprintf('zone_%d', srcIdx));
128
+ out.(name) = srcZone.(sprintf('var_%d', vi));
129
+ else
130
+ % 'active' carries real data; 'passive' is already [].
131
+ out.(name) = zsrc.(sprintf('var_%d', vi));
132
+ end
133
+ end
134
+
135
+ zones(zi) = out;
136
+ end
137
+ end