monocongo/climate_indices

TypeError: Parameters to generic types must be types. Got NotImplemented.

Opened this issue · 2 comments

The running environment I use is the subsystem of Linux under windows10 (WSL, the system is Ubuntu 18.04). According to the document process, the following error is obtained:

(climate) gszs@WINDOWS-C9SKUO7:~/anaconda3$ process_climate_indices --index spei --periodicity monthly --netcdf_precip /data/nclimgrid_lowres_prcp.nc --var_name_precip prcp --netcdf_pet /data/nclimgrid_lowres_pet.nc --var_name_pet pet --output_file_base /output/nclimgrid_lowres --scales 9 18 --calibration_start_year 1951 --calibration_end_year 2010 --multipr
ocessing all
Traceback (most recent call last):
File "/home/gszs/anaconda3/bin/process_climate_indices", line 7, in
from climate_indices.main import main
File "/home/gszs/anaconda3/lib/python3.7/site-packages/climate_indices/main.py", line 12, in
import xarray as xr
File "/home/gszs/anaconda3/lib/python3.7/site-packages/xarray/init.py", line 3, in
from . import testing, tutorial, ufuncs
File "/home/gszs/anaconda3/lib/python3.7/site-packages/xarray/testing.py", line 8, in
from xarray.core import duck_array_ops, formatting, utils
File "/home/gszs/anaconda3/lib/python3.7/site-packages/xarray/core/duck_array_ops.py", line 16, in
from . import dask_array_compat, dask_array_ops, dtypes, npcompat, nputils
File "/home/gszs/anaconda3/lib/python3.7/site-packages/xarray/core/npcompat.py", line 81, in
from numpy.typing import ArrayLike, DTypeLike
File "/home/gszs/anaconda3/lib/python3.7/site-packages/numpy/typing/init.py", line 315, in
from ._shape import _Shape, _ShapeLike
File "/home/gszs/anaconda3/lib/python3.7/site-packages/numpy/typing/_shape.py", line 15, in
_ShapeLike = Union[SupportsIndex, Sequence[SupportsIndex]]
File "/home/gszs/anaconda3/lib/python3.7/typing.py", line 251, in inner
return func(*args, **kwds)
File "/home/gszs/anaconda3/lib/python3.7/typing.py", line 626, in getitem
params = tuple(_type_check(p, msg) for p in params)
File "/home/gszs/anaconda3/lib/python3.7/typing.py", line 626, in
params = tuple(_type_check(p, msg) for p in params)
File "/home/gszs/anaconda3/lib/python3.7/typing.py", line 139, in _type_check
raise TypeError(f"{msg} Got {arg!r:.100}.")
TypeError: Parameters to generic types must be types. Got NotImplemented.

So what happened? How should I solve this problem. Thank you very much for helping me solve this problem

Today I tested this on WSL with Ubuntu 20, all went as expected:

(issue436) Local:~/home/data/climate/example_climate_indices/example/input
$ process_climate_indices --index spei --periodicity monthly --netcdf_precip nclimgrid_lowres_prcp.nc --var_name_precip prcp --netcdf_pet nclimgrid_lowres_pet.nc --var_name_pet pet --output_file_base nclimgrid_lowres --scales 9 18 --calibration_start_year 1951 --calibration_end_year 2010 --multiprocessing all
2021-11-04  17:30:09 INFO Start time:    2021-11-04 17:30:09.581723
2021-11-04  17:30:09 INFO Computing 9-month SPEI/Pearson
2021-11-04  17:30:27 INFO Computing 9-month SPEI/Gamma
2021-11-04  17:30:52 INFO Computing 18-month SPEI/Pearson
2021-11-04  17:31:21 INFO Computing 18-month SPEI/Gamma
2021-11-04  17:31:44 INFO End time:      2021-11-04 17:31:44.125346
2021-11-04  17:31:44 INFO Elapsed time:  0:01:34.543623

I have installed the climate-indices package from PyPI as well as llvmlite into the conda Python3 environment.

Hello @gszs06 is this still an issue for you? I would like to close this issue if not, as part of a general housecleaning effort.