ziatdinovmax / gpax

Gaussian Processes for Experimental Sciences
http://gpax.rtfd.io
MIT License
205 stars 27 forks source link

Google Colab giving version control error. #104

Closed utkarshp1161 closed 6 months ago

utkarshp1161 commented 6 months ago
image

Gives above error if using: pip install git+https://github.com/ziatdinovmax/gpax

below works: pip install gpax

ziatdinovmax commented 6 months ago

cc: @matthewcarbone

matthewcarbone commented 6 months ago

@ziatdinovmax I think I can solve this with another try/except. Can you post the full error? I think I know what the issue is.

That said I think we should urge people not to install via git+https://github.com/ziatdinovmax/gpax. (I am very happy to see that my "novel" build procedure works though! 😁).

utkarshp1161 commented 6 months ago

I think problem is in (https://github.com/ziatdinovmax/gpax/blob/main/gpax/_version.py)

Except block with RuntimeError should fix this

/usr/local/lib/python3.10/dist-packages/gpax/init.py in 1 from . import acquisition, kernels, priors, utils ----> 2 from ._version import version 3 from .hypo import sample_next 4 from .models import ( 5 BNN,

/usr/local/lib/python3.10/dist-packages/gpax/_version.py in 5 import dunamai as _dunamai 6 ----> 7 version = _dunamai.Version.from_any_vcs().serialize() 8 del _dunamai

matthewcarbone commented 6 months ago

@utkarshp1161 apologies I didn't even realize in my initial response it wasn't Maxim who raised this issue or I would've responded to you! Anyway this should be fixed in #105.

utkarshp1161 commented 6 months ago

No problem. Thanks a lot. Our group uses gpax all the time in colab and they happen to build it from main branch in most of their notebooks.

matthewcarbone commented 6 months ago

@utkarshp1161 Sounds good! Just a quick bit of feedback: I would strongly recommend against pip installing from main. Unless you know exactly what's on the main branch you should use pip install gpax. This downloads a tested distribution from PyPI and is generally going to be much more stable. As you can see bugs can get introduced in to the main branch, but deployments don't happen until everything passes the tests!

The great irony is that the PR's that introduced this new bug were meant to make this deployment procedure more robust 😁

utkarshp1161 commented 6 months ago

I see. Makes complete sense. I will pass it on to the group members.

matthewcarbone commented 6 months ago

@utkarshp1161 should also wait for @ziatdinovmax's opinion, as it's his code, but in terms of best development practices you can't go wrong with installing from PyPI 👍

I've opened a PR with updated installation instructions and we'll wait for Maxim to comment!

ziatdinovmax commented 6 months ago

@utkarshp1161 thanks for identifying this issue and thanks @matthewcarbone for promptly fixing it! PS. Yes, it is better to install a stable version from PyPI. The installation from source was a leftover from the early days when there were only a few people using the code and I was integrating changes into master branch in real time based on their feedback.