Skip to content
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

Track Actor names better and improve add_actor #3864

Merged
merged 7 commits into from
Jan 26, 2023
Merged

Conversation

banesullivan
Copy link
Member

@banesullivan banesullivan commented Jan 23, 2023

PyVista's BasePlotter tracks all Actors added to the scene with a unique name. This is a widely used feature and is tested quite well. Prior to this PR, the Actors themselves are unaware of their names, and I think PyVista's Actor class should track this value.

I don't like to add attributes that do not map to existing attributes/properties that exist in VTK, but in my opinion, this is a valid exception for a feature we've implemented specifically for PyVista.

Additionally, this adds support for explicit exceptions when using the @no_new_attr decorator. _renderer was a class attribute on Actor previous to this and I don't think it was actually working as expected. Through the use of _new_attr_exceptions, now classes can have a few explicit exceptions for new instance attributes like _renderer and _name for Actor

@github-actions github-actions bot added the enhancement Changes that enhance the library label Jan 23, 2023
@banesullivan banesullivan changed the title Track Actor names Track Actor names better and improve add_actor Jan 23, 2023
@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Merging #3864 (89475c0) into main (1ef0bb3) will decrease coverage by 0.01%.
The diff coverage is 96.15%.

@@            Coverage Diff             @@
##             main    #3864      +/-   ##
==========================================
- Coverage   94.18%   94.18%   -0.01%     
==========================================
  Files          87       87              
  Lines       19156    19179      +23     
==========================================
+ Hits        18043    18064      +21     
- Misses       1113     1115       +2     

@banesullivan banesullivan marked this pull request as ready for review January 24, 2023 00:28
Copy link
Member

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with the changes. Thanks!

@akaszynski akaszynski merged commit b2a731d into main Jan 26, 2023
@akaszynski akaszynski deleted the feat/actor-name branch January 26, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Changes that enhance the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants