Skip to content
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

Undedectet Issue with numpy>=1.24 in geokit 1.40 #9

Open
julian-belina opened this issue Feb 22, 2024 · 0 comments
Open

Undedectet Issue with numpy>=1.24 in geokit 1.40 #9

julian-belina opened this issue Feb 22, 2024 · 0 comments

Comments

@julian-belina
Copy link
Collaborator

Geokit 1.40 is incompatible to numpy numpy>=1.24. The dependency constraint should be included.

The error occurs the buildMask function. It can be repoduced by running the test_ExclusionCalculator.py from glaes.

----------------------------- Captured stderr call -----------------------------
pj_obj_create: Open of /home/runner/miniconda3/envs/test_env/share/proj failed
________________________ test_ExclusionCalculator_save _________________________

def test_ExclusionCalculator_save():

   ec = gl.ExclusionCalculator(aachenShape)

glaes/glaes/test/test_ExclusionCalculator.py:60:

glaes/glaes/core/ExclusionCalculator.py:238: in init
s.maskPixels = s.region.mask.sum()
../../../miniconda3/envs/test_env/lib/python3.8/site-packages/geokit/core/regionmask.py:470: in mask
self.buildMask()
../../../miniconda3/envs/test_env/lib/python3.8/site-packages/geokit/core/regionmask.py:457: in buildMask
**kwargs).astype(np.bool)

attr = 'bool'

def __getattr__(attr):
    # Warn for expired attributes, and return a dummy function
    # that always raises an exception.
    import warnings
    try:
        msg = __expired_functions__[attr]
    except KeyError:
        pass
    else:
        warnings.warn(msg, DeprecationWarning, stacklevel=2)

        def _expired(*args, **kwds):
            raise RuntimeError(msg)

        return _expired

    # Emit warnings for deprecated attributes
    try:
        val, msg = __deprecated_attrs__[attr]
    except KeyError:
        pass
    else:
        warnings.warn(msg, DeprecationWarning, stacklevel=2)
        return val

    if attr in __future_scalars__:
        # And future warnings for those that will change, but also give
        # the AttributeError
        warnings.warn(
            f"In the future `np.{attr}` will be defined as the "
            "corresponding NumPy scalar.", FutureWarning, stacklevel=2)

    if attr in __former_attrs__:
       raise AttributeError(__former_attrs__[attr])

E AttributeError: module 'numpy' has no attribute 'bool'.
E np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

../../../miniconda3/envs/test_env/lib/python3.8/site-packages/numpy/init.py:305: AttributeError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant