picaso icon indicating copy to clipboard operation
picaso copied to clipboard

5/9 Hackday: Simplify and Clarify PICASO installation docs

Open natashabatalha opened this issue 11 months ago • 11 comments

@rewaclarkbush

  • [x] Update python version suggestion
  • [x] Create designated "default" opacity file on zenodo that is 15k R with all the relevant molecules
  • [x] Update installation page to include creating conda environment before git setup
  • [x] Make a step that is "create default opacity" and have it just involve sticking the file into the folder (change code to auto detect a sqlite opacities database in the opacities folder (different from the continuum one)
  • [x] add instructions for creating a forked repository
  • [x] create a function to get the stellar docs
  • [x] make a suggestion for where to put stellar grid folder
  • [x] make the PYSYN_CDBS environment variables also go into the env_vars folder
  • [x] trapz issue with scipy make sure you have scipy not 1.15.1 (check where we are using trapz)

natashabatalha avatar Jan 23 '25 19:01 natashabatalha

Note the trapz issue is with PyMieScatt, not picaso so will have to wait on resolving that. Their code is fixed but not released on PyPI:

https://github.com/bsumlin/PyMieScatt/pull/26

natashabatalha avatar Feb 12 '25 22:02 natashabatalha

In the meantime, deprecating SciPy to version 1.13.1 gets around the trapz issue.

rewaclarkbush avatar Mar 07 '25 20:03 rewaclarkbush

  • [x] Issue with N.alltrue(sorted == wave) on line 233 in validate_wavetable in pysynphot/spectrum.py.

np.alltrue was removed in the NumPy 2.0 release. One fix could be to change instances of np.alltrue to np.all. Alternatively, you can deprecate NumPy to 1.26.3.

rewaclarkbush avatar Mar 07 '25 20:03 rewaclarkbush

Need to install dependencies: arviz=0.18 (this version is needed for compatibility with scipy=1.13), dynesty, ultranest.

rewaclarkbush avatar Mar 10 '25 18:03 rewaclarkbush

  • [x] Issue with N.alltrue(sorted == wave) on line 233 in validate_wavetable in pysynphot/spectrum.py.

np.alltrue was removed in the NumPy 2.0 release. One fix could be to change instances of np.alltrue to np.all. Alternatively, you can deprecate NumPy to 1.26.3.

Fixed with deprecation of PYSYNPHOT commit 9f1f2eba1cfb2117f3b894e84126e0561ada4eac

natashabatalha avatar Apr 17 '25 19:04 natashabatalha

I had the following three issues while installing. my conda env Python is 3.10.13 netcdf4 -- version 1.7.3 fixed pysynphot -- version 2.0.0 fixed photutils -- version 2.0.2 fixed Also, we need some sort of instruction to install photochem as well.

sagnickm avatar May 09 '25 16:05 sagnickm

Natasha made this new notebook for helping grab data: https://github.com/natashabatalha/picaso/blob/dev/docs/notebooks/0_GetDataFunctions.ipynb

One thing that is missing is an ability to easily install the "reference" data. I think the reference could be incorporated directly in the picaso package, or it could be made a separate package that picaso depends on (this is how photochem does it: https://anaconda.org/conda-forge/photochem_clima_data).

Nicholaswogan avatar May 09 '25 16:05 Nicholaswogan

Image

We could have the reference data have folders that are empty. Then the get_data function would check what you have in these folders and direct people to get what they need.

natashabatalha avatar May 09 '25 18:05 natashabatalha

One thing that is missing is an ability to easily install the "reference" data. I think the reference could be incorporated directly in the picaso package, or it could be made a separate package that picaso depends on (this is how photochem does it: https://anaconda.org/conda-forge/photochem_clima_data).

This is an interesting suggestions but I am hesitant to have the reference data embedded within the package library data because there are different mix and matches of data that people can grab. For example, stellar data shouldn't be auto included in package data because a BD person does not need it. So, they should always know where their package data is. If you install a separate package then I think you would have the same problem. Does the photochem package data never have to be touched?

natashabatalha avatar May 09 '25 18:05 natashabatalha

I tried running the new photochemistry.ipynb notebook and ran into some issues with installing photochem. When I followed the notebook directions for installing photochem it updated numpy to be incompatible with other features of PICASO that utilize np.alltrue in them. np.alltrue was removed after numpy 2.0.0. The error message suggested using np.all instead. The issue can also be bypassed by uninstalling numpy after installing photochem and then installing it to a version before 2.0.0. I use numpy version 1.26.4. Maybe we should look into how to pair photochem and PICASO better??

benjaminliberles avatar May 09 '25 21:05 benjaminliberles

Regarding reference data: I have recently discovered the pooch package for accessing data as it's needed: https://www.fatiando.org/pooch/latest/

I decided to use the default cache location determined by the users OS.

And I put all the data on Amazon AWS as publicly viewable.

Only hang up is if the user tries to do something new when they don't have good internet. My plan is to eventually make a function that downloads all external data for various modes in case someone wanted to prep for being offline.

kelle avatar May 09 '25 21:05 kelle

Wanted to add a to-do for this issue. Picaso is now available on conda-forge (https://anaconda.org/conda-forge/picaso) and can be installed with conda install conda-forge::picaso. This install option should be added to the docs. Also, I think it makes sense to make this the preferred installation route. It will prevent downstream environment/install issues like the one @benjaminliberles described with photochem that happen when you mix pip and conda.

  • [x] Add conda install instructions to Picaso docs.

Nicholaswogan avatar May 12 '25 21:05 Nicholaswogan

I have updated the installation docs to incorporate these new changes and the new get data function and the conda instructions

natashabatalha avatar Aug 06 '25 18:08 natashabatalha