-
Notifications
You must be signed in to change notification settings - Fork 14
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
vis - Add control of cutter colours to new visualiser. #238
Conversation
…iser like the old visualiser. Can be turned off by kwarg. Doc strings.
…be used for default arguments as they're immutable unlike lists, so I use them downstream in my code.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #238 +/- ##
==========================================
+ Coverage 74.68% 74.69% +0.01%
==========================================
Files 157 157
Lines 22907 22921 +14
==========================================
+ Hits 17107 17120 +13
- Misses 5800 5801 +1 ☔ View full report in Codecov by Sentry. |
The macOS CI failures are due to opencascade 7.9.0 that changed |
I also found another bug in the new vtk viewer implementation that is indirectly affected by this change, so please do not do a release just after merging this PR. the fix is in #239 |
Ok. Yeah I see this change from OC 7.8.0 -> OC 7.9.0. Looks like just the TopoDS has changed from a class with lots of static methods to a namespace with inline functions. Should be relatively straightforward to fix. |
Ok fixed the opencascade issue in #240. Updated this PR |
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.
we can make the type checks slightly simpler
@@ -47,7 +47,7 @@ def __init__( | |||
# need to determine type or rotation and position, as should be Position or Rotation type | |||
from ..gdml import Defines as _Defines | |||
|
|||
if isinstance(position, list) or isinstance(position, _np.ndarray): | |||
if isinstance(position, (list, tuple)) or isinstance(position, _np.ndarray): |
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.
if isinstance(position, (list, tuple)) or isinstance(position, _np.ndarray): | |
if isinstance(position, (list, tuple, _np.ndarray)): |
@@ -65,7 +65,7 @@ def __init__( | |||
registry, | |||
False, | |||
) | |||
if isinstance(rotation, list) or isinstance(position, _np.ndarray): | |||
if isinstance(rotation, (list, tuple)) or isinstance(position, _np.ndarray): |
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.
if isinstance(rotation, (list, tuple)) or isinstance(position, _np.ndarray): | |
if isinstance(position, (list, tuple, _np.ndarray)): |
Add control over the cutter's colour in the new visualiser. Also, add cutters by default as super useful. Allow them to be disabled.
Mini edit for pv kwargs at same time as so small.