-
Notifications
You must be signed in to change notification settings - Fork 588
Add reflect_axis_aligned as axis-aligned reflection filter #7724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add VTK 9.5 import for vtkAxisAlignedReflectionFilter - Implement reflect_axis_aligned() method in DataObjectFilters - Add comprehensive tests with VTK version checking - Create example demonstrating the new filter The filter reflects datasets across axis-aligned planes (YZ, XZ, or XY) and returns a MultiBlock containing the reflection and optionally the original input. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
for more information, see https://pre-commit.ci
- Remove separate example file - Enhance docstring examples with more detailed output - Show bounds comparison between original and reflected meshes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
for more information, see https://pre-commit.ci
Add noqa comment to suppress "too many positional arguments" warning following the same pattern as other methods in the codebase. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the vtkAxisAlignedReflectionFilter
introduced in VTK 9.5, which provides axis-aligned reflection capabilities for PyVista datasets. The implementation allows users to reflect datasets across YZ, XZ, or XY planes with configurable positioning and output options.
- Adds VTK 9.5+ import for
vtkAxisAlignedReflectionFilter
- Implements
reflect_axis_aligned()
method inDataObjectFilters
class with comprehensive parameter support - Includes thorough test coverage with proper VTK version handling
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
pyvista/core/_vtk_core.py |
Adds conditional import for VTK 9.5+ vtkAxisAlignedReflectionFilter |
pyvista/core/filters/data_object.py |
Implements the new reflect_axis_aligned() method with full documentation |
tests/core/test_dataobject_filters.py |
Comprehensive test suite covering all functionality and edge cases |
Comments suppressed due to low confidence (1)
tests/core/test_dataobject_filters.py:1335
- Using random data for testing vector reflection makes the test non-deterministic. Consider using a fixed seed with np.random.seed() or using deterministic test data to ensure consistent test results.
mesh['vectors'] = np.random.rand(mesh.n_points, 3)
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (17.14%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #7724 +/- ##
==========================================
- Coverage 96.39% 96.27% -0.12%
==========================================
Files 150 150
Lines 32609 32644 +35
Branches 4109 4115 +6
==========================================
- Hits 31432 31428 -4
- Misses 572 605 +33
- Partials 605 611 +6 |
Replace deprecated np.random.rand call with modern np.random.default_rng().random() to fix NPY002 ruff linting error. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Replace plane index mapping with explicit vtkPlane configuration. This change creates a reflection plane with proper normal and origin settings based on the specified axis and value, improving clarity and maintainability. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…eflection-filter
…hub.com/pyvista/pyvista into feat-add-axis-aligned-reflection-filter
I have not looked at this closely but this may be similar to |
Summary
This PR adds support for the
vtkAxisAlignedReflectionFilter
introduced in VTK 9.5, which reflects datasets across axis-aligned planes.Key Changes
vtkAxisAlignedReflectionFilter
in_vtk_core.py
reflect_axis_aligned()
method inDataObjectFilters
classImplementation Details
The new
reflect_axis_aligned()
method:value
parameterMultiBlock
containing reflection and optionally the originalExample Usage
Testing
copy_input
parameter behaviorNotes
🤖 Generated with Claude Code