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

Fix axis mismatch on show/hide of sensor arrows #679

Merged
merged 1 commit into from
Nov 5, 2023

Conversation

Alexboiboi
Copy link
Member

This fixes the mismatch of showed or hidden sensor axes. More specifically the "y" and"z" where switched when trying to hide one.

I would suggest to do a patch fix release right away when this is merged. I'd have a workaround for a Left Handed Sensor which needs this fix (see #676)

import magpylib as magpy

sens = []
for i, k in enumerate("xyz"):
    s = magpy.Sensor(
        position=(i, 0, 0),
        style_label=f"Sensor ({k}-axis hidden)",
        style_size=4,
    )
    s.style.arrows.update({f"{k}_show": False})
    sens.append(s)
magpy.show(sens)

Before

image

After

image

@Alexboiboi Alexboiboi added bug needs attention graphics labels Nov 4, 2023
@Alexboiboi Alexboiboi added this to the 4.4 milestone Nov 4, 2023
@Alexboiboi Alexboiboi self-assigned this Nov 4, 2023
@Alexboiboi Alexboiboi changed the title Fix right axis on show/hide of sensor arrows Fix axis mismatch on show/hide of sensor arrows Nov 4, 2023
Copy link

codecov bot commented Nov 4, 2023

Codecov Report

Merging #679 (093b41c) into main (ed38060) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #679   +/-   ##
=======================================
  Coverage   99.24%   99.24%           
=======================================
  Files          55       55           
  Lines        7119     7119           
=======================================
  Hits         7065     7065           
  Misses         54       54           
Files Coverage Δ
magpylib/_src/display/sensor_mesh.py 100.00% <100.00%> (ø)

@Alexboiboi Alexboiboi mentioned this pull request Nov 5, 2023
Copy link
Member

@OrtnerMichael OrtnerMichael left a comment

Choose a reason for hiding this comment

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

This works as described.
Didnt even know we had this kwarg

@OrtnerMichael OrtnerMichael merged commit 8597f84 into main Nov 5, 2023
@OrtnerMichael OrtnerMichael deleted the bugfix/sensor-arrows-show branch November 5, 2023 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs attention graphics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants