VTKio 0.1.0.dev3__tar.gz → 0.1.0.dev4__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 (97) hide show
  1. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/PKG-INFO +4 -3
  2. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/README.md +2 -2
  3. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/examples/ImageData.py +18 -1
  4. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/examples/PolyData.py +16 -13
  5. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/examples/UnstructuredGrid.py +20 -0
  6. vtkio-0.1.0.dev4/examples/cow2.vtp +2419 -0
  7. vtkio-0.1.0.dev4/examples/hdf_multiblock_test.vtkhdf +0 -0
  8. vtkio-0.1.0.dev4/examples/hdf_multiblock_test_imagedata.vtkhdf +0 -0
  9. vtkio-0.1.0.dev4/examples/hdf_multiblock_test_unstructured.vtkhdf +0 -0
  10. vtkio-0.1.0.dev4/examples/ibm_with_data.vtp +283 -0
  11. vtkio-0.1.0.dev4/examples/line_dedup_test.vtp +44 -0
  12. vtkio-0.1.0.dev4/examples/line_dedup_test_base64.vtp +30 -0
  13. vtkio-0.1.0.dev4/examples/line_dedup_test_binary.vtp +39 -0
  14. vtkio-0.1.0.dev4/examples/line_test.vtp +45 -0
  15. vtkio-0.1.0.dev4/examples/line_test_base64.vtp +30 -0
  16. vtkio-0.1.0.dev4/examples/line_test_binary.vtp +39 -0
  17. vtkio-0.1.0.dev4/examples/map.vtkhdf +0 -0
  18. vtkio-0.1.0.dev4/examples/map.vtp +0 -0
  19. vtkio-0.1.0.dev4/examples/map_base64.vtp +73 -0
  20. vtkio-0.1.0.dev4/examples/multi_cell_type_example.vtkhdf +0 -0
  21. vtkio-0.1.0.dev4/examples/multi_cell_type_example.vtu +0 -0
  22. vtkio-0.1.0.dev4/examples/multi_cell_type_example_new.vtkhdf +0 -0
  23. vtkio-0.1.0.dev4/examples/multi_cell_type_example_new.vtu +50 -0
  24. vtkio-0.1.0.dev4/examples/new_vtk_multiblock_file.vtm +29 -0
  25. vtkio-0.1.0.dev4/examples/plate_vectors.vtp +1070 -0
  26. vtkio-0.1.0.dev4/examples/plate_vectors_hdf_new.vtkhdf +0 -0
  27. vtkio-0.1.0.dev4/examples/polyline_test.vtp +44 -0
  28. vtkio-0.1.0.dev4/examples/polyline_test_base64.vtp +30 -0
  29. vtkio-0.1.0.dev4/examples/polyline_test_binary.vtp +39 -0
  30. vtkio-0.1.0.dev4/examples/polytest.vtkhdf +0 -0
  31. vtkio-0.1.0.dev4/examples/polytest.vtp +136 -0
  32. vtkio-0.1.0.dev4/examples/polytest_base64.vtp +32 -0
  33. vtkio-0.1.0.dev4/examples/polytest_binary.vtp +49 -0
  34. vtkio-0.1.0.dev4/examples/revolution_triangular_mesh_test_new.vtu +657 -0
  35. vtkio-0.1.0.dev4/examples/revolution_triangular_mesh_test_new_hdf5.vtkhdf +0 -0
  36. vtkio-0.1.0.dev4/examples/test.vtu +138 -0
  37. vtkio-0.1.0.dev4/examples/test_appended.vtu +30 -0
  38. vtkio-0.1.0.dev4/examples/test_binary.vtu +51 -0
  39. vtkio-0.1.0.dev4/examples/test_blank_vti_new.vti +7 -0
  40. vtkio-0.1.0.dev4/examples/test_blank_vtp.vtp +17 -0
  41. vtkio-0.1.0.dev4/examples/test_blank_vtu.vtu +20 -0
  42. vtkio-0.1.0.dev4/examples/test_image_data_grid_appended_new.vti +22 -0
  43. vtkio-0.1.0.dev4/examples/test_image_data_grid_appended_new.vtkhdf +0 -0
  44. vtkio-0.1.0.dev4/examples/test_image_data_grid_binary_new.vti +35 -0
  45. vtkio-0.1.0.dev4/examples/test_image_data_grid_hdf5.vtkhdf +0 -0
  46. vtkio-0.1.0.dev4/examples/test_image_data_grid_hdf5_new.vtkhdf +0 -0
  47. vtkio-0.1.0.dev4/examples/test_image_data_grid_new.vti +645 -0
  48. vtkio-0.1.0.dev4/examples/test_image_data_grid_raw_appended_new.vti +0 -0
  49. vtkio-0.1.0.dev4/examples/test_lines_polydata_appended_encoded.vtp +30 -0
  50. vtkio-0.1.0.dev4/examples/test_points_polydata.vtp +146 -0
  51. vtkio-0.1.0.dev4/examples/test_points_polydata_appended_encoded.vtp +32 -0
  52. vtkio-0.1.0.dev4/examples/test_points_polydata_appended_raw.vtp +0 -0
  53. vtkio-0.1.0.dev4/examples/test_points_polydata_ascii.vtp +136 -0
  54. vtkio-0.1.0.dev4/examples/test_points_polydata_binary.vtp +49 -0
  55. vtkio-0.1.0.dev4/examples/test_points_polydata_vtkhdf.vtkhdf +0 -0
  56. vtkio-0.1.0.dev4/examples/test_uniform_image_data.vti +645 -0
  57. vtkio-0.1.0.dev4/examples/test_uniform_image_data_2.vti +650 -0
  58. vtkio-0.1.0.dev4/examples/test_uniform_image_data_appended.vti +22 -0
  59. vtkio-0.1.0.dev4/examples/test_uniform_image_data_binary.vti +35 -0
  60. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/pyproject.toml +3 -0
  61. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/utilities.py +29 -3
  62. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/version.py +5 -3
  63. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/writer/vtkhdf.py +168 -96
  64. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/writer/writers.py +18 -2
  65. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/writer/xml_writer.py +29 -20
  66. vtkio-0.1.0.dev3/src/vtkio/_git.py +0 -45
  67. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/.gitignore +0 -0
  68. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/CITATION.cff +0 -0
  69. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/LICENSE +0 -0
  70. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/examples/RectilinearData.py +0 -0
  71. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/examples/StructuredGrid.py +0 -0
  72. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/examples/benchmarking.py +0 -0
  73. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/examples/read_vtk_files.py +0 -0
  74. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/__init__.py +0 -0
  75. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/helpers.py +0 -0
  76. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/reader/__init__.py +0 -0
  77. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/reader/hdf5.py +0 -0
  78. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/reader/xml.py +0 -0
  79. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/simplified.py +0 -0
  80. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/vtk_cell_types.py +0 -0
  81. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/vtk_structures.py +0 -0
  82. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/writer/__init__.py +0 -0
  83. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/src/vtkio/writer/pvd_writer.py +0 -0
  84. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/__init__.py +0 -0
  85. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_read_vtkhdf_vti.py +0 -0
  86. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_read_xml_vti.py +0 -0
  87. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_read_xml_vtp.py +0 -0
  88. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_read_xml_vtr.py +0 -0
  89. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_read_xml_vts.py +0 -0
  90. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_read_xml_vtu.py +0 -0
  91. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_vtkhdf_writer.py +0 -0
  92. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_write_vtkhdf_vts.py +0 -0
  93. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_write_xml_vti.py +0 -0
  94. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_write_xml_vtp.py +0 -0
  95. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_write_xml_vtr.py +0 -0
  96. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_write_xml_vts.py +0 -0
  97. {vtkio-0.1.0.dev3 → vtkio-0.1.0.dev4}/tests/test_write_xml_vtu.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: VTKio
