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: gridliner auto-updates by default (and always in future) #2330

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Feb 22, 2024

Rationale

As suggested at #1792 (comment), updating gridlines and their labels when the figure is re-drawn (or tight_bbox re-calculated) is now the default. Also deprecate the option to not update.

Closes #1792

Implications

There is one change in an image test result, where the zero labels on the equator have disappeared from the top right plot. I'm not 100% clear why this is. There is some logic that makes labels invisible based on how much space is available so my best guess is that the calculation after tight_layout puts us just the other side of the threshold for "not enough space", though any changes in positioning are imperceptible.

I guess if anyone tells us they have a use-case where auto_update=False matters, we can remove the deprecation.

@rcomer
Copy link
Member Author

rcomer commented Feb 22, 2024

Is there a way to view the failed test images from GHA? I do not have access to a Windows machine. I note that the RMS on the failures is similar to what this test's tolerance was previously set to, so it's probably fine but better to check!

@greglucas
Copy link
Contributor

Is there a way to view the failed test images from GHA? I do not have access to a Windows machine. I note that the RMS on the failures is similar to what this test's tolerance was previously set to, so it's probably fine but better to check!

If you click on the "Summary" page for Actions on all the runners you can see an "Artifacts" download area then. Here is a direct link:
https://github.com/SciTools/cartopy/actions/runs/8008180591?pr=2330#artifacts

@rcomer
Copy link
Member Author

rcomer commented Feb 23, 2024

Thanks @greglucas - here is the failed diff from Windows py311:

result-failed-diff

Just a small shift in the location of two zeros. So I think we are fine to just set the tolerance as before 👍

@greglucas greglucas merged commit 7570278 into SciTools:main Feb 23, 2024
23 checks passed
@rcomer rcomer deleted the gl-update-default branch February 23, 2024 15:10
@rcomer rcomer added this to the Next Release milestone Feb 23, 2024
@rcomer
Copy link
Member Author

rcomer commented May 19, 2024

If I pass the auto_update parameter under 0.23, I don't see a deprecation warning. What did I do wrong here?

@lgolston
Copy link
Contributor

If I pass the auto_update parameter under 0.23, I don't see a deprecation warning. What did I do wrong here?

With warnings.simplefilter('always') the warning does show up. Apparently FutureWarning needs to be used instead of DeprecationWarning to show by default.

@lgolston
Copy link
Contributor

lgolston commented May 19, 2024

After reading https://peps.python.org/pep-0565/, I think that is not actually the problem. Testing now, if stacklevel=3 is added to the warning then it does show

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.

Calling tight_layout between gridlines and set_extent screws up
3 participants