dirac-institute / sorcha

An open-source community LSST Solar System Simulator
Other
18 stars 17 forks source link

Make SSPP Conda-installable #396

Closed drewoldag closed 1 year ago

drewoldag commented 1 year ago

We would like to be able to install sspp by running: conda install sspp

drewoldag commented 1 year ago

This work is likely related to #395.

drewoldag commented 1 year ago

https://github.com/marketplace/actions/publish-conda

drewoldag commented 1 year ago

https://stackoverflow.com/questions/66057481/continuous-integration-for-updating-the-conda-forge-feedstock

drewoldag commented 1 year ago

Pausing this work until after the renaming has been done to avoid a lot of duplicate effort.

drewoldag commented 1 year ago

Conda's instructions for publishing. https://conda-forge.org/docs/maintainer/adding_pkgs.html#step-by-step-instructions

Doesn't cover how to do this automatically via CI.

drewoldag commented 1 year ago

It does not seem that there is a convenient automated way to do what we need to do. This set of instructions is the most straightforward that I have seen so far.

https://conda-forge.org/#update_recipe

drewoldag commented 1 year ago

Some advice from Mario is that this tool may be what we need for conda-forge to automatically update based on PyPI or Github releases: https://conda-forge.org/docs/maintainer/updating_pkgs.html#pushing-to-regro-cf-autotick-bot-branch

drewoldag commented 1 year ago

Technically sorcha is now conda installable. However, it cannot be installed on an M1 mac due to a specific dependency being missing - synphot does not have a conda-forge distribution that supports the M1.

I created this issue to request that a new distribution be made available: https://github.com/spacetelescope/synphot_refactor/issues/358

Once we start to get a conversation going on the synphot front, we can reevaluate what the correct next steps are.

Other systems are supports, for instance, running on Epyc, a linux based server, I was able to conda install sorcha and call sorch --help to get the expected results.

All that being said, pip install sorcha works as expected.

mschwamb commented 1 year ago

That's great. Where are we using synphot? Or is that a dependency of some other package? I thought synphot coverts synthetic spectra to broad band photometry, and we're not doing that anywhere as far as I know.

drewoldag commented 1 year ago

Yeah, great question - synphot is used by sbpy. So it's a secondary dependency, as can be seen here: https://github.com/NASA-Planetary-Science/sbpy/blob/main/setup.cfg#L35

pllim commented 1 year ago

Re: sbpy -- Hmm maybe also raise issue there to not list optional dependency in "install_requires". I don't think it needs synphot to function per se.

fedorets commented 1 year ago

I recently ran across synphot in the validation notebook for calculating cometary magnitudes. To my memory, it is not used anywhere in the 'main' code.

pllim commented 1 year ago

If you still need synphot on conda M1, feel free to PR to its conda recipe. I posted link to recipe repo and instructions on https://github.com/spacetelescope/synphot_refactor/issues/358 . Since no one at STScI has ever asked for this, it is low on my own priority list. Thank you for your understanding.

mschwamb commented 1 year ago

Question, I have an Apple M2 mac and I just installed sbpy no problem through conda. So is there a reason why that's working and our setup isn't? Synphot was installed

pllim commented 1 year ago

Hmm! What versions of sbpy and synphot are M1 and M2 pulling in?

pllim commented 1 year ago

On the same Python versions?

mschwamb commented 1 year ago

packages in environment at /Users/mschwamb/opt/anaconda3/envs/sorcha:

#

Name Version Build Channel

