Closed santisoler closed 3 years ago
Tests pass on Python 3.8 and Dask 2.30.0
# packages in environment at /home/santi/.anaconda3/envs/verde-3.8: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge alabaster 0.7.12 py_0 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge astroid 2.3.3 py38_1 conda-forge attrs 20.3.0 pyhd3deb0d_0 conda-forge babel 2.9.0 pyhd3deb0d_0 conda-forge black 20.8b1 py_1 conda-forge bokeh 2.3.0 py38h578d9bd_0 conda-forge brotlipy 0.7.0 py38h497a2fe_1001 conda-forge c-ares 1.17.1 h7f98852_1 conda-forge ca-certificates 2020.12.5 ha878542_0 conda-forge cartopy 0.18.0 py38hab71064_13 conda-forge certifi 2020.12.5 py38h578d9bd_1 conda-forge cffi 1.14.5 py38ha65f79e_0 conda-forge chardet 4.0.0 py38h578d9bd_1 conda-forge click 7.1.2 pyh9f0ad1d_0 conda-forge cloudpickle 1.6.0 py_0 conda-forge coverage 5.5 py38h497a2fe_0 conda-forge cryptography 3.4.6 py38ha5dfef3_0 conda-forge cycler 0.10.0 py_2 conda-forge cytoolz 0.11.0 py38h497a2fe_3 conda-forge dask 2.30.0 py_0 conda-forge dask-core 2.30.0 py_0 conda-forge dataclasses 0.8 pyhc8e2a94_1 conda-forge dbus 1.13.6 hfdff14a_1 conda-forge distributed 2.30.1 py38h578d9bd_0 conda-forge docutils 0.16 py38h578d9bd_3 conda-forge expat 2.2.10 h9c3ff4c_0 conda-forge flake8 3.8.4 py_0 conda-forge fontconfig 2.13.1 hba837de_1004 conda-forge freetype 2.10.4 h0708190_1 conda-forge fsspec 0.8.7 pyhd8ed1ab_0 conda-forge geos 3.9.1 h9c3ff4c_2 conda-forge gettext 0.19.8.1 h0b5b191_1005 conda-forge glib 2.66.7 h9c3ff4c_1 conda-forge glib-tools 2.66.7 h9c3ff4c_1 conda-forge gst-plugins-base 1.18.3 h04508c2_0 conda-forge gstreamer 1.18.3 h3560a44_0 conda-forge heapdict 1.0.1 py_0 conda-forge icu 68.1 h58526e2_0 conda-forge idna 2.10 pyh9f0ad1d_0 conda-forge imagesize 1.2.0 py_0 conda-forge importlib-metadata 3.7.2 py38h578d9bd_0 conda-forge iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge isort 4.3.21 py38h32f6830_1 conda-forge jinja2 2.11.3 pyh44b312d_0 conda-forge joblib 1.0.1 pyhd8ed1ab_0 conda-forge jpeg 9d h36c2ea0_0 conda-forge kiwisolver 1.3.1 py38h1fd1430_1 conda-forge krb5 1.17.2 h926e7f8_0 conda-forge lazy-object-proxy 1.5.2 py38h497a2fe_1 conda-forge lcms2 2.12 hddcbb42_0 conda-forge ld_impl_linux-64 2.35.1 hea4e1c9_2 conda-forge libblas 3.9.0 8_openblas conda-forge libcblas 3.9.0 8_openblas conda-forge libclang 11.1.0 default_ha53f305_0 conda-forge libcurl 7.75.0 hc4aaa36_0 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libevent 2.1.10 hcdb4288_3 conda-forge libffi 3.3 h58526e2_2 conda-forge libgcc-ng 9.3.0 h2828fa1_18 conda-forge libgfortran-ng 9.3.0 hff62375_18 conda-forge libgfortran5 9.3.0 hff62375_18 conda-forge libglib 2.66.7 h3e27bee_1 conda-forge libgomp 9.3.0 h2828fa1_18 conda-forge libiconv 1.16 h516909a_0 conda-forge liblapack 3.9.0 8_openblas conda-forge libllvm10 10.0.1 he513fc3_3 conda-forge libllvm11 11.1.0 hf817b99_0 conda-forge libnghttp2 1.43.0 h812cca2_0 conda-forge libopenblas 0.3.12 pthreads_h4812303_1 conda-forge libpng 1.6.37 h21135ba_2 conda-forge libpq 13.1 hfd2b0eb_2 conda-forge libssh2 1.9.0 ha56f1ee_6 conda-forge libstdcxx-ng 9.3.0 h6de172a_18 conda-forge libtiff 4.2.0 hdc55705_0 conda-forge libuuid 2.32.1 h7f98852_1000 conda-forge libwebp-base 1.2.0 h7f98852_0 conda-forge libxcb 1.13 h7f98852_1003 conda-forge libxkbcommon 1.0.3 he3ba5ed_0 conda-forge libxml2 2.9.10 h72842e0_3 conda-forge llvmlite 0.35.0 py38h4630a5e_1 conda-forge locket 0.2.0 py_2 conda-forge lz4-c 1.9.3 h9c3ff4c_0 conda-forge markupsafe 1.1.1 py38h497a2fe_3 conda-forge matplotlib 3.3.4 py38h578d9bd_0 conda-forge matplotlib-base 3.3.4 py38h0efea84_0 conda-forge mccabe 0.6.1 py_1 conda-forge more-itertools 8.7.0 pyhd8ed1ab_0 conda-forge msgpack-python 1.0.2 py38h1fd1430_1 conda-forge mypy_extensions 0.4.3 py38h578d9bd_3 conda-forge mysql-common 8.0.23 ha770c72_1 conda-forge mysql-libs 8.0.23 h935591d_1 conda-forge ncurses 6.2 h58526e2_4 conda-forge nspr 4.29 h9c3ff4c_1 conda-forge nss 3.62 hb5efdd6_0 conda-forge numba 0.52.0 py38h51da96c_0 conda-forge numpy 1.20.1 py38h18fd61f_0 conda-forge numpydoc 1.1.0 py_1 conda-forge olefile 0.46 pyh9f0ad1d_1 conda-forge openssl 1.1.1j h7f98852_0 conda-forge packaging 20.9 pyh44b312d_0 conda-forge pandas 1.2.3 py38h51da96c_0 conda-forge partd 1.1.0 py_0 conda-forge pathspec 0.8.1 pyhd3deb0d_0 conda-forge pcre 8.44 he1b5a44_0 conda-forge pillow 8.1.2 py38ha0e1e83_0 conda-forge pip 21.0.1 pyhd8ed1ab_0 conda-forge pluggy 0.13.1 py38h578d9bd_4 conda-forge pooch 1.3.0 pyhd8ed1ab_0 conda-forge proj 7.2.0 h277dcde_2 conda-forge psutil 5.8.0 py38h497a2fe_1 conda-forge pthread-stubs 0.4 h36c2ea0_1001 conda-forge py 1.10.0 pyhd3deb0d_0 conda-forge pycodestyle 2.6.0 pyh9f0ad1d_0 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pyflakes 2.2.0 pyh9f0ad1d_0 conda-forge pygments 2.8.1 pyhd8ed1ab_0 conda-forge pykdtree 1.3.4 py38h0b5ebd8_0 conda-forge pylint 2.4.4 py38_0 conda-forge pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyproj 3.0.1 py38h16ecdd7_0 conda-forge pyqt 5.12.3 py38h578d9bd_7 conda-forge pyqt-impl 5.12.3 py38h7400c14_7 conda-forge pyqt5-sip 4.19.18 py38h709712a_7 conda-forge pyqtchart 5.12 py38h7400c14_7 conda-forge pyqtwebengine 5.12.1 py38h7400c14_7 conda-forge pyshp 2.1.3 pyh44b312d_0 conda-forge pysocks 1.7.1 py38h578d9bd_3 conda-forge pytest 6.2.2 py38h578d9bd_0 conda-forge pytest-cov 2.11.1 pyh44b312d_0 conda-forge pytest-mpl 0.12 pyhd3deb0d_0 conda-forge python 3.8.8 hffdb5ce_0_cpython conda-forge python-dateutil 2.8.1 py_0 conda-forge python_abi 3.8 1_cp38 conda-forge pytz 2021.1 pyhd8ed1ab_0 conda-forge pyyaml 5.4.1 py38h497a2fe_0 conda-forge qt 5.12.9 hda022c4_4 conda-forge readline 8.0 he28a2e2_2 conda-forge regex 2020.11.13 py38h497a2fe_1 conda-forge requests 2.25.1 pyhd3deb0d_0 conda-forge scikit-learn 0.24.1 py38h658cfdd_0 conda-forge scipy 1.6.0 py38hb2138dd_0 conda-forge setuptools 49.6.0 py38h578d9bd_3 conda-forge shapely 1.7.1 py38h4fc1155_4 conda-forge six 1.15.0 pyh9f0ad1d_0 conda-forge snowballstemmer 2.1.0 pyhd8ed1ab_0 conda-forge sortedcontainers 2.3.0 pyhd8ed1ab_0 conda-forge sphinx 2.2.1 py_0 conda-forge sphinx-gallery 0.8.2 pyhd8ed1ab_0 conda-forge sphinx_rtd_theme 0.4.3 py_0 conda-forge sphinxcontrib-applehelp 1.0.2 py_0 conda-forge sphinxcontrib-devhelp 1.0.2 py_0 conda-forge sphinxcontrib-htmlhelp 1.0.3 py_0 conda-forge sphinxcontrib-jsmath 1.0.1 py_0 conda-forge sphinxcontrib-qthelp 1.0.3 py_0 conda-forge sphinxcontrib-serializinghtml 1.1.4 py_0 conda-forge sqlite 3.34.0 h74cdb3f_0 conda-forge tblib 1.6.0 py_0 conda-forge threadpoolctl 2.1.0 pyh5ca1d4c_0 conda-forge tk 8.6.10 h21135ba_1 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge toolz 0.11.1 py_0 conda-forge tornado 6.1 py38h497a2fe_1 conda-forge typed-ast 1.4.2 py38h497a2fe_0 conda-forge typing_extensions 3.7.4.3 py_0 conda-forge urllib3 1.26.3 pyhd8ed1ab_0 conda-forge verde 1.5.0+16.g0a98d6d.dirty dev_0wheel 0.36.2 pyhd3deb0d_0 conda-forge wrapt 1.12.1 py38h497a2fe_3 conda-forge xarray 0.17.0 pyhd8ed1ab_0 conda-forge xorg-libxau 1.0.9 h7f98852_0 conda-forge xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge xz 5.2.5 h516909a_1 conda-forge yaml 0.2.5 h516909a_0 conda-forge zict 2.0.0 py_0 conda-forge zipp 3.4.1 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h516909a_1010 conda-forge zstd 1.4.9 ha95c52a_0 conda-forge
After manually running the cross_val_score
example and the test_spline_cv
with the delayed
parametrization (delayed = True
, client = None
, engine = 'numpy'
) without any error, it seems that the problem is only produced when the example and the test is run through pytest
.
cross_val_score
example:
import dask
from sklearn.model_selection import ShuffleSplit
import verde as vd
coords = vd.grid_coordinates((0, 10, -10, -5), spacing=0.1)
data = 10 - coords[0] + 0.5 * coords[1]
model = vd.Trend(degree=1)
cross_validator = ShuffleSplit(n_splits=10, random_state=0)
scores_delayed = vd.cross_val_score(
model, coords, data, cv=cross_validator, delayed=True
)
scores = dask.compute(*scores_delayed)
print(", ".join(["{:.2f}".format(score) for score in scores]))
test_spline_cv
:
import verde as vd
from sklearn.model_selection import ShuffleSplit
from dask.distributed import Client
region = (100, 500, -800, -700)
synth = vd.datasets.CheckerBoard(region=region)
data = synth.scatter(size=1500, random_state=0)
coords = (data.easting, data.northing)
delayed, client, engine = True, None, "numpy"
spline = vd.SplineCV(
dampings=[None, 1e3],
mindists=[1e-7, 1e6],
cv=ShuffleSplit(n_splits=1, random_state=0),
delayed=delayed,
client=client,
engine=engine,
).fit(coords, data.scalars)
This issue might be related to https://github.com/dask/distributed/issues/4570
Tests pass on Python 3.8 and Dask 2021.2.0
# packages in environment at /home/santi/.anaconda3/envs/verde-3.8: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge alabaster 0.7.12 py_0 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge astroid 2.3.3 py38_1 conda-forge attrs 20.3.0 pyhd3deb0d_0 conda-forge babel 2.9.0 pyhd3deb0d_0 conda-forge black 20.8b1 py_1 conda-forge bokeh 2.3.0 py38h578d9bd_0 conda-forge brotlipy 0.7.0 py38h497a2fe_1001 conda-forge c-ares 1.17.1 h7f98852_1 conda-forge ca-certificates 2020.12.5 ha878542_0 conda-forge cartopy 0.18.0 py38hab71064_13 conda-forge certifi 2020.12.5 py38h578d9bd_1 conda-forge cffi 1.14.5 py38ha65f79e_0 conda-forge chardet 4.0.0 py38h578d9bd_1 conda-forge click 7.1.2 pyh9f0ad1d_0 conda-forge cloudpickle 1.6.0 py_0 conda-forge coverage 5.5 py38h497a2fe_0 conda-forge cryptography 3.4.6 py38ha5dfef3_0 conda-forge cycler 0.10.0 py_2 conda-forge cytoolz 0.11.0 py38h497a2fe_3 conda-forge dask 2021.2.0 pyhd8ed1ab_0 conda-forge dask-core 2021.2.0 pyhd8ed1ab_0 conda-forge dataclasses 0.8 pyhc8e2a94_1 conda-forge dbus 1.13.6 hfdff14a_1 conda-forge distributed 2021.2.0 py38h578d9bd_0 conda-forge docutils 0.16 py38h578d9bd_3 conda-forge expat 2.2.10 h9c3ff4c_0 conda-forge flake8 3.8.4 py_0 conda-forge fontconfig 2.13.1 hba837de_1004 conda-forge freetype 2.10.4 h0708190_1 conda-forge fsspec 0.8.7 pyhd8ed1ab_0 conda-forge geos 3.9.1 h9c3ff4c_2 conda-forge gettext 0.19.8.1 h0b5b191_1005 conda-forge glib 2.66.7 h9c3ff4c_1 conda-forge glib-tools 2.66.7 h9c3ff4c_1 conda-forge gst-plugins-base 1.18.3 h04508c2_0 conda-forge gstreamer 1.18.3 h3560a44_0 conda-forge heapdict 1.0.1 py_0 conda-forge icu 68.1 h58526e2_0 conda-forge idna 2.10 pyh9f0ad1d_0 conda-forge imagesize 1.2.0 py_0 conda-forge importlib-metadata 3.7.2 py38h578d9bd_0 conda-forge iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge isort 4.3.21 py38h32f6830_1 conda-forge jinja2 2.11.3 pyh44b312d_0 conda-forge joblib 1.0.1 pyhd8ed1ab_0 conda-forge jpeg 9d h36c2ea0_0 conda-forge kiwisolver 1.3.1 py38h1fd1430_1 conda-forge krb5 1.17.2 h926e7f8_0 conda-forge lazy-object-proxy 1.5.2 py38h497a2fe_1 conda-forge lcms2 2.12 hddcbb42_0 conda-forge ld_impl_linux-64 2.35.1 hea4e1c9_2 conda-forge libblas 3.9.0 8_openblas conda-forge libcblas 3.9.0 8_openblas conda-forge libclang 11.1.0 default_ha53f305_0 conda-forge libcurl 7.75.0 hc4aaa36_0 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libevent 2.1.10 hcdb4288_3 conda-forge libffi 3.3 h58526e2_2 conda-forge libgcc-ng 9.3.0 h2828fa1_18 conda-forge libgfortran-ng 9.3.0 hff62375_18 conda-forge libgfortran5 9.3.0 hff62375_18 conda-forge libglib 2.66.7 h3e27bee_1 conda-forge libgomp 9.3.0 h2828fa1_18 conda-forge libiconv 1.16 h516909a_0 conda-forge liblapack 3.9.0 8_openblas conda-forge libllvm10 10.0.1 he513fc3_3 conda-forge libllvm11 11.1.0 hf817b99_0 conda-forge libnghttp2 1.43.0 h812cca2_0 conda-forge libopenblas 0.3.12 pthreads_h4812303_1 conda-forge libpng 1.6.37 h21135ba_2 conda-forge libpq 13.1 hfd2b0eb_2 conda-forge libssh2 1.9.0 ha56f1ee_6 conda-forge libstdcxx-ng 9.3.0 h6de172a_18 conda-forge libtiff 4.2.0 hdc55705_0 conda-forge libuuid 2.32.1 h7f98852_1000 conda-forge libwebp-base 1.2.0 h7f98852_0 conda-forge libxcb 1.13 h7f98852_1003 conda-forge libxkbcommon 1.0.3 he3ba5ed_0 conda-forge libxml2 2.9.10 h72842e0_3 conda-forge llvmlite 0.35.0 py38h4630a5e_1 conda-forge locket 0.2.0 py_2 conda-forge lz4-c 1.9.3 h9c3ff4c_0 conda-forge markupsafe 1.1.1 py38h497a2fe_3 conda-forge matplotlib 3.3.4 py38h578d9bd_0 conda-forge matplotlib-base 3.3.4 py38h0efea84_0 conda-forge mccabe 0.6.1 py_1 conda-forge more-itertools 8.7.0 pyhd8ed1ab_0 conda-forge msgpack-python 1.0.2 py38h1fd1430_1 conda-forge mypy_extensions 0.4.3 py38h578d9bd_3 conda-forge mysql-common 8.0.23 ha770c72_1 conda-forge mysql-libs 8.0.23 h935591d_1 conda-forge ncurses 6.2 h58526e2_4 conda-forge nspr 4.29 h9c3ff4c_1 conda-forge nss 3.62 hb5efdd6_0 conda-forge numba 0.52.0 py38h51da96c_0 conda-forge numpy 1.20.1 py38h18fd61f_0 conda-forge numpydoc 1.1.0 py_1 conda-forge olefile 0.46 pyh9f0ad1d_1 conda-forge openssl 1.1.1j h7f98852_0 conda-forge packaging 20.9 pyh44b312d_0 conda-forge pandas 1.2.3 py38h51da96c_0 conda-forge partd 1.1.0 py_0 conda-forge pathspec 0.8.1 pyhd3deb0d_0 conda-forge pcre 8.44 he1b5a44_0 conda-forge pillow 8.1.2 py38ha0e1e83_0 conda-forge pip 21.0.1 pyhd8ed1ab_0 conda-forge pluggy 0.13.1 py38h578d9bd_4 conda-forge pooch 1.3.0 pyhd8ed1ab_0 conda-forge proj 7.2.0 h277dcde_2 conda-forge psutil 5.8.0 py38h497a2fe_1 conda-forge pthread-stubs 0.4 h36c2ea0_1001 conda-forge py 1.10.0 pyhd3deb0d_0 conda-forge pycodestyle 2.6.0 pyh9f0ad1d_0 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pyflakes 2.2.0 pyh9f0ad1d_0 conda-forge pygments 2.8.1 pyhd8ed1ab_0 conda-forge pykdtree 1.3.4 py38h0b5ebd8_0 conda-forge pylint 2.4.4 py38_0 conda-forge pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyproj 3.0.1 py38h16ecdd7_0 conda-forge pyqt 5.12.3 py38h578d9bd_7 conda-forge pyqt-impl 5.12.3 py38h7400c14_7 conda-forge pyqt5-sip 4.19.18 py38h709712a_7 conda-forge pyqtchart 5.12 py38h7400c14_7 conda-forge pyqtwebengine 5.12.1 py38h7400c14_7 conda-forge pyshp 2.1.3 pyh44b312d_0 conda-forge pysocks 1.7.1 py38h578d9bd_3 conda-forge pytest 6.2.2 py38h578d9bd_0 conda-forge pytest-cov 2.11.1 pyh44b312d_0 conda-forge pytest-mpl 0.12 pyhd3deb0d_0 conda-forge python 3.8.8 hffdb5ce_0_cpython conda-forge python-dateutil 2.8.1 py_0 conda-forge python_abi 3.8 1_cp38 conda-forge pytz 2021.1 pyhd8ed1ab_0 conda-forge pyyaml 5.4.1 py38h497a2fe_0 conda-forge qt 5.12.9 hda022c4_4 conda-forge readline 8.0 he28a2e2_2 conda-forge regex 2020.11.13 py38h497a2fe_1 conda-forge requests 2.25.1 pyhd3deb0d_0 conda-forge scikit-learn 0.24.1 py38h658cfdd_0 conda-forge scipy 1.6.0 py38hb2138dd_0 conda-forge setuptools 49.6.0 py38h578d9bd_3 conda-forge shapely 1.7.1 py38h4fc1155_4 conda-forge six 1.15.0 pyh9f0ad1d_0 conda-forge snowballstemmer 2.1.0 pyhd8ed1ab_0 conda-forge sortedcontainers 2.3.0 pyhd8ed1ab_0 conda-forge sphinx 2.2.1 py_0 conda-forge sphinx-gallery 0.8.2 pyhd8ed1ab_0 conda-forge sphinx_rtd_theme 0.4.3 py_0 conda-forge sphinxcontrib-applehelp 1.0.2 py_0 conda-forge sphinxcontrib-devhelp 1.0.2 py_0 conda-forge sphinxcontrib-htmlhelp 1.0.3 py_0 conda-forge sphinxcontrib-jsmath 1.0.1 py_0 conda-forge sphinxcontrib-qthelp 1.0.3 py_0 conda-forge sphinxcontrib-serializinghtml 1.1.4 py_0 conda-forge sqlite 3.34.0 h74cdb3f_0 conda-forge tblib 1.6.0 py_0 conda-forge threadpoolctl 2.1.0 pyh5ca1d4c_0 conda-forge tk 8.6.10 h21135ba_1 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge toolz 0.11.1 py_0 conda-forge tornado 6.1 py38h497a2fe_1 conda-forge typed-ast 1.4.2 py38h497a2fe_0 conda-forge typing_extensions 3.7.4.3 py_0 conda-forge urllib3 1.26.3 pyhd8ed1ab_0 conda-forge verde 1.5.0+16.g0a98d6d.dirty dev_0wheel 0.36.2 pyhd3deb0d_0 conda-forge wrapt 1.12.1 py38h497a2fe_3 conda-forge xarray 0.17.0 pyhd8ed1ab_0 conda-forge xorg-libxau 1.0.9 h7f98852_0 conda-forge xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge xz 5.2.5 h516909a_1 conda-forge yaml 0.2.5 h516909a_0 conda-forge zict 2.0.0 py_0 conda-forge zipp 3.4.1 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h516909a_1010 conda-forge zstd 1.4.9 ha95c52a_0 conda-forge
Description of the problem
Some tests that run delayed operations fail on Python 3.8 and Dask
2021.3.0
.Full code that generated the error
Full error message
System information
conda list
below:output of conda list