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

Numpy should be limited to 1.23.5 #12

Open
julian-belina opened this issue Jan 18, 2024 · 6 comments
Open

Numpy should be limited to 1.23.5 #12

julian-belina opened this issue Jan 18, 2024 · 6 comments

Comments

@julian-belina
Copy link

The numpy version in environment.yml should be limited to numpy<=1.23.5. With numpy 1.24 i get the following error when running the tests:

----------------------------- 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

@julian-belina
Copy link
Author

The conda forge package should be updated as well

@tpelser
Copy link
Collaborator

tpelser commented Feb 21, 2024

updated to which version? @julian-belina

@julian-belina
Copy link
Author

Numpy should be limitted to numpy<=1.23.5. This sould also be included in the coda-forge package.

@tpelser
Copy link
Collaborator

tpelser commented Feb 21, 2024

Issue with Numpy<1.4 is related to the dependency "Geokit". We will update the Glaes requirements to reflect this for now, once Geokit has been updated can remove this limitation.

@chrisjwin
Copy link
Collaborator

We will leave the issue open to inform as long as numpy is limited to <1.24 and remove it afterwards. Could you paste the respective geokit test error into a geokit github issue as well @julian-belina ?

@chrisjwin chrisjwin reopened this Feb 21, 2024
@julian-belina
Copy link
Author

An issue has been opened on the geokit repository:

FZJ-IEK3-VSA/geokit#9

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

3 participants