BEAST-Fitting / beast

Bayesian Extinction And Stellar Tool
http://beast.readthedocs.io
23 stars 34 forks source link

beast get_libfiles dependency issues (astropy.config.configuration.update_default_config and scipy.integrate.trapz) #824

Open debtran opened 1 week ago

debtran commented 1 week ago

In the BEAST installation docs, the library files need to be installed with beast get_libfiles. There are two hiccups for getting this script to run:

  1. ImportError: cannot import name 'update_default_config' from 'astropy.config.configuration' The script utilizes update_default_config from astropy.config.configuration found in _astropy_init.py., which is deprecated as of astropy v6.0.0 as indicated in the official changelog of Astropy. Currently, the astropy version installed with pip install beast is v6.1.4. I implemented a temporary fix of removing this from ~/beast/lib/python3.11/site-packages/beast/_astropy_init.py.

  2. ImportError: cannot import name 'trapz' from 'scipy.integrate' scipy.integrate.trapz is utilized in beast.observationalmodel.phot, which is deprecated as of scipy v1.14.0. Switching to scipy.integrate.trapezoid in ~/beast/lib/python3.11/site-packages/beast/observationmodel/phot.py seems to have solved this issue.

If deemed appropriate, I'm willing to create a pull request to update scipy.integrate.trapz to scipy.integrate.trapezoid in phot.py. A more permanent solution for update_default_config is a bit beyond me though. Let me know your thoughts.

karllark commented 1 week ago

Thanks for the issue. Both issues should be fixed in the dev version. This really tells me that a new pip installable release is needed. I will prioritize that for this week. If you wanted to get the dev version, go ahead and install it via github (i.e., pip install git+https://github.com/BEAST-Fitting/beast.git) and comment on this issue if it fixes both issues.

debtran commented 6 days ago

Wonderful! Thank you for the quick response. I tested the dev version's installation following the exact installation instructions, and get_libfiles works now!

If it is at all helpful for future reference, I'm using scipy v1.14.1 and numpy 2.1.1, and below are the build dependences for scipy. Please let me know if there's anything else I can do to support getting the issue resolved.

python -c "import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info); scipy.show_config()"
1.14.1 2.1.1 sys.version_info(major=3, minor=11, micro=10, releaselevel='final', serial=0)
Build Dependencies:
  blas:
    detection method: pkgconfig
    found: true
    include directory: /opt/_internal/cpython-3.11.9/lib/python3.11/site-packages/scipy_openblas32/include
    lib directory: /opt/_internal/cpython-3.11.9/lib/python3.11/site-packages/scipy_openblas32/lib
    name: scipy-openblas
    openblas configuration: OpenBLAS 0.3.27.dev DYNAMIC_ARCH NO_AFFINITY Zen MAX_THREADS=64
    pc file directory: /project
    version: 0.3.27.dev
  lapack:
    detection method: pkgconfig
    found: true
    include directory: /opt/_internal/cpython-3.11.9/lib/python3.11/site-packages/scipy_openblas32/include
    lib directory: /opt/_internal/cpython-3.11.9/lib/python3.11/site-packages/scipy_openblas32/lib
    name: scipy-openblas
    openblas configuration: OpenBLAS 0.3.27.dev DYNAMIC_ARCH NO_AFFINITY Zen MAX_THREADS=64
    pc file directory: /project
    version: 0.3.27.dev
  pybind11:
    detection method: config-tool
    include directory: unknown
    name: pybind11
    version: 2.12.0
Compilers:
  c:
    commands: cc
    linker: ld.bfd
    name: gcc
    version: 10.2.1
  c++:
    commands: c++
    linker: ld.bfd
    name: gcc
    version: 10.2.1
  cython:
    commands: cython
    linker: cython
    name: cython
    version: 3.0.11
  fortran:
    commands: gfortran
    linker: ld.bfd
    name: gcc
    version: 10.2.1
  pythran:
    include directory: ../../tmp/pip-build-env-k6xvzqr5/overlay/lib/python3.11/site-packages/pythran
    version: 0.16.1
Machine Information:
  build:
    cpu: x86_64
    endian: little
    family: x86_64
    system: linux
  cross-compiled: false
  host:
    cpu: x86_64
    endian: little
    family: x86_64
    system: linux
Python Information:
  path: /opt/python/cp311-cp311/bin/python
  version: '3.11'