robelgeda / peytonites2024

Repository for the Princeton Astrophysical team at NVIDIA + Princeton Open Hackathon
https://peytonites2024.readthedocs.io/en/latest/index.html
MIT License
1 stars 1 forks source link

Non-hatch version for user simplicity #16

Open SampsonML opened 1 month ago

SampsonML commented 1 month ago

I have made a branch using conda, mainly for jax-gpu development on jaxGPU with setup instructions in the readme of the branch

henryiii commented 1 month ago

For conda, I'd highly recommend trying out pixi. It's lightning fast, supports locking, scripts, pyproject.toml, etc.

henryiii commented 1 month ago

Also, you do not need to revert the build system to try something else. hatchling is not tied to hatch. I'm not sure how about 5 files is simpler than 1...

henryiii commented 1 month ago

What is this: https://github.com/robelgeda/peytonites2024/blob/c52db7ea8b4d4d0c8731a7a423989f1e0b7204aa/setup.py#L12 ? You don't declare a build time dependency so where is it coming from?

henryiii commented 1 month ago

And the recommended way to install Jax is with jax[cuda12] from PyPI, which you can do in hatch. https://jax.readthedocs.io/en/latest/installation.html

SampsonML commented 1 month ago

I am installing jax that exact way when setting up the conda environment

henryiii commented 1 month ago

You should not be pip installing binary packages into a conda environment.

SampsonML commented 1 month ago

This is done for ease, as the vast majority of our team has experience using conda only. As this is a short term project so I do not see any breaking changes causing issues by mixing pip and conda for this project. I agree normally this is not ideal though

henryiii commented 1 month ago

Just tested https://github.com/robelgeda/peytonites2024/pull/17, that seems to work. It's fewer commands (your commands have a typo, by the way, pip install -e doesn't work without an argument for the -e) and much, much faster to setup, under 10 seconds.

henryiii commented 1 month ago

Also, you don't need to re-add MANIFEST.in and setup.cfg and setup.py and delete the pyproject.toml. pip install -e. works fine with hatchling.

SampsonML commented 1 month ago

Oops yes pip install -e . Changed

robelgeda commented 1 month ago

I agree with Matt about people being more familiar with conda environments. I think we should keep the new conda branch for the hack day. I also think we should keep the hatch in main for this hack week because people will be mainly working on the one function in main.py. When we start making the actual package, which is likely not going to be in this repo, we can have conversations about conda vs hatch vs pixi vs tox vs something else using uv. I think next week will inform our discussion, and I am curious to see how people interact with the hatch branch.

henryiii commented 1 month ago

I'm really interested as well. The one thing I don't want to have happen is to have people revert everything I've done without trying it and saying "it's always been done this way, the old way with 5 files, each in a different language (Python, YAML, txt, MANIFEST.in, and .cfg), conda environments with 4 channels that just then dump dozens of pip packages in a requirements.txt in, is simpler." I'd love real feedback about what works, what doesn't, what could be better, etc. Even a "I tried it, here's the five problems I had, now I'm going back" would be much better.

Also, you can conda and pip install hatch.

SampsonML commented 1 month ago

The simplicity is for the users, i.e our group members. After the setup which is sorted everyone can just conda activate the environment and use python exactly as they always have. This is the part I am referring to being simpler. The hatch version is still on the main branch this is made for those who prefer to conda use.

henryiii commented 1 month ago

Okay, if that's the issue, what about #18, which allows classic conda setups? Haven't tested it yet, but should work in theory.

Also, your README still says python install -e . instead of pip install -e..

SampsonML commented 1 month ago

Sorted the readme then. People are free to use whichever branch they like, I made this as people were wanting a workable conda version to use.

SampsonML commented 1 month ago

I do not really see what the issue is of coming up with a workable solution, that the group is all familiar with so no one is confused by new tools for what is really a 2 day event.

henryiii commented 1 month ago

There’s nothing wrong with an alternative branch, I am just trying to figure out what the problem is so that I can try to address it in the main branch as well, so people have a high chance of using that. We are still in the set up phase before the event, so it’s exactly the time to try to do things like this.