mind-inria / hidimstat

HiDimStat: High-dimensional statistical inference tool for Python
https://mind-inria.github.io/hidimstat
BSD 2-Clause "Simplified" License
4 stars 4 forks source link

Adding more detailed requirements.txt to the installation process #21

Open tbng opened 1 month ago

tbng commented 1 month ago

There is also an important missing requirement on Pytorch with the MLPs modules in utils.py. Pytorch installation is not the most straightforward with additional dependency on CUDA version (that also needs elaboration).

bthirion commented 1 month ago

Would you mind opening a PR ?

jpaillard commented 1 month ago

For me this is related to #18 I would suggest to keep the Dnn learner in a separate module with additional requirements to avoid the dependency of hidimstat on Pytorch

bthirion commented 1 month ago

I'm not a big fan of having code disseminated on several packages. I'd rather have auxiliary code for learners on a dedicated submodule.

tbng commented 1 month ago

After checking a bit I got the package installed with

pip install -U git+https://github.com/mind-inria/hidimstat.git

without the requirements.txt as there are already torch requirements in pyproject.toml; this only works with python 3.12 but not 3.13 though. I think it will be less of a hassle to edit the README.md to remove dependencies section than adding requirements.txt which needs updating for every new version. One thing to keep in mind is that Pytorch nowadays is very heavy to download and install so indeed @jpaillard offered a good proposal :+1:

Beside that, using

pip install hidimstat

installed version 0.1.0 instead and therefore did not cover torch installation.

tbng commented 1 month ago

I'm not a big fan of having code disseminated on several packages. I'd rather have auxiliary code for learners on a dedicated submodule.

It seems adding additional requirements for submodule is also possible so I am in favor of Bertrand's solution: https://stackoverflow.com/questions/56959413/how-to-resolve-dependencies-of-python-git-submodule (I suspect it can be done inside pyproject.toml)

jpaillard commented 1 month ago

Indeed, it seems we can use the [project.optional-dependencies] (https://github.com/mind-inria/hidimstat/blob/fe4836fa2e2b501b46455cc9d1d0695a849662dd/pyproject.toml#L36). Maybe a "learners" group of dependencies could be added.

bthirion commented 1 month ago

I'm wondering why pip install hidimstat gets the old version ?

tbng commented 1 month ago

I'm wondering why pip install hidimstat gets the old version ?

I tried to check and this is only the case if python version is not 3.12 -- pip will install hidimstat 0.1.0. I think it is safer to recheck it in a different computer as well, for example running

conda create -n hidimstat310 python=3.10
conda activate hidimstat310
pip install hidimstat
bthirion commented 1 month ago

Indeed it get hidimstat 0.1.0

tbng commented 1 month ago

I think this is because in pyproject.toml the requirement for python is 3.12 or newer, so with older python the pypi installation reverts to older version

https://github.com/mind-inria/hidimstat/blob/383b08f8eb7a647aa4c7030f9375f3ee1d453369/pyproject.toml#L17