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

Correct y limits in ProfileViewerState when min same as max #2513

Merged
merged 9 commits into from
Sep 24, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions glue/viewers/profile/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@
if y_max > y_min:
self.y_min = y_min
self.y_max = y_max
elif np.allclose(y_min, y_max):
if np.allclose(y_min, 0):
self.y_min = -0.1
self.y_max = 0.1

Check warning on line 236 in glue/viewers/profile/state.py

View check run for this annotation

Codecov / codecov/patch

glue/viewers/profile/state.py#L234-L236

Added lines #L234 - L236 were not covered by tests
else:
self.y_min = y_min * 0.9
self.y_max = y_max * 1.1

Check warning on line 239 in glue/viewers/profile/state.py

View check run for this annotation

Codecov / codecov/patch

glue/viewers/profile/state.py#L238-L239

Added lines #L238 - L239 were not covered by tests
pllim marked this conversation as resolved.
Show resolved Hide resolved
else:
self.y_min = 0
self.y_max = 1
Expand Down
Loading