vtk export: .vti and .vtr formats (#833), code improvements and fixes#836
Merged
Merged
Conversation
35e1449 to
9741020
Compare
* Create XmlWriterInterface class and child classes (XmlWriterAscii and XmlWriterBinary), allowing to factorize lot of code. Namely, merge write() and write_binary(). binary is now a parameter of the Vtk class, consistently with other parameters. In addition, ascii and binary files are now written more consistently. Note: the written files are slightly different than before, but this only concerns minor style with no functionalities being impaired. * Use more appropriate data types for connectivity, offsets and cell types * Fix vtk.export_transient and utils.transient2d_export for binary option (it was actually saving in ascii) * Fix weird file name separators (i.e., "__", " _") in transient cases * Fix issue with inactive cells not ignored when smoothing : now ignore them (i.e., in extendedDataArray()) * Export ibound as well (it was excluded, but I see no reason why) * Improve code documentation * Simplify tests (t050) and make them more robust
9741020 to
9e2876d
Compare
* Export data in vtk ImageData (.vti) or RectilinearGrid (.vtr) formats when possible, instead of always UnstructuredGrid (.vtu), since this can greatly reduce file volume and speed up subsequent operations (e.g. in Paraview). The user can also choose to force an export in a specific format (e.g., .vtu) by using the new parameter vtk_grid_type (by default = 'auto') * Add tests for it to t050
9e2876d to
13c1dd2
Compare
|
@mwtoews, do you have any idea why we are getting TravisCI failures with the latest version of pyproj? The following command seems to be failing with pyproj version 2.6 on linux. I can't reproduce it on my Mac. |
Contributor
|
@langevin-usgs yes, this is a new regression with pyproj==2.6.0, I'll follow-up when I find the solution. |
|
@etiennebresciani, I looked through all of your changes and think it looks great. Thanks for the awesome contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I implemented the export of data to ImageData (.vti) or RectilinearGrid (.vtr) formats when possible, instead of always UnstructuredGrid (.vtu), since this can greatly reduce file volume and speed up subsequent operations (e.g. in Paraview). The user can also choose to force an export to a specific format (e.g., .vtu) by using the new parameter vtk_grid_type (by default = 'auto').
I made significant improvements to the vtk export code and fixed a number of issues along the way. These are in fact beneficial regardless of my initial intention. For better readability, I arranged my contribution into two commits: the first one only contains independent code improvements and fixes, and the second one actually contains the new feature. If possible, I think it would be better to keep the two commits.
This PR addresses issue #833 (although in this issue I also mentioned two more new functionalities, but I’d rather keep those for later to facilitate integration).