rzellem / EXOTIC

EXOplanet Transit Interpretation Code
Other
84 stars 45 forks source link

Astral uv as a package installer and resolver #1268

Open ivenzor opened 1 month ago

ivenzor commented 1 month ago

Astral uv (https://github.com/astral-sh/uv) is a new Rust-based package installer and resolver. It's intended as a replacement for pip and/or conda install. In my testing, I was able to locally install EXOTIC and all its dependencies using uv instead of pip on a Windows machine, it's faster and easier than pip install. I will continue to conduct more tests, including macOS.

ivenzor commented 1 month ago

It works on MacOS too. I have updated EW Observer Manual with the local installation instructions for Mac and Windows.

ivenzor commented 1 month ago

It works in the Colab EXOTIC notebook too. I modified Jeff’s latest notebook to work with uv instead of pip install. The time savings in the first cell of the notebook are about 30 seconds to 1 minute. The code in that cell is also arguably simpler. I will do further testing when the new version of EXOTIC (4.0?) is released.

jpl-jengelke commented 1 month ago

Does this require installation of the Rust package locally?

ivenzor commented 1 month ago

uv does not require Rust or Python, but it will use an existing Python installation if there is one. It can be installed with curl, powershell, brew, pip or pipx. Once installed it would requiere a virtual env, it could use an existing one or it can create one itself.

For example, in Google Colab, we can use the existing Python installation and build upon that:

!pip install uv
!uv venv exotic_env --python 3.10
!source /content/exotic_env/bin/activate
!uv pip install "git+https://github.com/rzellem/EXOTIC"