-
Notifications
You must be signed in to change notification settings - Fork 1.4k
FIX: focalpoint #9010
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
FIX: focalpoint #9010
Conversation
mne/viz/backends/_pyvista.py
Outdated
# focalpoint: if 'auto', we use the center of mass of the visible | ||
# bounds, if None, we use the existing camera focal point otherwise | ||
# we use the values given by the user | ||
if focalpoint == 'auto': |
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.
>>> np.array([0, 0, 0]) == 'auto'
<stdin>:1: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
False
Typically we handle this with:
_validate_type(focalpoint, (str, None, np.ndarray), 'focalpoint')
if isinstance(focalpoint, str):
_check_option('focalpoint', focalpoint, ('auto',), extra='when a string')
...
elif focalpoint is None:
...
else:
...
Weird rendering problems EDIT: probably related to event processing and/or updates: |
Those are really scary. I think it got reported but I didn't take care of it yet. I agree it's probably resize event or something. My next focus will be between this and multiplotter. |
@GuillaumeFavelier can you push a commit with |
BTW, the results are available on: https://26478-1301584-gh.circle-artifacts.com/0/dev/index.html |
Circle probably uses PyVista master since it breaks already. I'll open a PR to get ready for those changes. |
@GuillaumeFavelier any chance to return to this? It's going to be a blocker for 0.23 |
TBH I was counting on #8997 to fix it indirectly but considering the slow progress, it might not be enough for the next release. I'll give it max priority then 👍 |
I think #8997 is a good one to merge right after release rather than right before it. It's a big change and we want some months of testing and use ourselves to make sure it's stable |
I think it's worth a |
For reference:
And locally for |
LGTM -- ready to go, then? |
Ready on my end |
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.
LGTM will merge once CIs come back happy!
Thanks @GuillaumeFavelier ! |
This PR fixes #9007 by changing the camera's default focal point.