-
Notifications
You must be signed in to change notification settings - Fork 128
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
Python 3.9: remove pynio as dependency and replace with rasterio and pin Matplotlib>3.3.1 and pin cartopy>=0.18 #1997
Conversation
@valeriupredoi As discussed in #1935, the After spending a bit of time in looking for viable alternatives, I was able to revise the 'indicted' cmorizer by using the xarray rasterio function to open the files and read the data So the If so, I'll be happy to update the cmorizer. |
@tomaslovato cheers for looking into this, mate, and proposing |
@valeriupredoi actually to use |
@tomaslovato could you pls commit here if it's not too long? Cheers 🍺 |
Usage of rasterio is required by the need to drop pynio package. This imply the use of the xarray specific data read function open_rasterio, but this requires some modification to the cmorizer code that involves adjusting the informations flow from the input dataArray read by rasterio.
@valeriupredoi I added the required changes to the cmorizer code that produces a file that is exactly the same as in previous version (at least on our cluster!) |
You're a star, mate, cheers very much! Don't wait up on the tests, the environment creation takes a while. This is ready for merge, thanks @tomaslovato 🍺 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
about @bouweandela 's suggestion to pin Cartopy - there is this PR #1893 that I will now include here, for a proper all-in-one test of env solvability etc, and then once we merge this one we can just close that one |
full port of #1893 here so I will close w/o merges that one when we merge this one 👍 |
Pynio removal
pynio
is no longer maintained and is an obsolete package preventing us to support Python 3.9 as described in #1996 and a general nuisance as described in #1935As far as the functionality in ESMValTool goes, it is used as a file loader engine for
xarray
in the cmorizeresmvaltool/cmorizers/obs/cmorize_obs_eppley_vgpm_modis.py
script, but according to the xarray function documentation theengine
arg is optional, and if not specified, the defaultsnetcdf4
is used and preferred.Any reason why thesee below forpynio
engine is explicitly used? I don't have the rawOBS data so I can't test but if there is no particular reason forpynio
use, please approve this PR; if there is a proper reason forpynio
please mention it here and provide a usable and viable alternative.rasterio
pynio -> rasterio
@tomaslovato examined the situation and recommended
rasterio
for an engine;rasterio
is supported and on bothconda-forge
andPyPi
(see pypi package). I have added it to the environment to be installed from PyPi and the environment builds well (without ESMValCore from PyPi, but installed in development mode, to test the Python 3.9 compatibility).rasterio
wheel builds fine in a Python 3.9 environment and ESMValTool installs fine. @tomaslovato promised to include code for its use in the cmorizer script 👍pin Matplotlib>3.3.1
I unpinned Matplotlib since we are not wanting Matplotlib 3.3.1 (the bug reported in Nikolay's comment) but 3.3.1 is already very old and 3.3.3 will be installed automatically.
If we really are paranoid, we can force a conditionI have now pinned the lower bound to!=3.3.1
but I don't think it's necessary.>3.3.1
to help the environment solve faster.pin cartopy>=0.18
since Matplotlib 3 don't work with lower versions of cartopy
Replace conda env update with conda env create
In the Circle CI script I replaced calls to
conda env update
with full blown env creationconda env create
, conda update is a bit hit and miss.Changes from #1893
Fully ported here
Functionality for Python 3.9 use
Solves the env with esmvalcore out for full development installation (since the esmvalcore conda package is Python 3.8), installs OK and tests OK (Python 3.9.1 for conda=4.9.2)
Closes: #1935 #1996 #1998 #1893