ads 0.12.3 py_2 conda-forge aom 3.5.0 hf0c8a7f_0 conda-forge asdf 2.15.0 pyhd8ed1ab_0 conda-forge asdf-astropy 0.4.0 pyhd8ed1ab_1 conda-forge asdf-coordinates-schemas 0.2.0 pyhd8ed1ab_1 conda-forge asdf-standard 1.0.3 pyhd8ed1ab_0 conda-forge asdf-transform-schemas 0.3.0 pyhd8ed1ab_0 conda-forge asdf-unit-schemas 0.1.0 pyhd8ed1ab_0 conda-forge asdf-wcs-schemas 0.1.1 pyhd8ed1ab_0 conda-forge astropy 5.3.1 py310hc1335a1_0 conda-forge astroquery 0.4.6 pyhd8ed1ab_0 conda-forge attrs 23.1.0 pyh71513ae_1 conda-forge backports.zoneinfo 0.2.1 py310h2ec42d9_7 conda-forge beautifulsoup4 4.12.2 pyha770c72_0 conda-forge blosc 1.21.4 heccf04b_0 conda-forge bottleneck 1.3.7 py310h936d966_0 conda-forge brotli 1.0.9 hb7f2c08_9 conda-forge brotli-bin 1.0.9 hb7f2c08_9 conda-forge brotli-python 1.0.9 py310h7a76584_9 conda-forge brunsli 0.1 h046ec9c_0 conda-forge bzip2 1.0.8 h0d85af4_4 conda-forge c-ares 1.19.1 h0dc2134_0 conda-forge c-blosc2 2.10.0 h0dcb076_0 conda-forge ca-certificates 2023.7.22 h8857fd0_0 conda-forge certifi 2023.7.22 pyhd8ed1ab_0 conda-forge cfitsio 4.2.0 hd56cc12_0 conda-forge charls 2.4.2 he965462_0 conda-forge charset-normalizer 3.2.0 pyhd8ed1ab_0 conda-forge click 8.1.6 unix_pyh707e725_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge contourpy 1.1.0 py310h88cfcbd_0 conda-forge coverage 7.2.7 py310h6729b98_0 conda-forge cycler 0.11.0 pyhd8ed1ab_0 conda-forge dav1d 1.2.1 h0dc2134_0 conda-forge exceptiongroup 1.1.2 pyhd8ed1ab_0 conda-forge fonttools 4.41.1 py310h6729b98_0 conda-forge freetype 2.12.1 h3f81eb7_1 conda-forge giflib 5.2.1 hb7f2c08_3 conda-forge ginga 4.1.0 pyhd8ed1ab_0 conda-forge gwcs 0.18.3 pyhd8ed1ab_0 conda-forge html5lib 1.1 pyh9f0ad1d_0 conda-forge hypothesis 6.82.0 pyha770c72_0 conda-forge idna 3.4 pyhd8ed1ab_0 conda-forge imagecodecs 2023.7.10 py310hb6b3c85_0 conda-forge imageio 2.31.1 pyh24c5eb1_0 conda-forge importlib-metadata 6.8.0 pyha770c72_0 conda-forge importlib-resources 6.0.0 pyhd8ed1ab_1 conda-forge importlib_metadata 6.8.0 hd8ed1ab_0 conda-forge importlib_resources 6.0.0 pyhd8ed1ab_1 conda-forge iniconfig 2.0.0 pyhd8ed1ab_0 conda-forge jaraco.classes 3.3.0 pyhd8ed1ab_0 conda-forge jmespath 1.0.1 pyhd8ed1ab_0 conda-forge joblib 1.3.0 pyhd8ed1ab_1 conda-forge jsonschema 4.17.3 pyhd8ed1ab_0 conda-forge jxrlib 1.1 h35c211d_2 conda-forge keyring 24.2.0 py310h2ec42d9_0 conda-forge kiwisolver 1.4.4 py310ha23aa8a_1 conda-forge krb5 1.21.1 hb884880_0 conda-forge lazy_loader 0.2 pyhd8ed1ab_0 conda-forge lcms2 2.15 h2dcdeff_1 conda-forge lerc 4.0.0 hb486fe8_0 conda-forge libaec 1.0.6 hf0c8a7f_1 conda-forge libavif 0.11.1 h22361c6_2 conda-forge libblas 3.9.0 17_osx64_openblas conda-forge libbrotlicommon 1.0.9 hb7f2c08_9 conda-forge libbrotlidec 1.0.9 hb7f2c08_9 conda-forge libbrotlienc 1.0.9 hb7f2c08_9 conda-forge libcblas 3.9.0 17_osx64_openblas conda-forge libcurl 8.2.0 h5f667d7_0 conda-forge libcxx 16.0.6 hd57cbcb_0 conda-forge libdeflate 1.18 hac1461d_0 conda-forge libedit 3.1.20191231 h0678c8f_2 conda-forge libev 4.33 haf1e3a3_1 conda-forge libffi 3.4.2 h0d85af4_5 conda-forge libgfortran 5.0.0 12_3_0_h97931a8_1 conda-forge libgfortran5 12.3.0 hbd3c1fe_1 conda-forge libjpeg-turbo 2.1.5.1 hb7f2c08_0 conda-forge liblapack 3.9.0 17_osx64_openblas conda-forge libnghttp2 1.52.0 he2ab024_0 conda-forge libopenblas 0.3.23 openmp_h429af6e_0 conda-forge libpng 1.6.39 ha978bb4_0 conda-forge libsqlite 3.42.0 h58db7d2_0 conda-forge libssh2 1.11.0 hd019ec5_0 conda-forge libtiff 4.5.1 hf955e92_0 conda-forge libwebp-base 1.3.1 h0dc2134_0 conda-forge libxcb 1.15 hb7f2c08_0 conda-forge libzlib 1.2.13 h8a1eda9_5 conda-forge libzopfli 1.0.3 h046ec9c_0 conda-forge llvm-openmp 16.0.6 hff08bdf_0 conda-forge lz4-c 1.9.4 hf0c8a7f_0 conda-forge markupsafe 2.1.3 py310h6729b98_0 conda-forge matplotlib-base 3.7.2 py310h475a17b_0 conda-forge mock 5.1.0 pyhd8ed1ab_0 conda-forge more-itertools 10.0.0 pyhd8ed1ab_0 conda-forge munkres 1.1.4 pyh9f0ad1d_0 conda-forge ncurses 6.4 hf0c8a7f_0 conda-forge networkx 3.1 pyhd8ed1ab_0 conda-forge numpy 1.25.1 py310h7451ae0_0 conda-forge openjpeg 2.5.0 h13ac156_2 conda-forge openssl 3.1.1 h8a1eda9_1 conda-forge packaging 23.1 pyhd8ed1ab_0 conda-forge photutils 1.8.0 py310hc1335a1_0 conda-forge pillow 10.0.0 py310hd63a8c7_0 conda-forge pip 23.2.1 pyhd8ed1ab_0 conda-forge pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge platformdirs 3.9.1 pyhd8ed1ab_0 conda-forge pluggy 1.2.0 pyhd8ed1ab_0 conda-forge pooch 1.7.0 pyha770c72_3 conda-forge psutil 5.9.5 py310h90acd4f_0 conda-forge pthread-stubs 0.4 hc929b4f_1001 conda-forge pyerfa 2.0.0.3 py310h936d966_0 conda-forge pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge pyrsistent 0.19.3 py310h90acd4f_0 conda-forge pysocks 1.7.1 pyha2e5f31_6 conda-forge pytest 7.4.0 pyhd8ed1ab_0 conda-forge pytest-arraydiff 0.5.0 pyhd8ed1ab_0 conda-forge pytest-astropy 0.10.0 pyhd8ed1ab_0 conda-forge pytest-astropy-header 0.2.2 pyhd8ed1ab_0 conda-forge pytest-cov 4.1.0 pyhd8ed1ab_0 conda-forge pytest-doctestplus 0.13.0 pyhd8ed1ab_0 conda-forge pytest-filter-subpackage 0.1.1 py_0 conda-forge pytest-mock 3.11.1 pyhd8ed1ab_0 conda-forge pytest-openfiles 0.5.0 py_0 conda-forge pytest-remotedata 0.4.0 pyhd8ed1ab_0 conda-forge python 3.10.12 had23ca6_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python_abi 3.10 3_cp310 conda-forge pyvo 1.4.1 pyhd8ed1ab_0 conda-forge pywavelets 1.4.1 py310h936d966_0 conda-forge pyyaml 6.0 py310h90acd4f_5 conda-forge qtpy 2.3.1 pyhd8ed1ab_0 conda-forge readline 8.2 h9e318b2_1 conda-forge requests 2.31.0 pyhd8ed1ab_0 conda-forge sbpy 0.3.0 pyhd8ed1ab_0 conda-forge scikit-image 0.21.0 py310h9e9d8ca_0 conda-forge scikit-learn 1.3.0 py310hd2c063c_0 conda-forge scipy 1.11.1 py310h3900cf1_0 conda-forge semantic_version 2.10.0 pyhd8ed1ab_0 conda-forge setuptools 68.0.0 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 h225ccf5_0 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge synphot 1.2.1 py310hc1335a1_0 conda-forge threadpoolctl 3.2.0 pyha21a80b_0 conda-forge tifffile 2023.7.18 pyhd8ed1ab_0 conda-forge tk 8.6.12 h5dbffcc_0 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge typing-extensions 4.7.1 hd8ed1ab_0 conda-forge typing_extensions 4.7.1 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge unicodedata2 15.0.0 py310h90acd4f_0 conda-forge urllib3 2.0.4 pyhd8ed1ab_0 conda-forge webencodings 0.5.1 py_1 conda-forge werkzeug 2.3.6 pyhd8ed1ab_0 conda-forge wheel 0.41.0 pyhd8ed1ab_0 conda-forge xorg-libxau 1.0.11 h0dc2134_0 conda-forge xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge xz 5.2.6 h775f41a_0 conda-forge yaml 0.2.5 h0d85af4_2 conda-forge zfp 1.0.0 ha894c9a_3 conda-forge zipp 3.16.2 pyhd8ed1ab_0 conda-forge zlib-ng 2.0.7 hb7f2c08_0 conda-forge zstd 1.5.2 h829000d_7 conda-forge

