aesara-devs / aesara

Aesara is a Python library for defining, optimizing, and efficiently evaluating mathematical expressions involving multi-dimensional arrays.

Home Page:https://aesara.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NumPy 1.26 causes error

maresb opened this issue · comments

Description of your problem or feature request

import aesara

Please provide the full tracebacks for any relevant errors and/or warning messages.

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/aesara/configparser.py", line 234, in fetch_val_for_key
    return self._aesara_cfg.get(section, option)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/configparser.py", line 797, in get
    d = self._unify_values(section, vars)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/configparser.py", line 1168, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'blas'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/aesara/configparser.py", line 350, in __get__
    val_str = cls.fetch_val_for_key(self.name, delete_key=delete_key)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/aesara/configparser.py", line 238, in fetch_val_for_key
    raise KeyError(key)
KeyError: 'blas__ldflags'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.11/site-packages/aesara/__init__.py", line 120, in <module>
    from aesara import scalar, tensor
  File "/opt/conda/lib/python3.11/site-packages/aesara/tensor/__init__.py", line 106, in <module>
    from aesara.tensor import (  # noqa
  File "/opt/conda/lib/python3.11/site-packages/aesara/tensor/blas.py", line 162, in <module>
    from aesara.tensor.blas_headers import blas_header_text, blas_header_version
  File "/opt/conda/lib/python3.11/site-packages/aesara/tensor/blas_headers.py", line 1015, in <module>
    if not config.blas__ldflags:
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/aesara/configparser.py", line 354, in __get__
    val_str = self.default()
              ^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/aesara/link/c/cmodule.py", line 2725, in default_blas_ldflags
    blas_info = np.__config__.get_info("blas_opt")
                ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'numpy.__config__' has no attribute 'get_info'

Please provide any additional information below.

Versions and main components

  • Aesara version: 2.9.1
  • Python version: 3.11.5
  • Operating system: Ubuntu 22.04
  • How did you install Aesara: micromamba install -c conda-forge aesara-base
Aesara config:

Place the results of python -c "import aesara; print(aesara.config)" here.

N/A

#1512 was merged recently as a fix for that specific issue, but it doesn't necessarily address all the potential issues with NumPy 1.26, since the CI tests don't cover that version yet.

Ah, very nice. I wanted to fix the feedstock and didn't check for duplicates.

Ah, very nice. I wanted to fix the feedstock and didn't check for duplicates.

No problem; it's probably best to bound the version for now, as you did in the feedstock.

Ah, so to be clear <1.26 should apply also in 2.9.2?

If so, should probably be added to pyproject.toml

If so, should probably be added to pyproject.toml

True. I might have time to set up the tests in CI soon, in which case bounding the version might not be necessary.