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

Unpin Matplotlib and proj #3762

Merged
merged 20 commits into from
Sep 3, 2020
Merged

Conversation

stephenworsley
Copy link
Contributor

Addresses #3759 and #3154.

It is expected that many tests may have to change to accommodate this. It should be demonstrated in each case that such a change is appropriate.

@stephenworsley
Copy link
Contributor Author

stephenworsley commented Jul 24, 2020

The test test_extent/test_cube (iris.tests.unit.analysis.cartography.test_project.TestAll) is failing due to a change in the numerical result. This may be due to improvements in the accuracy of Proj in the Robinson projection made, for example, here OSGeo/PROJ#1292.

@trexfeathers trexfeathers marked this pull request as draft August 24, 2020 09:37
@trexfeathers trexfeathers changed the title (WIP) Unpin Matplotlib and proj Unpin Matplotlib and proj Aug 24, 2020
@trexfeathers
Copy link
Contributor

trexfeathers commented Aug 24, 2020

Installing Cartopy now installs GDAL (see changes to the Cartopy recipe). Is it therefore appropriate to remove GDAL from iris/requirements/extensions.txt, or is it good to keep this as 'belt and braces'?

@pp-mo
Copy link
Member

pp-mo commented Aug 24, 2020

Is it therefore appropriate to remove GDAL from iris/requirements/extensions.txt

Looking at what was done here, I now think it was a mistake to put it in that list in the first place (and I did it!) : The comment suggests that the 'extensions' should be things that depend on Iris itself (hence iris-grib). But equally, it's not clear when this information would ever used : not by Travis, not by pip, so presumably it's just a hint to users.

In short, I would remove it + not worry.

@stephenworsley
Copy link
Contributor Author

I have a hunch that this PR is the one which caused the GDAL related tests to fail OSGeo/gdal#1185.
Unfortunately, it's not a small PR so it's a bit tricky to unpick what's going on here, but relevant to our tests are these changes https://github.com/OSGeo/gdal/pull/1185/files#diff-3610c5e11cf9b7bc8e8b33baa7f4ca70. Specifically the change of certain strings from "unnamed" to unknown.

@trexfeathers
Copy link
Contributor

trexfeathers commented Aug 24, 2020

In light of SciTools/cartopy#1105, I've changed all tests that use ax.coastlines() to explicitly state the target resolution. This will not yet fix the relevant graphics tests as there are still some minor border differences to accept - will review those with @stephenworsley tomorrow.

SciTools/cartopy#1105 has also caused a failure in test_plot_custom_aggregation (see the relevant Travis build), but in this case I propose we should accept the new result as the correct one since it will henceforth demonstrate Cartopy's AdaptiveScalar functionality, which makes Iris simpler to use. In this situation would it be appropriate to also remove the old 'out-dated' image hash(es) as no longer acceptable?

@trexfeathers
Copy link
Contributor

trexfeathers commented Aug 24, 2020

Given the discussion on #2952, we should probably have a wider discussion about the implications of Cartopy now bringing in GDAL as a core dependency.

  • Size: I compared the size of a conda environment for Iris master (a4541ce) and this PR (da2977e)
    I think this is a serious cause for concern, particularly at a time when we are discussing reducing Iris' install size:
    • python requirements/gen_conda_requirements.py > [my file name]
    • conda create -n [my env name] --file [my file name]
    • du -sh [path to my conda environment]
    • master: 604M
      Unpin Matplotlib and proj #3762: 1014M
    • Haven't yet confirmed if GDAL is responsible for this, although based on previous discussions it seems likely
  • Constraints/pins: the GDAL recipe is now significantly less pinned than it when at the time @pp-mo raised Stop testing with gdal. #2952
  • Possible other concerns - I need to have a thorough read of Stop testing with gdal. #2952 to see how the discussion relates to the current scenario

@trexfeathers
Copy link
Contributor

trexfeathers commented Aug 25, 2020

Graphics test failures

