-
Notifications
You must be signed in to change notification settings - Fork 391
Utilise AdaptiveScalar in default NaturalEarthFeatures #1105
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
Conversation
|
Can you rebase this to get tests working? |
10eca50 to
45a346f
Compare
|
Tests are failing because image comparison tests are now receiving different images. I'll update the PR to include the correct images. |
|
@dopplershift - this is a really important PR, but I'm actually 👎 on it going into v0.17. Let's get the autoscaling bedded in in v0.17, and then turn on the magic for v0.18. Please feel free to overrule. |
|
@pelson I'm inclined to agree with you here and am happy to leave this behaviour for v0.18. I also have some improvements to the autoscaler in mind which I will hopefully get included in v0.18. |
|
Fine with me bumping from 0.17. |
|
@kaedonkers, did you have more you wanted to put into this PR still? Do we want to try and get it ready for the 0.18 release? |
|
It would be great to finally have this functionality on by default. |
45a346f to
743c7a6
Compare
|
I took the liberty of rebasing this, and addressing the review actions. |
743c7a6 to
190fed1
Compare
|
Tests are mostly failing because the image comparisons now have suitable coastline resolutions. I'll manually update all of the failing tests to use the old fixed resolution to minimise the number of image changes. |
dd99403 to
b3d78f4
Compare
|
Thanks @kaedonkers and @pelson! |
|
It's great to see this in! Thanks @kaedonkers, and to @QuLogic for merging. 👍 |
* unpin proj, move cartopy pin forward * Explicit resolution of coastlines in tests - see SciTools/cartopy#1105. * Removed gdal optional requirement. * New target image for test_plot_custom_aggregation due to auto-sizing coastlines in SciTools/cartopy#1105. Twin commit: SciTools/test-iris-imagehash@9b4e50e. * New acceptable images for various tests due to minor changes in Matplotlib 3.3. Twin commit: SciTools/test-iris-imagehash@3babde5. * New target images for test plots affected by the gridline spacing change in SciTools/cartopy@2f5e568. Twin commit: SciTools/test-iris-imagehash@f071f2c. * New acceptable images to allow for minute colormap range changes in Matplotlib 3.3. Twin commit: SciTools/test-iris-imagehash@9f4b04e. * Improvement to quickplot time axis labelling and accompanying graphics test target changes. Twin commit: SciTools/test-iris-imagehash@3036a6f * Made quickplot time axis label sensitive to MPL version (see matplotlib/matplotlib#15008). * More target images following from 41b3b2a. Twin commit: SciTools/test-iris-imagehash@804ff68. * More target images following from 27ea2f2. Twin commit: SciTools/test-iris-imagehash@f559a36. * Mirroring _draw_2d_from_points() use of mpl date2num in _draw_2d_from_bounds(). Twin commit: SciTools/test-iris-imagehash@3c582dc. * Re-instated all valid image targets for TestPlotCoordinatesGiven.test_tx. * New target image for TestSimple.test_bounds following change to plot axis labelling. Twin commit: SciTools/test-iris-imagehash@770dc92. * modify raster tests to handle new gdal behaviour * modify raster tests to handle new gdal naming behaviour * modify tests to reflect new PROJ behaviour * modify parts of test_project to use Transverse Mercator * revert test_project to use Robinson, add warning to docstring * keep results consistent Co-authored-by: Martin Yeo <[email protected]>
Rationale
The default NaturalEarthFeatures in Cartopy (COASTLINE, OCEAN, etc) have a fixed scale at
'110m'. It would be good to utilise the AdaptiveScaler to automatically scale to the extent of the plot by default.Implications
When, for instance,
ax.add_feature(OCEAN)is called the scale of the feature will automatically adjust to the extent of the axes, instead of the default'110m'. The behaviour ofax.coastlines()has also changed to have adaptive scaling by default. This functionality can be reversed using thewith_scale()method when adding default NaturalEarthFeatures or specifying a scale argument withax.coastlines()e.g.ax.coastlines('110m').