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

Improve levels auto_range with proper symmetry #17

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

juntyr
Copy link
Contributor

@juntyr juntyr commented Oct 8, 2024

The current implementation produces asymmetric levels when a divergence point is used, and is prone to rounding errors.

This patch

  • adjusts both the levels start and end to be a multiple of the bin_width (relative to the divergence point)
  • uses np.linspace instead of np.arange for better rounding

@FussyDuck
Copy link

FussyDuck commented Oct 8, 2024

CLA assistant check
All committers have signed the CLA.

@JamesVarndell JamesVarndell self-requested a review October 18, 2024 16:28
Copy link
Collaborator

@JamesVarndell JamesVarndell left a comment

Choose a reason for hiding this comment

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

This is a great improvement - many thanks for your contribution! I've made a small change (removed the now unnecessary math import), but happt to approve this.

@JamesVarndell JamesVarndell merged commit 4ac55aa into ecmwf:develop Oct 18, 2024
7 checks passed
@juntyr juntyr deleted the patch-1 branch October 18, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants