Add mesh_stats checks and field_operations features#51
Add mesh_stats checks and field_operations features#51alexbenedicto wants to merge 36 commits intomainfrom
Conversation
…om/GEOS-DEV/geosPythonPackages into origin/benedicto/followUpMeshStats
…rrays available in the source data + better error handling
There was a problem hiding this comment.
I would move the "local" imports at the end
There was a problem hiding this comment.
From the comment, it seems like we expect exactly 2 str in the tuple. Would something like list[ tuple[ str, str ] ] work?
|
|
||
| Returns: | ||
| array: [ distance0, distance1, ..., distanceN ] with N being the number of support elements. | ||
| """ |
There was a problem hiding this comment.
Looks like a great opportunity to use your support_construction defined at L30.
There was a problem hiding this comment.
It's tempting to have a seperate function that would return the number of elements, especially if the support_choices list is intended to grow in the future.
That would avoid changing the code everywhere it is repeated, like L209.
There was a problem hiding this comment.
In the doc string, "returns an array..."
There was a problem hiding this comment.
For readability and as you did L80, we could do:
| for i in range( result.number_cell_types ): | |
| logging.info( f"\t{result.cell_types[ i ]}\t\t({result.cell_type_counts[ i ]} cells)" ) | |
| for cell_type, type_count in zip(result.number_cell_types, result.cell_type_counts ): | |
| logging.info( f"\t{cell_type}\t\t({type_count} cells)" ) |
There was a problem hiding this comment.
| for field_name, validity_range in data.items(): | |
| is_valid: bool = validity_range[ 0 ] | |
| min_max: tuple[ float ] = validity_range[ 1 ] | |
| for field_name, (is_valid, min_max) in data.items(): |
There was a problem hiding this comment.
| if options.write_stats: | |
| if is_valid_to_write_folder( options.output_folder ): | |
| if options.write_stats and is_valid_to_write_folder( options.output_folder ): |
| for i, sub_grid in enumerate( sub_grids ): | ||
| for name, value in sub_grids_values[ i ].items(): |
There was a problem hiding this comment.
| for i, sub_grid in enumerate( sub_grids ): | |
| for name, value in sub_grids_values[ i ].items(): | |
| for sub_grid, sub_grid_value in zip(sub_grids, sub_grids_values): | |
| for name, value in sub_grid_value.items(): |
There was a problem hiding this comment.
At some point, could maybe be moved to the vtk utils ?
|
The mesh-doctor features developed here can be readded in future PR to create vtk filters for mesh-doctor. |
Closes #50
Followed the previous work on PR #19 and closes #19.
Two features added: