pytecplot 1.5.2__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.
Files changed (97) hide show
  1. pytecplot-1.5.2.dist-info/LICENSE.html +77 -0
  2. pytecplot-1.5.2.dist-info/METADATA +508 -0
  3. pytecplot-1.5.2.dist-info/RECORD +97 -0
  4. pytecplot-1.5.2.dist-info/WHEEL +5 -0
  5. pytecplot-1.5.2.dist-info/top_level.txt +1 -0
  6. tecplot/__init__.py +94 -0
  7. tecplot/annotation/__init__.py +7 -0
  8. tecplot/annotation/annotation.py +223 -0
  9. tecplot/annotation/geometry.py +369 -0
  10. tecplot/annotation/georeference.py +33 -0
  11. tecplot/annotation/image.py +185 -0
  12. tecplot/annotation/iter.py +105 -0
  13. tecplot/annotation/polyline.py +381 -0
  14. tecplot/annotation/text.py +744 -0
  15. tecplot/constant.py +401 -0
  16. tecplot/data/__init__.py +34 -0
  17. tecplot/data/array.py +645 -0
  18. tecplot/data/create.py +1 -0
  19. tecplot/data/dataset.py +1809 -0
  20. tecplot/data/extract.py +544 -0
  21. tecplot/data/face_neighbors.py +494 -0
  22. tecplot/data/facemap.py +814 -0
  23. tecplot/data/load.py +2075 -0
  24. tecplot/data/nodemap.py +577 -0
  25. tecplot/data/operate.py +928 -0
  26. tecplot/data/query.py +334 -0
  27. tecplot/data/save.py +343 -0
  28. tecplot/data/variable.py +280 -0
  29. tecplot/data/zone.py +841 -0
  30. tecplot/exception.py +201 -0
  31. tecplot/export/__init__.py +13 -0
  32. tecplot/export/animation.py +521 -0
  33. tecplot/export/export_setup.py +318 -0
  34. tecplot/export/image.py +577 -0
  35. tecplot/export/print_setup.py +218 -0
  36. tecplot/export/time_animation.py +607 -0
  37. tecplot/extension/__init__.py +14 -0
  38. tecplot/extension/ipython.py +68 -0
  39. tecplot/layout/__init__.py +20 -0
  40. tecplot/layout/frame.py +1285 -0
  41. tecplot/layout/layout.py +488 -0
  42. tecplot/layout/page.py +541 -0
  43. tecplot/legend/__init__.py +4 -0
  44. tecplot/legend/contour_legend.py +516 -0
  45. tecplot/legend/legend.py +141 -0
  46. tecplot/legend/line_legend.py +66 -0
  47. tecplot/legend/rgb_coloring_legend.py +291 -0
  48. tecplot/legend/scatter_legend.py +136 -0
  49. tecplot/macro.py +339 -0
  50. tecplot/plot/__init__.py +62 -0
  51. tecplot/plot/axes.py +881 -0
  52. tecplot/plot/axis.py +1350 -0
  53. tecplot/plot/blanking.py +584 -0
  54. tecplot/plot/contour.py +1302 -0
  55. tecplot/plot/effects.py +162 -0
  56. tecplot/plot/fieldmap.py +2159 -0
  57. tecplot/plot/grid.py +758 -0
  58. tecplot/plot/isosurface.py +1167 -0
  59. tecplot/plot/labels.py +338 -0
  60. tecplot/plot/linemap.py +1905 -0
  61. tecplot/plot/linking.py +489 -0
  62. tecplot/plot/plot.py +1791 -0
  63. tecplot/plot/rgb_coloring.py +281 -0
  64. tecplot/plot/scatter.py +396 -0
  65. tecplot/plot/slice.py +1544 -0
  66. tecplot/plot/streamtrace.py +1949 -0
  67. tecplot/plot/symbol.py +567 -0
  68. tecplot/plot/ticks.py +666 -0
  69. tecplot/plot/title.py +380 -0
  70. tecplot/plot/vector.py +679 -0
  71. tecplot/plot/view.py +868 -0
  72. tecplot/session/__init__.py +112 -0
  73. tecplot/session/aux_data.py +276 -0
  74. tecplot/session/config.py +92 -0
  75. tecplot/session/session.py +425 -0
  76. tecplot/session/state_changed.py +225 -0
  77. tecplot/session/style.py +504 -0
  78. tecplot/tecutil/__init__.py +16 -0
  79. tecplot/tecutil/arglist.py +230 -0
  80. tecplot/tecutil/captured_output.py +177 -0
  81. tecplot/tecutil/constant.py +1312 -0
  82. tecplot/tecutil/index_set.py +118 -0
  83. tecplot/tecutil/lock.py +36 -0
  84. tecplot/tecutil/message_pb2.py +39 -0
  85. tecplot/tecutil/preamble.py +54 -0
  86. tecplot/tecutil/stringlist.py +114 -0
  87. tecplot/tecutil/sv.py +1662 -0
  88. tecplot/tecutil/tecutil.py +12402 -0
  89. tecplot/tecutil/tecutil_client.py +627 -0
  90. tecplot/tecutil/tecutil_connector.py +937 -0
  91. tecplot/tecutil/tecutil_rpc.py +6845 -0
  92. tecplot/tecutil/util.py +332 -0
  93. tecplot/text/__init__.py +3 -0
  94. tecplot/text/font.py +224 -0
  95. tecplot/text/label_format.py +374 -0
  96. tecplot/text/textbox.py +106 -0
  97. tecplot/version.py +41 -0