3
- Version: 0.1.0.dev3
3
+ Version: 0.1.0.dev4
4
4
  Summary: A simple package for converting data between VTK files (XML and HDF5) and NumPy arrays.
5
5
  Project-URL: Homepage, https://jpmorr.gitlab.io/vtkio
6
6
  Project-URL: Documentation, https://jpmorr.gitlab.io/vtkio
@@ -42,6 +42,7 @@ Requires-Dist: mkdocs-material[imaging]>=9.6.14; extra == 'docs'
42
42
  Requires-Dist: mkdocs>=1.6.1; extra == 'docs'
43
43
  Requires-Dist: mkdocstrings-python>=0.18; extra == 'docs'
44
44
  Requires-Dist: mkdocstrings>=0.29.1; extra == 'docs'
45
+ Requires-Dist: pipdeptree; extra == 'docs'
45
46
  Provides-Extra: tests
46
47
  Requires-Dist: pytest-cov>=6.1.1; extra == 'tests'
47
48
  Requires-Dist: pytest>=8.3.5; extra == 'tests'
@@ -66,7 +67,7 @@ Data is returned in appropriate VTK classes with arrays stored in `numpy` format
66
67
 
67
68
  > [!WARNING]
68
69
  > VTKHDF files can only be opened in supported software.
