With new version of numpy v2.0.0, np.can_cast does not accept ints, float or complex anymore. Thus stackstac.stack raise an error systematically, example:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\gitlab_runner\miniforge3\envs\fordead-gitlab-ci\Lib\site-packages\stackstac\stack.py", line 290, in stack
asset_table, spec, asset_ids, plain_items = prepare_items(
^^^^^^^^^^^^^^
File "C:\Users\gitlab_runner\miniforge3\envs\fordead-gitlab-ci\Lib\site-packages\stackstac\prepare.py", line 168, in prepare_items
if not np.can_cast(asset_scale, dtype):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: can_cast() does not support Python ints, floats, and complex because the result used to depend on the value.
This change was part of adopting NEP 50, we may explicitly allow them again in the future.
With new version of
numpy v2.0.0
,np.can_cast
does not accept ints, float or complex anymore. Thusstackstac.stack
raise an error systematically, example:returns: