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

vis - Add control of cutter colours to new visualiser. #238

Merged
merged 5 commits into from
Feb 27, 2025

Conversation

lnevay
Copy link
Contributor

@lnevay lnevay commented Feb 24, 2025

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.

lnevay and others added 4 commits February 24, 2025 13:51
…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.
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.

Project coverage is 74.69%. Comparing base (cd5d5a3) to head (33cc524).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/pyg4ometry/visualisation/VtkViewerNew.py 85.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@ManuelHu
Copy link
Contributor

ManuelHu commented Feb 24, 2025

The macOS CI failures are due to opencascade 7.9.0 that changed TopoDS from a class to a namespace @stewartboogert .

@ManuelHu
Copy link
Contributor

ManuelHu commented Feb 24, 2025

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

@stewartboogert
Copy link
Member

stewartboogert commented Feb 24, 2025

The macOS CI failures are due to opencascade 7.9.0 that changed TopoDS from a class to a namespace @stewartboogert .

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.

@stewartboogert
Copy link
Member

Ok fixed the opencascade issue in #240. Updated this PR

Copy link
Contributor

@ManuelHu ManuelHu left a 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):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if isinstance(rotation, (list, tuple)) or isinstance(position, _np.ndarray):
if isinstance(position, (list, tuple, _np.ndarray)):

@stewartboogert stewartboogert merged commit a65e4f5 into g4edge:main Feb 27, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants