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 1 commit
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
4 changes: 4 additions & 0 deletions glue/viewers/profile/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@
if y_max > y_min:
self.y_min = y_min
self.y_max = y_max
elif np.allclose(y_min, y_max):
dy = max(0.1, 0.1 * y_min)
self.y_min = y_min - dy
self.y_max = y_max + dy

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
pllim marked this conversation as resolved.
Show resolved Hide resolved
else:
self.y_min = 0
self.y_max = 1
Expand Down