Adds DomainMesh improvements, docs, and bugfixes#1558
Adds DomainMesh improvements, docs, and bugfixes#1558peterdsharpe merged 39 commits intoNVIDIA:mainfrom
DomainMesh improvements, docs, and bugfixes#1558Conversation
…at allows selective application of functions to interior and boundary meshes. Update related tests to validate the new functionality and ensure proper behavior with global data preservation.
…ing existing plotters. This allows overlaying multiple meshes on the same scene.
…ns to support both matplotlib and PyVista backends, allowing for overlaying multiple meshes on the same scene.
…uce geometry-only meshes, improving check_boundary_watertight to include a cleaning step. Documentation for these methods has also been added or updated.
…streamline boundary mesh representation, enhancing readability and consistency in displayed mesh information.
…t sets This new function utilizes KNN to find and return matched indices of source and target points within a specified tolerance, enhancing the sampling capabilities of the mesh module.
Greptile SummaryThis PR adds Important Files Changed
Reviews (1): Last reviewed commit: "formatting" | Re-trigger Greptile |
… and improve formatting of mesh data representation, enhancing clarity and consistency in the tutorial outputs.
This commit introduces a new test to ensure that passing a PyVista Plotter to the mesh draw method with the matplotlib backend raises the appropriate ValueError. This enhances the robustness of the visualization module by validating error handling for unsupported backends.
This commit adds validation checks to ensure that the 'ax' parameter in the draw_mesh_matplotlib function is a valid matplotlib Axes object, and the 'plotter' parameter in the draw_mesh_pyvista function is a valid PyVista Plotter object. Appropriate ValueErrors are raised for invalid types, improving robustness in backend handling.
…a backends This commit enhances the docstrings for the draw_mesh_matplotlib and draw_mesh_pyvista functions, clarifying the purpose of the 'ax' and 'plotter' parameters, respectively. The updates specify that these parameters can be used to overlay multiple meshes on the same axes or scene, improving the usability and understanding of the functions.
|
/blossom-ci |
coreyjadams
left a comment
There was a problem hiding this comment.
Really nice notebook! The rest of the pr is great, pretty self explanatory. I have one small question I noticed but I suspect it's easy.
DomainMesh is really a killer app in the new release!
- Introduced `_open_tetrahedron_faces` function to create boundary meshes for a closed unit tetrahedron. - Added `TestProperties` class to verify boundary count and sorted boundary names. - Implemented `TestIsBoundaryWatertight` class to test various scenarios for boundary watertightness, including handling of float noise and explicit tolerance settings. - Ensured that domains with no boundaries return false for watertightness and that closed tetrahedrons are correctly identified as watertight.
…ucture - Added execution counts and outputs to code cells for better tracking of execution flow. - Removed redundant output definitions to streamline the notebook. - Improved the organization of code cells for better readability and understanding of the DomainMesh example.
- Clarified the tolerance parameter description to specify that the L2 distance comparison is inclusive. - Added notes regarding the one-way nearest-neighbor lookup and duplicate detection within a single point cloud. - Updated the return statement to use nonzero indices for matched source points, improving clarity in the output.
…tplotlib >= 3.7 - Updated edgecolors assignment to use a transparent RGBA list instead of the string "none" to prevent crashes during shading operations on empty arrays. - Ensured that the new implementation maintains the intended visual output while improving stability.
- Updated the import logic to accept `BasePlotter` as a common ancestor for various plotters, ensuring compatibility with both `pv.Plotter` and Qt-backed plotters. - Added comments to clarify the fallback mechanism for older versions of pyvista.
…parameter, allowing users to choose whether to retain point and cell data during the merge process. - Improved documentation for `merge_boundaries`, clarifying the behavior based on the `preserve_data` flag and detailing the conditions under which data is preserved or stripped.
…d visualization - Updated the `draw` method to accept `cell_scalars`, `cmap`, `vmin`, `vmax`, and alpha parameters for points, cells, and edges, allowing for more customizable rendering options. - Improved documentation to clarify parameter usage and provide examples for better user guidance. - Adjusted default behavior for `show_edges` to enhance readability of dense interior meshes.
…ization - Renamed test methods for clarity, changing `test_auto_tolerance_handles_float_noise` to `test_default_tolerance_handles_float_noise` and `test_explicit_tolerance_overrides_auto` to `test_explicit_tolerance_passthrough`. - Introduced `TestMergeBoundaries` class to validate boundary merging functionality, including error handling for zero boundaries and data preservation during merges. - Added visualization tests in `TestDraw` to ensure proper rendering of boundaries and functionality of the `draw` method with existing axes. - Enhanced documentation within tests to clarify expected behaviors and outcomes.
|
/blossom-ci |
PhysicsNeMo Pull Request
Description
Contains a bunch of small improvements to
DomainMesh, such as:DomainMesh.draw()to mirrorMesh.draw()with multi-mesh support.DomainMesh.n_boundaries, where we were incorrectly returning the `TensorDictDomainMesh.check_boundary_watertight()bugfix by deduplicating vertices before watertightness checkChecklist
Dependencies
Review Process
All PRs are reviewed by the PhysicsNeMo team before merging.
Depending on which files are changed, GitHub may automatically assign a maintainer for review.
We are also testing AI-based code review tools (e.g., Greptile), which may add automated comments with a confidence score.
This score reflects the AI’s assessment of merge readiness and is not a qualitative judgment of your work, nor is
it an indication that the PR will be accepted / rejected.
AI-generated feedback should be reviewed critically for usefulness.
You are not required to respond to every AI comment, but they are intended to help both authors and reviewers.
Please react to Greptile comments with 👍 or 👎 to provide feedback on their accuracy.