Skip to content

Axis should always honor absolute minimum /maximum as well as minimum/maximum range properties#1819

Merged
Jonarw merged 4 commits into
oxyplot:developfrom
mghie:develop
Feb 20, 2022
Merged

Axis should always honor absolute minimum /maximum as well as minimum/maximum range properties#1819
Jonarw merged 4 commits into
oxyplot:developfrom
mghie:develop

Conversation

@mghie

@mghie mghie commented Nov 7, 2021

Copy link
Copy Markdown
Contributor

Fixes #1812.

Checklist

  • [*] I have included examples or tests
  • [*] I have updated the change log
  • [*] I am listed in the CONTRIBUTORS file
  • I have cleaned up the commit history (use rebase and squash)

Changes proposed in this pull request:

  • check of property consistency moved to beginning of Axis.CoerceActualMaxMin()
  • calculation of ActualMaximum and ActualMinimum improved to always honor absolute minimum and maximum as well as minimum and maximum range
  • tests added

@oxyplot/admins

@VisualMelon

Copy link
Copy Markdown
Contributor

Thanks for putting this together! I'm pretty busy for the next few days, but will try to take a proper look at Thursday.

Feel free to ping me if I don't get back to you or if you have any questions.

VisualMelon
VisualMelon previously approved these changes Dec 23, 2021

@VisualMelon VisualMelon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I had some reservations about the behaviour around NaNs here, but I think that's an edge case we probably don't need to worry about for now given how limited the scenarios are where this behaviour would be applicable.

(e.g. the implicit NaN check on line 1602 in Axis isn't very obvious; might be worth making that and other implicit checks more explicit)

@VisualMelon

Copy link
Copy Markdown
Contributor

@Jonarw would you mind sanity checking this? I'm always nervous about merging this sort of change without a second review.

@VisualMelon

Copy link
Copy Markdown
Contributor

@mghie that last commit has gone wrong, I think: are you able to revert and rebase against the develop branch?

@VisualMelon VisualMelon dismissed their stale review February 20, 2022 08:33

Not sure what has happened

@mghie

mghie commented Feb 20, 2022

Copy link
Copy Markdown
Contributor Author

@VisualMelon I did a revert and rebase (first time I did such a thing, hopefully the right way), does it look better now? I have to say that I'm not really sure what I'm doing here, learning along the way, please be patient...

@VisualMelon

VisualMelon commented Feb 20, 2022

Copy link
Copy Markdown
Contributor

No problem, I should have been clearer. What you have looks fine when I look at it locally, but I'm not sure what is going on with the github diff interface.

Instead of that, can you do a hard reset to commit f3fab4a (may want to make a backup first) and force-push that over the top? That should remove the new commits, and just leave you with the 4 proper commits.

You can achieve this by running:

git reset --hard f3fab4a6349a160d807d0d70d09ad2811b5d4422
(check that you still have all your changes e.g. with git log and git diff head~4)
git push --force

Having done this locally, there will be a conflict with the changelog, but we (the maintainers) should be able to fix that when we merge it. Rebasing would enable you to resolve this, but it's trivial so shouldn't be a problem: if there is a problem, we can deal with that when we get there.

An axis with absolute limits and MinimumRange set will not always honor
these after a call to Reset().  Two new tests added which demonstrate
the isse, one without data and the other with data partially
out-of-range.
The exception message for the check that MinimumRange is not larger than the difference of absolute maximum and absolute minimum was wrong. Added also a check for MinimumRange not being larger than MaximumRange
Axis constraints like absolute minimum, absolute maximum, minimum range and maximum range should now work even with no data or data which is outside the absolute limits. The validity checks have been moved to the start of the method so that there is no partial setting of properties.
@VisualMelon

Copy link
Copy Markdown
Contributor

Thanks for rebasing as well!

@mghie

mghie commented Feb 20, 2022

Copy link
Copy Markdown
Contributor Author

@VisualMelon Thanks for your support, I learned a few things today

@Jonarw Jonarw merged commit b3c9a87 into oxyplot:develop Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Absolute limits and MinimumRange not always honored

3 participants