-
Notifications
You must be signed in to change notification settings - Fork 528
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
Deprecate DataSet.vectors
#1461
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1461 +/- ##
==========================================
- Coverage 90.05% 89.98% -0.07%
==========================================
Files 65 65
Lines 12437 12460 +23
==========================================
+ Hits 11200 11212 +12
- Misses 1237 1248 +11 |
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.
@MatthewFlamm Thanks for PR. Awesome job! I have 1 comment.
Co-authored-by: Tetsuo Koyama <[email protected]>
When you raise a warning or an error the exact line that emits the warning or error is also shown. This is normal. But when there are linebreaks in the line that emits the warning or error, only the first line is printed:
|
This I learned today. This makes it important to include something on that first line. |
I wouldn't worry about it too much. At worst one could define the long message in a separate variable and then have the warning on a single line. |
* upstream/main: (27 commits) Add additional ray trace example (pyvista#1502) Add legend face option (pyvista#1496) Improve dataset filter examples (pyvista#1482) narrow mac version testing (pyvista#1495) 📸 Add copy method to camera object (pyvista#1328) Scalar preferences (pyvista#1454) Minor post-PR cleanup (pyvista#1490) Fix boolean behavior (pyvista#1485) Add evenly spaced streamlines 2D filter (pyvista#1441) Do not return cpos by default (pyvista#1478) Add and improve examples (pyvista#1479) ignore debugleaks 'warning' (pyvista#1477) Revert "by default do not return the camera position" by default do not return the camera position Add pyvista plot directive (pyvista#1457) Update show_bounds kwargs, remove needless example import (pyvista#1466) Deprecate `DataSet.vectors` (pyvista#1461) add installation notes (pyvista#1462) 📝 Fix typo in rotate_y docs (pyvista#1458) only allow dataset types to be active (pyvista#1451) ...
Overview
As discussed in #1430, this PR deprecates the usage of
DataSet.vectors
to set and retrieve vector data. Today, pyvista does not explicitly distinguish between vector and scalar data other thanDataSet.active_vectors
and related methods.The
DataSet.vectors
usage is a simple shorthand forThis however leads to confusion as there is no special method for setting/retrieving scalars, tensors, etc.... (see pyvista/pyvista-support#448). It is also unintuitive to have a key with a leading underscore, which suggest that this shouldn't be used by users.
Details
Related to #1431, but not directly.
Closes #1430.
The warning message looks like:
I'm not sure why there is a hanging
warnings.warn(
at the end. I think I followed the same logic as the other deprecations in the codebase.