tecplot/plot/title.py ADDED
@@ -0,0 +1,380 @@
1
+ from builtins import str
2
+
3
+ import textwrap
4
+
5
+ from .. import session
6
+ from ..constant import *
7
+ from ..exception import *
8
+ from ..tecutil import sv
9
+ from .. import text
10
+
11
+
12
+ class AxisTitle(session.Style):
13
+ def __init__(self, axis):
14
+ self.axis = axis
15
+ super().__init__(axis._sv, sv.TITLE, **axis._kw)
16
+
17
+ @property
18
+ def text(self):
19
+ """`str`: The text of the title for this axis.
20
+
21
+ Example usage::
22
+
23
+ >>> axis.title.text = 'distance (m)'
24
+ """
25
+ return self._get_style(str, sv.TEXT)
26
+
27
+ @text.setter
28
+ def text(self, value):
29
+ self._set_style(str(value), sv.TEXT)
30
+
31
+ @property
32
+ def show(self):
33
+ """`bool`: Place title along the axis.
34
+
35
+ Example usage::
36
+
37
+ >>> axis.title.show = False
38
+ """
39
+ return self._get_style(bool, sv.SHOWONAXISLINE)
40
+
41
+ @show.setter
42
+ def show(self, show):
43
+ self._set_style(bool(show), sv.SHOWONAXISLINE)
44
+
45
+ @property
46
+ def position(self):
47
+ """`float`: Percent along axis line to place title.
48
+
49
+ Example usage::
50
+
51
+ >>> axis.title.position = 50
52
+ """
53
+ return self._get_style(float, sv.PERCENTALONGLINE)
54
+
55
+ @position.setter
56
+ def position(self, value):
57
+ self._set_style(float(value), sv.PERCENTALONGLINE)
58
+
59
+ @property
60
+ def color(self):
61
+ """`Color`: Text color of axis title.
62
+
63
+ Example usage::
64
+
65
+ >>> from tecplot.constant import Color
66
+ >>> axis.title.color = Color.Blue
67
+ """
68
+ return self._get_style(Color, sv.COLOR)
69
+
70
+ @color.setter
71
+ def color(self, value):
72
+ self._set_style(Color(value), sv.COLOR)
73
+
74
+ @property
75
+ def offset(self):
76
+ """`float` in percent of frame height.: Transverse offset of the title from the axis.
77
+
78
+ Positive values are outside the axes, negative numbers
79
+ are inside the axes. Example usage::
80
+
81
+ >>> axis.title.offset = 5
82
+ """
83
+ return self._get_style(float, sv.OFFSET)
84
+
85
+ @offset.setter
86
+ def offset(self, value):
87
+ self._set_style(float(value), sv.OFFSET)
88
+
89
+ @property
90
+ def font(self):
91
+ """`text.Font`: Typeface and size of the text.
92
+
93
+ Example usage::
94
+
95
+ >>> axis.title.font.size = 5
96
+ """
97
+ return text.Font(self)
98
+
99
+
100
+ class Axis2DTitle(AxisTitle):
101
+ """Sketch plot axis label string, font and style control.
102
+
103
+ .. code-block:: python
104
+ :emphasize-lines: 12-15
105
+
106
+ import tecplot as tp
107
+ from tecplot.constant import PlotType, Color
108
+
109
+ plot = tp.active_frame().plot(PlotType.Sketch)
110
+
111
+ viewport = plot.axes.viewport
112
+ viewport.left = 10
113
+ viewport.right = 90
114
+ viewport.bottom = 10
115
+
116
+ xaxis = plot.axes.x_axis
117
+ xaxis.show = True
118
+ xaxis.title.text = 'distance (m)'
119
+ xaxis.title.color = Color.DarkTurquoise
120
+ xaxis.title.offset = -7
121
+
122
+ tp.export.save_png('axis_title_sketch.png', 600, supersample=3)
123
+
124
+ .. figure:: /_static/images/axis_title_sketch.png
125
+ :width: 300px
126
+ :figwidth: 300px
127
+ """
128
+ @property
129
+ def show_on_border_min(self):
130
+ """`bool`: Draw title along the lower grid area border.
131
+
132
+ Example usage::
133
+
134
+ >>> axis.title.show_on_border_min = True
135
+ """
136
+ return self._get_style(bool, sv.SHOWONGRIDBORDERMIN)
137
+
138
+ @show_on_border_min.setter
139
+ def show_on_border_min(self, value):
140
+ self._set_style(bool(value), sv.SHOWONGRIDBORDERMIN)
141
+
142
+ @property
143
+ def show_on_border_max(self):
144
+ """`bool`: Draw title along the upper grid area border.
145
+
146
+ Example usage::
147
+
148
+ >>> axis.title.show_on_border_max = True
149
+ """
150
+ return self._get_style(bool, sv.SHOWONGRIDBORDERMAX)
151
+
152
+ @show_on_border_max.setter
153
+ def show_on_border_max(self, value):
154
+ self._set_style(bool(value), sv.SHOWONGRIDBORDERMAX)
155
+
156
+
157
+ class Axis3DTitle(AxisTitle):
158
+ @property
159
+ def show_on_opposite_edge(self):
160
+ """`bool`: Draw the title on the opposite edge of the grid.
161
+
162
+ Example usage::
163
+
164
+ >>> axis.title.show_on_opposite_edge = True
165
+ """
166
+ return self._get_style(bool, sv.SHOWONOPPOSITEEDGE)
167
+
168
+ @show_on_opposite_edge.setter
169
+ def show_on_opposite_edge(self, value):
170
+ self._set_style(bool(value), sv.SHOWONOPPOSITEEDGE)
171
+
172
+
173
+ class DataAxisTitle(AxisTitle):
174
+ @property
175
+ def title_mode(self):
176
+ """`AxisTitleMode`: Define the source for the axis title.
177
+
178
+ Possible values: `AxisTitleMode.UseText` or `AxisTitleMode.UseVarName`.
179
+
180
+ Example usage::
181
+
182
+ >>> from tecplot.constant import AxisTitleMode
183
+ >>> axis.title.title_mode = AxisTitleMode.UseVarName
184
+ """
185
+ return self._get_style(AxisTitleMode, sv.TITLEMODE)
186
+
187
+ @title_mode.setter
188
+ def title_mode(self, value):
189
+ value = AxisTitleMode(value)
190
+ if __debug__:
191
+ if value not in [AxisTitleMode.UseText, AxisTitleMode.UseVarName]:
192
+ msg = textwrap.dedent('''\
193
+ title_mode must be one of: AxisTitleMode.UseText,
194
+ AxisTitleMode.UseVarName.''')
195
+ raise TecplotLogicError(msg)
196
+ self._set_style(value, sv.TITLEMODE)
197
+
198
+ @property
199
+ def text(self):
200
+ """`str`: The text of the title for this axis.
201
+
202
+ The ``title_mode`` attribute must be set to `AxisTitleMode.UseText`::
203
+
204
+ >>> from tecplot.constant import AxisTitleMode
205
+ >>> axis.title.title_mode = AxisTitleMode.UseText
206
+ >>> axis.title.text = 'distance (m)'
207
+ """
208
+ return self._get_style(str, sv.TEXT)
209
+
210
+ @text.setter
211
+ def text(self, value):
212
+ self._set_style(str(value), sv.TEXT)
213
+
214
+
215
+ class DataAxis2DTitle(DataAxisTitle, Axis2DTitle):
216
+ """Axis label string, font and style control for 2D data plots.
217
+
218
+ .. code-block:: python
219
+ :emphasize-lines: 20-22,25,28-30,33
220
+
221
+ from os import path
222
+ import tecplot as tp
223
+ from tecplot.constant import PlotType, SurfacesToPlot, Color, AxisTitleMode
224
+
225
+ examples_dir = tp.session.tecplot_examples_directory()
226
+ infile = path.join(examples_dir, 'SimpleData', 'F18.plt')
227
+ dataset = tp.data.load_tecplot(infile)
228
+
229
+ plot = tp.active_frame().plot(PlotType.Cartesian2D)
230
+ plot.activate()
231
+
232
+ plot.show_contour = True
233
+ plot.contour(0).variable = dataset.variable('S')
234
+ plot.contour(0).colormap_name = 'Sequential - Yellow/Green/Blue'
235
+ plot.contour(0).legend.show = False
236
+
237
+ plot.fieldmap(0).surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces
238
+
239
+ xaxis = plot.axes.x_axis
240
+ xaxis.title.title_mode = AxisTitleMode.UseText
241
+ xaxis.title.text = 'Longitudinal (m)'
242
+ xaxis.title.color = Color.Blue
243
+
244
+ # place the x-axis title at the x-coordinate 10.0
245
+ xaxis.title.position = 100 * (10.0 - xaxis.min) / (xaxis.max - xaxis.min)
246
+
247
+ yaxis = plot.axes.y_axis
248
+ yaxis.title.title_mode = AxisTitleMode.UseText
249
+ yaxis.title.text = 'Transverse (m)'
250
+ yaxis.title.color = Color.Blue
251
+
252
+ # place the y-axis title at the y-coordinate 0.0
253
+ yaxis.title.position = 100 * (0.0 - yaxis.min) / (yaxis.max - yaxis.min)
254
+
255
+ tp.export.save_png('axis_title_2d.png', 600, supersample=3)
256
+
257
+ .. figure:: /_static/images/axis_title_2d.png
258
+ :width: 300px
259
+ :figwidth: 300px
260
+ """
261
+
262
+
263
+ class DataAxis3DTitle(DataAxisTitle, Axis3DTitle):
264
+ """Axis label string, font and style control for 3D plots.
265
+
266
+ .. code-block:: python
267
+ :emphasize-lines: 21-24,28-31,35-38
268
+
269
+ from os import path
270
+ import tecplot as tp
271
+ from tecplot.constant import PlotType, SurfacesToPlot, Color, AxisTitleMode
272
+
273
+ examples_dir = tp.session.tecplot_examples_directory()
274
+ infile = path.join(examples_dir, 'SimpleData', 'F18.plt')
275
+ dataset = tp.data.load_tecplot(infile)
276
+
277
+ plot = tp.active_frame().plot(PlotType.Cartesian3D)
278
+ plot.activate()
279
+
280
+ plot.show_contour = True
281
+ plot.contour(0).variable = dataset.variable('S')
282
+ plot.contour(0).colormap_name = 'Sequential - Yellow/Green/Blue'
283
+ plot.contour(0).legend.show = False
284
+
285
+ plot.fieldmap(0).surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces
286
+
287
+ xaxis = plot.axes.x_axis
288
+ xaxis.show = True
289
+ xaxis.title.title_mode = AxisTitleMode.UseText
290
+ xaxis.title.text = 'Longitudinal (m)'
291
+ xaxis.title.color = Color.BluePurple
292
+ xaxis.title.position = 10
293
+
294
+ yaxis = plot.axes.y_axis
295
+ yaxis.show = True
296
+ yaxis.title.title_mode = AxisTitleMode.UseText
297
+ yaxis.title.text = 'Transverse (m)'
298
+ yaxis.title.color = Color.BluePurple
299
+ yaxis.title.position = 90
300
+
301
+ zaxis = plot.axes.z_axis
302
+ zaxis.show = True
303
+ zaxis.title.title_mode = AxisTitleMode.UseText
304
+ zaxis.title.text = 'Height (m)'
305
+ zaxis.title.color = Color.BluePurple
306
+ zaxis.title.offset = 13
307
+
308
+ plot.view.fit()
309
+
310
+ tp.export.save_png('axis_title_3d.png', 600, supersample=3)
311
+
312
+ .. figure:: /_static/images/axis_title_3d.png
313
+ :width: 300px
314
+ :figwidth: 300px
315
+ """
316
+
317
+
318
+ class RadialAxisTitle(DataAxis2DTitle):
319
+ """Radial axis label string, font and style control for polar plots.
320
+
321
+ .. code-block:: python
322
+ :emphasize-lines: 29-33
323
+
324
+ import numpy as np
325
+ import tecplot as tp
326
+ from tecplot.constant import PlotType, Color, AxisTitleMode
327
+
328
+ npoints = 300
329
+ r = np.linspace(0, 2000, npoints)
330
+ theta = np.linspace(0, 1000, npoints)
331
+
332
+ frame = tp.active_frame()
333
+ dataset = frame.create_dataset('Data', ['R', 'Theta'])
334
+ zone = dataset.add_ordered_zone('Zone', (300,))
335
+ zone.values('R')[:] = r
336
+ zone.values('Theta')[:] = theta
337
+
338
+ plot = frame.plot(PlotType.PolarLine)
339
+ plot.activate()
340
+
341
+ plot.axes.r_axis.max = np.max(r)
342
+
343
+ plot.delete_linemaps()
344
+ lmap = plot.add_linemap('Linemap', zone, dataset.variable('R'),
345
+ dataset.variable('Theta'))
346
+ lmap.line.line_thickness = 0.8
347
+
348
+ raxis = plot.axes.r_axis
349
+ raxis.line.show_both_directions = True
350
+ raxis.line.show_perpendicular = True
351
+
352
+ raxis.title.title_mode = AxisTitleMode.UseText
353
+ raxis.title.text = 'Radial Position (cm)'
354
+ raxis.title.show_on_all_radial_axes = True
355
+ raxis.title.color = Color.Blue
356
+ raxis.title.position = 80
357
+
358
+ plot.view.fit()
359
+
360
+ tp.export.save_png('axis_title_radial.png', 600, supersample=3)
361
+
362
+ .. figure:: /_static/images/axis_title_radial.png
363
+ :width: 300px
364
+ :figwidth: 300px
365
+ """
366
+
367
+ @property
368
+ def show_on_all_radial_axes(self):
369
+ """`bool`: Draw title along all radial axis lines.
370
+
371
+ Example usage::
372
+
373
+ >>> plot.axes.r_axis.line.show_perpendicular = True
374
+ >>> plot.axes.r_axis.title.show_on_all_radial_axes = True
375
+ """
376
+ return self._get_style(bool, sv.SHOWONALLAXES)
377
+
378
+ @show_on_all_radial_axes.setter
379
+ def show_on_all_radial_axes(self, value):
380
+ self._set_style(bool(value), sv.SHOWONALLAXES)