mschwamb commented 1 year ago

dumping everything from a clean install of python 3.10 with no other packages than basics and installing from conda-forge sbpy above. Here's the relevant bits

sbpy 0.3.0 pyhd8ed1ab_0 conda-forge synphot 1.2.1 py310hc1335a1_0 conda-forge

python 3.10

Note: Apple M2 chip in this machine.

drewoldag commented 1 year ago

I opened this issue just on the off chance that synphot is truly an optional dependency: https://github.com/NASA-Planetary-Science/sbpy/issues/382, we'll see.

I'm WFH today on a WSL system, so I can't provide any additional context here about my M1 env. setup. I do recall that I created a new environment with conda, and attempted to install sbpy, and it failed when trying to find synphot on conda-forge. I'll try again when I'm in front of that computer again.

mschwamb commented 1 year ago

Moving to August visit since I've learned that assist right now isn't yet conda installable and we're going to be relying on that software package

drewoldag commented 1 year ago

Got a message from synphot maintainer indicating that it should now be conda installable on M1. I confirmed the required files are available on conda-forge, but I haven't actually installed it on a M1 to confirm.

I left a comment on the sbpy issue (here: https://github.com/NASA-Planetary-Science/sbpy/issues/382) saying the same thing, and suggesting that perhaps the work to separate synphot from sbpy might not be worth the effort at this point.

drewoldag commented 1 year ago

Verified that M1 mac install works as expected. Closing this issue now.