pyscience-projects / pyevtk

PyEVTK (Python Export VTK) exports data to binary VTK files for visualization/analysis with packages like Paraview, VisIt, and Mayavi.
Other
63 stars 15 forks source link

imageToVTK: determine low-dim grid from spacing #36

Closed MuellerSeb closed 1 year ago

MuellerSeb commented 1 year ago

Closes #37

imageToVTK was not able to determine lower dimension grids from given cell-data. Meaning: if cell data had a single slice in one direction, imageToVTK assumed it always to be 3D. But from given spacing of 0.0 one could determine that the cell elements should be 2D (or even 1D).

This PR fixes this issue and adds checks for spacing and data shapes.

codecov-commenter commented 1 year ago

Codecov Report

Merging #36 (a7e30e6) into master (f4df805) will decrease coverage by 1.34%. The diff coverage is 25.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
- Coverage   73.32%   71.99%   -1.34%     
==========================================
  Files           6        6              
  Lines         956      964       +8     
==========================================
- Hits          701      694       -7     
- Misses        255      270      +15     
Impacted Files Coverage Δ
pyevtk/vtk.py 86.07% <ø> (ø)
pyevtk/hl.py 79.43% <25.00%> (-1.42%) :arrow_down:

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

renefritze commented 1 year ago

Thanks for the fix @MuellerSeb ! I've updated branch protection accordingly.

MuellerSeb commented 1 year ago

Thanks for the merge! Could you do a new release with that fix included? Need it downstream.

Cheers, Sebastian