Accepted image hash changes (SciTools/test-iris-imagehash#35):

@trexfeathers
Copy link
Contributor

trexfeathers commented Aug 26, 2020

"What's New" Entries

Changes here will need a "What's New", but it will be simpler to add after merging - see #3807

@trexfeathers
Copy link
Contributor

All the graphics tests are now passing. @stephenworsley I'll leave you to continue investigating the other test failures. Let me know if you need a hand 🙂

@stephenworsley
Copy link
Contributor Author

While I still haven't got to the root cause of why the behaviour has changed, I've looked through the documentation for the key 42113 (https://gdal.org/drivers/raster/gtiff.html#nodata-value) and there is nothing to indicate that storing a fill value for data without masked points is in any way improper.

@stephenworsley
Copy link
Contributor Author

stephenworsley commented Sep 1, 2020

It looks like there is still something odd going on with test_cube. I got it working in my own environment so that the numbers were correct, but it looks like there's still something going on with the Travis environment causing there to be inf values. It seems that this was introduced between Proj 7.0.0 and 7.1.0.

@stephenworsley
Copy link
Contributor Author

The missing values mentioned above may be related to this PR OSGeo/PROJ#2151.

@trexfeathers
Copy link
Contributor

trexfeathers commented Sep 2, 2020

Given the discussion on #2952, we should probably have a wider discussion about the implications of Cartopy now bringing in GDAL as a core dependency.

Several devs have further discussed offline. GDAL offers a number of benefits, and currently would only be responsible for a fraction of Iris' total install 'bloat', so we expect will be fine to include. We are already familiar with use cases that make regular use of GDAL/Fiona with Iris.

If we make progress with reducing Iris' install size ('Iris Slimline'), GDAL's inclusion may be of greater concern. If so, there may be a case to alter Cartopy's inclusion of GDAL in its Conda recipe: the changes to that recipe for 0.18 (conda-forge/cartopy-feedstock#88) no longer reflect the fact that GDAL is actually still an optional dependency - it can still be seen to be optional in cartopy/INSTALL and the absence of GDAL in the "Minimum dependencies" matrix entry of cartopy/.travis.yml (instead only brought in with Fiona in the "Latest everything" matrix entry).

@trexfeathers
Copy link
Contributor

... are we there?

@stephenworsley
Copy link
Contributor Author

@trexfeathers close I think, just needs some reviewing now.

@stephenworsley stephenworsley marked this pull request as ready for review September 2, 2020 13:35
@trexfeathers
Copy link
Contributor

OK, please can you confirm that you are happy with the changes I have made? We discussed almost all of this last week.

I will review the changes you have made and once we are both happy I will merge.

Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

This review is a text recording of a voice conversation during pair programming, where @stephenworsley explained the changes that they have made in the PR.

Copy link
Contributor Author

@stephenworsley stephenworsley left a comment

Choose a reason for hiding this comment

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

The changes due to graphical tests look good to me.

lib/iris/plot.py Show resolved Hide resolved
lib/iris/quickplot.py Show resolved Hide resolved
lib/iris/tests/results/imagerepo.json Show resolved Hide resolved
@trexfeathers
Copy link
Contributor

@stephenworsley and I have finished pair programming and pair reviewing this PR. @pp-mo we'll give you some time to comment/review if you wish, but we consider this good to go 💯

@pp-mo
Copy link
Member

pp-mo commented Sep 2, 2020

@pp-mo we'll give you some time

Ok I've not considered everything here at all, only details, but I'll take a little look + see if anything sticks out...

@pp-mo
Copy link
Member

pp-mo commented Sep 2, 2020

Just to note from previous comment ...

In this situation would it be appropriate to also remove the old 'out-dated' image hash(es) as no longer acceptable?

Likewise, from other comment

Some behaviours have changed permanently ... I have elected to set new image hashes as the only acceptable targets

I think we don't generally bother with this too much. The chances of a bug producing a plot that matches an older result, which is now a wrong answer, are supposed to be pretty small. But it doesn't seem 'wrong' to do it.
However, we definitely don't want to remove the images from test-iris-imagehash : That would prevent running the tests on an older checkout, and we would generally prefer to keep that working, if possible (though dependency changes may still mess it up).

@pp-mo
Copy link
Member

pp-mo commented Sep 2, 2020

A lot of very careful work here ! 💐
Gets my vote. @trexfeathers , when ready : hit that button 👍
( you deserve it ! )

@trexfeathers
Copy link
Contributor

However, we definitely don't want to remove the images from test-iris-imagehash : That would prevent running the tests on an older checkout, and we would generally prefer to keep that working, if possible (though dependency changes may still mess it up).

I agree and accordingly I haven't done anything with SciTools/test-iris-imagehash.

@trexfeathers trexfeathers merged commit a2f49c3 into SciTools:master Sep 3, 2020
@trexfeathers trexfeathers mentioned this pull request Sep 3, 2020
tkknight added a commit to tkknight/iris that referenced this pull request Sep 7, 2020
…haul

* upstream/master:
  move whatsnew contributions (SciTools#3816)
  Parse with packaging version (SciTools#3815)
  Add "What's New" entries for unpinning Cartopy, Matplotlib, Proj (SciTools#3811)
  tidy issue templates (SciTools#3814)
  Legacy doc notice (SciTools#3813)
  Update issue templates
  Update issue templates
  Update issue templates
  Unpin Matplotlib and proj (SciTools#3762)
@xylar
Copy link

xylar commented Oct 16, 2020

I just noticed this discussion. I'm sorry me adding gdal as a dependency of cartopy caused you trouble. You are right in #3762 (comment) that it should have been kept optional. I'm removing it as a required dependency in the next build: conda-forge/cartopy-feedstock#94 but wanted to check in to make sure this isn't going to cause additional trouble.

@trexfeathers
Copy link
Contributor

but wanted to check in to make sure this isn't going to cause additional trouble.

@xylar luckily we're currently doing some work that should flush out any possible recipe issues, so we should be able to let you know in the next couple of days. Don't think we're expecting any problems though 🙂

@xylar
Copy link

xylar commented Oct 19, 2020

Okay, I'm going to go ahead an merge conda-forge/cartopy-feedstock#94 unless you would prefer I hold off.

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.

4 participants