JohannesBuchner / BXA

Bayesian X-ray analysis (nested sampling for Xspec and Sherpa)
https://johannesbuchner.github.io/BXA/
GNU General Public License v3.0
57 stars 19 forks source link

JOSS review: installation #22

Closed grburgess closed 6 months ago

grburgess commented 3 years ago

Here are the issues with getting into a state of being able to run the python example_simplest.py

1) The main required dependency for the fitting, ultranest is not installed automatically either by pip or python setup.py install

2) The setup currently does not run on MacOS.

All of the following is run in a clean virtual environment on Ubuntu 20.04.2 with python 3.8 (no conda)

After completing the install for CIAO with the following steps:


bash ciao_install
pip install sherpa # (installs numpy)
python setup.py install # inside BXA folder cloned from GitHub

the following steps need to be run to avoid errors:


pip install ultranest

From this point I try to run python example_simplest.py

Result:

WARNING: imaging routines will not be available,
failed to import sherpa.image.ds9_backend due to
'RuntimeErr: DS9Win unusable: Could not find ds9 on your PATH'
WARNING: failed to import sherpa.astro.xspec; XSPEC models will not be available
read RMF file athenapp_ir_b4c_wfi_withfilter_fov40.0arcmin_avg.rsp
Traceback (most recent call last):
  File "example_simplest.py", line 20, in <module>
    set_model(xspowerlaw.mypow)
NameError: name 'xspowerlaw' is not defined

It would be useful to modify the following:

While it is not BXA should not be responsible for upkeep of XSPEC/Sherpa's installation procedures and capabilities, its focus as a plugin to these software means that it needs to perhaps guide the user thru the installation of its core functionality.

In regards to the software not installing on MacOS, this is again an issue of the core packages, but should be reflected in the caveats / platforms listed in the README and documentation. A few of these may be addressed with https://github.com/JohannesBuchner/BXA/issues/21

grburgess commented 3 years ago

linking https://github.com/openjournals/joss-reviews/issues/3045

grburgess commented 3 years ago

The XSPEC install works perfectly. However, there are a number of required packages that not installed with either the ultranest package or BXA. These include:

scipy astropy tqdm h5py

can these be added to the requirements so that the examples work out-of-the-box?

JohannesBuchner commented 3 years ago

After completing the install for CIAO with the following steps:

bash ciao_install
pip install sherpa # (installs numpy)
python setup.py install # inside BXA folder cloned from GitHub

You should not do pip install sherpa. ciao comes with sherpa and the xspec models. I suspect that the pip install overwrote something. Please follow the steps on https://cxc.cfa.harvard.edu/ciao/download/ciao_install.html

the following steps need to be run to avoid errors:

pip install ultranest

From this point I try to run python example_simplest.py

Result:

WARNING: imaging routines will not be available,
failed to import sherpa.image.ds9_backend due to
'RuntimeErr: DS9Win unusable: Could not find ds9 on your PATH'
WARNING: failed to import sherpa.astro.xspec; XSPEC models will not be available
read RMF file athenapp_ir_b4c_wfi_withfilter_fov40.0arcmin_avg.rsp
Traceback (most recent call last):
  File "example_simplest.py", line 20, in <module>
    set_model(xspowerlaw.mypow)
NameError: name 'xspowerlaw' is not defined

It would be useful to modify the following:

* [ ]  add all required dependencies to the install/setup script

done, and release 4.0.3 includes them.

* [ ]  include examples that work with Sherpa alone as it is the easiest entry point into testing the code.

done, modified example_simplest.py

* [ ]   as BXA is a plugin to the XSPEC/Sherpa analysis software, warning to the user upon installation that the environment does not detect the required essential dependencies  to run upon install.

added.

* [ ]  perhaps an end-to-end example in the documentation (including data) would be helpful.

solved in #20 now, available at https://github.com/JohannesBuchner/BXA/tree/master/examples/sherpa as README.

grburgess commented 3 years ago

setup.py is still missing SciPy. Other than that, XSPEC examples run out-of-box on linux

JohannesBuchner commented 3 years ago

BXA only requires scipy for some plotting niceties for xspec. However, sometimes scipy is difficult to install on servers, so I do not want to make it a formal requirement in setup.py.

I updated the doc to recommend the installation of scipy (here), and mention in the doc which functionality requires scipy (specifically here).

Let me know if there are any issues remaining here.

JohannesBuchner commented 3 years ago

You mentioned here the MacOS install attempt:

After completing the install for CIAO with the following steps:

bash ciao_install pip install sherpa # (installs numpy) python setup.py install # inside BXA folder cloned from GitHub

Please try again in a clean environment with:

bash ciao_install
source /path/to/soft/ciao-4.13/bin/ciao.bash
python3 setup.py install # inside BXA folder cloned from GitHub

(This is following https://cxc.cfa.harvard.edu/ciao/download/ciao_install.html)

JohannesBuchner commented 6 months ago

closing due to inactivity. Please reopen if this is still an issue.