COMPAT: implement visit_Constant for 3.8 compat by TomAugspurger · Pull Request #28101 · pandas-dev/pandas (original) (raw)
msci-jordancrawford added a commit to olivermarchand/climada_python that referenced this pull request
All dependencies are changed to >= dependencies, rather than ==, which make climada suitable for use as a library. In addition, the following changes were made to ensure compatability with lab:
- Removed cartopy as a requirement, since it tends to break automation with its requirements on numpy at install time.
- Downgrade the version of the following packages to match lab:
- cython
- geopandas
- matplotlib
- nbformat
- numpy
- pillow
- xlrd
- xlsxwriter
- pandas
- Change the specified dependence of proj==7.0.0 (which is a c library) to pyproj>=2.6, the python package the exposes proj API bindings in python.
- Pin the following dependences (i.e. == instead of >=):
- xarray==0.13.0 to stop it from bringing in a pandas>=0.25 dependency
- gdal==3.0.4 version, since 3.0.4 is what ships with Ubuntu 20.04. Running higher versions causes compile time problems.
- Include explicit dependencies on rtree (optional dep of geopandas) and fsspec (optional dep of dask)
This change is not without impact. There are known test failures on the cannoncial lab setup (Ubuntu 20.04, Python 3.8, installed with rebuild-venv.sh), including:
- TypeError: visit_Constant() got an unexpected keyword argument 'side' in pandas code. This is a known error with pandas 0.24 when running on python 3.8 which is fixed in 0.25.2. See discussion at:
- In pandas, either: AttributeError: 'Series' object has no attribute 'to_numpy' or AttributeError: module 'pandas' has no attribute 'arrays' Both of these refer to pandas functionality introduced in 0.24.0 that is used directly by CLIMADA.
- ModuleNotFoundError: No module named 'pyepsg' 'pyepsg' is a wrapper tool that downloads epsg info from the web. This is explicitly excluded in order to prevent production instances from relying on a third party site.
- When pandas is reading an excel file, it uses the xlrd library, which references the time.clock() API, which has been long deprecated and was completley removed in Python 3.8.
Note that most of these errors could be resolved by bumping the pandas version to 0.25.2, a change which is pending further work in lab.