69
- > For example, ParaView has full VTKHDF support in 5.13 and above.
70
+ > For example, ParaView has full VTKHDF support in 5.13 and above.
70
71
 
71
72
 
72
73
  ## VTK File Formats
@@ -79,7 +80,7 @@ Further information regarding the VTK data model can be found in the [ParaView d
79
80
  Example datafiles can be found for various filetypes at the [VTK Examples Repository](https://gitlab.kitware.com/vtk/vtk-examples/-/tree/master/src/Testing/Data?ref_type=heads).
80
81
 
81
82
  ## Documentation
82
- For full documentation visit [jpmorr.gitlab.io](https://jpmorr.gitlab.io/vtkio).
83
+ For full documentation visit [jpmorr.gitlab.io/vtkio](https://jpmorr.gitlab.io/vtkio).
83
84
 
84
85
  ## Related packages
85
86
  The following packages have some overlap in functionality with VTKio:
@@ -17,7 +17,7 @@ Data is returned in appropriate VTK classes with arrays stored in `numpy` format
17
17
 
18
18
  > [!WARNING]
19
19
  > VTKHDF files can only be opened in supported software.
20
- > For example, ParaView has full VTKHDF support in 5.13 and above.
20
+ > For example, ParaView has full VTKHDF support in 5.13 and above.
21
21
 
22
22
 
23
23
  ## VTK File Formats
@@ -30,7 +30,7 @@ Further information regarding the VTK data model can be found in the [ParaView d
30
30
  Example datafiles can be found for various filetypes at the [VTK Examples Repository](https://gitlab.kitware.com/vtk/vtk-examples/-/tree/master/src/Testing/Data?ref_type=heads).
31
31
 
32
32
  ## Documentation
33
- For full documentation visit [jpmorr.gitlab.io](https://jpmorr.gitlab.io/vtkio).
33
+ For full documentation visit [jpmorr.gitlab.io/vtkio](https://jpmorr.gitlab.io/vtkio).
34
34
 
35
35
  ## Related packages
36
36
  The following packages have some overlap in functionality with VTKio:
@@ -238,7 +238,7 @@ imagedata_test.write_vtkhdf_file()
238
238
  # spacing = [0.1, 0.1, 0.1]
239
239
  # direction = [1, 0, 0, 0, 1, 0, 0, 0, 1]
240
240
 
241
- write_vti('test_uniform_image_data_2', whole_extent, origin+0.7312, spacing*0.45,
241
+ write_vti('test_uniform_image_data_2', whole_extent, origin=origin+0.7312, spacing=spacing*0.45,
242
242
  cell_data={"scalars": {"pressure": pressure}}, point_data=point_data, field_data=field_data)
243
243
 
244
244
  #%% VTKHDFImageDataWriter example
@@ -248,3 +248,20 @@ imagedata_test = VTKHDFImageDataWriter('test_image_data_grid_hdf5_new', whole_ex
248
248
 
249
249
  imagedata_test.write_vtkhdf_file()
250
250
 
251
+
252
+ #%% write vtkhdf file with additional metadata
253
+ from vtkio.reader import read_vtkxml_data
254
+
255
+ regular_grid_example_data = read_vtkxml_data('../TestData/vti/regular_grid_example.vti')
256
+ structured_points_data = read_vtkxml_data('../TestData/vti/structured_points.vti')
257
+ vase_data = read_vtkxml_data('../TestData/vti/vase.vti')
258
+
259
+ # --8<-- [start:write_points_writer_api_vtkhdf_additional_metadata]
260
+ from vtkio.writer.vtkhdf import VTKHDFMultiBlockWriter
261
+
262
+ blocks = {'block1': regular_grid_example_data, 'block2': structured_points_data, 'block3': vase_data,}
263
+
264
+ writer = VTKHDFMultiBlockWriter('hdf_multiblock_test_imagedata', blocks)
265
+ writer.write_vtkhdf_file()
266
+
267
+ # --8<-- [end:write_points_writer_api_vtkhdf_additional_metadata]
@@ -18,11 +18,8 @@ __status__ = 'Development'
18
18
  import numpy as np
19
19
 
20
20
  # Local Sources
21
- from vtkio.reader import read_data
22
- from vtkio.simplified import lines_to_poly, points_to_poly, polylines_to_poly
21
+ from vtkio.reader import read_vtkxml_data
23
22
  from vtkio.writer.writers import write_vtp
24
- from vtkio.writer.xml_writer import vtk_multiblock_writer
25
- from vtkio.writer.vtkhdf import VTKHDFPolyDataWriter
26
23
 
27
24
  write_vtp('test_blank_vtp', points=None, lines=None, verts=None, point_data=None,
28
25
  cell_data=None, field_data=None, encoding='ascii')
@@ -209,11 +206,11 @@ points_to_poly('polytest_base64', points, data=point_data,
209
206
  # --8<-- [end:write_points_helper]
210
207
 
211
208
  #%% test hdf5 polydata
212
- plate_data = read_data('../TestData/vtp/plate_vectors.vtp')
213
- map_data = read_data('../TestData/vtp/map.vtp')
214
- poly_verts_data = read_data('../TestData/vtp/polytest.vtp')
215
- lines_data = read_data('../TestData/vtp/ibm_with_data.vtp')
216
- cow_data = read_data('../TestData/vtp/cow.vtp')
209
+ plate_data = read_vtkxml_data('../TestData/vtp/plate_vectors.vtp')
210
+ map_data = read_vtkxml_data('../TestData/vtp/map.vtp')
211
+ poly_verts_data = read_vtkxml_data('../TestData/vtp/polytest.vtp')
212
+ lines_data = read_vtkxml_data('../TestData/vtp/ibm_with_data.vtp')
213
+ cow_data = read_vtkxml_data('../TestData/vtp/cow.vtp')
217
214
 
218
215
  write_vtp('plate_vectors', points=plate_data.points,
219
216
  polys=(plate_data.polys.connectivity, plate_data.polys.offsets),
@@ -226,7 +223,7 @@ write_vtp('cow2', points=cow_data.points,
226
223
  write_vtp('map', points=map_data.points,
227
224
  lines=(map_data.lines.connectivity, map_data.lines.offsets),
228
225
  cell_data={"vectors": map_data.cell_data},
229
- field_data=fielddata)
226
+ field_data=fielddata, encoding='binary')
230
227
 
231
228
  write_vtp('polytest', points=poly_verts_data.points,
232
229
  verts=(poly_verts_data.verts.connectivity, poly_verts_data.verts.offsets),
@@ -238,6 +235,11 @@ write_vtp('ibm_with_data', points=lines_data.points,
238
235
  point_data={"vectors": lines_data.point_data},
239
236
  field_data=fielddata)
240
237
 
238
+ write_vtp('map', points=map_data.points,
239
+ lines=(map_data.lines.connectivity, map_data.lines.offsets),
240
+ cell_data={"vectors": map_data.cell_data},
241
+ field_data=fielddata, file_format='vtkhdf')
242
+
241
243
  #%% test vtkhdf writer class
242
244
 
243
245
 
@@ -393,9 +395,9 @@ polylines_to_poly('polyline_test_base64', points, pointsPerLine,
393
395
  #%% test writing multiblock files
394
396
 
395
397
  # --8<-- [start:write_poly_multiblock_xml]
396
- from vtkio.writer.xml_writer import vtk_multiblock_writer
398
+ from vtkio.writer.xml_writer import xml_multiblock_writer
397
399
 
398
- vtk_multiblock_writer('new_vtk_multiblock_file', {
400
+ xml_multiblock_writer('new_vtk_multiblock_file', {
399
401
  'Base': {'files': ['edem_cube_base_t_0.vtp']},
400
402
  'Sides': {'files':['edem_cube_back_wall_t_0.vtp', 'edem_cube_left_wall_t_0.vtp',
401
403
  'edem_cube_front_wall_t_0.vtp', 'edem_cube_right_wall_t_0.vtp'],
@@ -410,6 +412,7 @@ vtk_multiblock_writer('new_vtk_multiblock_file', {
410
412
  from vtkio.writer.vtkhdf import VTKHDFMultiBlockWriter
411
413
 
412
414
  blocks = {'block1': plate_data, 'block2': map_data, 'block3': cow_data, 'block4': lines_data}
413
- VTKHDFMultiBlockWriter('hdf_multiblock_test', blocks)
415
+ writer = VTKHDFMultiBlockWriter('hdf_multiblock_test', blocks)
416
+ writer.write_vtkhdf_file()
414
417
 
415
418
  # --8<-- [end:write_poly_multiblock_vtkhdf]
@@ -379,3 +379,23 @@ test = VTKHDFUnstructuredGridWriter('revolution_triangular_mesh_test_new_hdf5',
379
379
  test.write_vtkhdf_file()
380
380
 
381
381
  # --8<-- [end:write_points_writer_api_vtkhdf_additional_metadata]
382
+
383
+ #%% write vtkhdf file with additional metadata
384
+ from vtkio.reader import read_vtkxml_data
385
+
386
+ cube_tensors_data = read_vtkxml_data('../TestData/vtu/cube_tensors.vtu')
387
+ disc_quads_data = read_vtkxml_data('../TestData/vtu/disc_quads.vtu')
388
+ fire_data = read_vtkxml_data('../TestData/vtu/fire.vtu')
389
+ single_plane_data = read_vtkxml_data('../TestData/vtu/single_plane.vtu')
390
+ multiple_tetra_data = read_vtkxml_data('../TestData/vtu/multiple_tetra.vtu')
391
+
392
+ # --8<-- [start:write_points_writer_api_vtkhdf_additional_metadata]
393
+ from vtkio.writer.vtkhdf import VTKHDFMultiBlockWriter
394
+
395
+ blocks = {'block1': cube_tensors_data, 'block2': disc_quads_data, 'block3': fire_data,
396
+ 'block4': single_plane_data,'block5': multiple_tetra_data,}
397
+
398
+ writer = VTKHDFMultiBlockWriter('hdf_multiblock_test_unstructured', blocks)
399
+ writer.write_vtkhdf_file()
400
+
401
+ # --8<-- [end:write_points_writer_api_vtkhdf_additional_metadata]