luigibonati / mlcolvar

A unified framework for machine learning collective variables for enhanced sampling simulations
MIT License
91 stars 24 forks source link

Colab interface for notebooks #71

Closed EnricoTrizio closed 1 year ago

EnricoTrizio commented 1 year ago

Description

Add the possibility to open the notebooks in Colab. Adds:

If os detects that we are in colab it downloads and runs the colab_setup.sh

Questions

TODO

Status

codecov[bot] commented 1 year ago

Codecov Report

Merging #71 (47869d5) into main (3f8f644) will not change coverage. The diff coverage is n/a.

luigibonati commented 1 year ago

nice! just a couple of minor things:

EnricoTrizio commented 1 year ago

nice! just a couple of minor things:

  • I would replace: chmod +x ./colab_setup.sh && ./colab_setup.sh with just bash colab_setup.sh

Yep I'll do that

  • can we make it slightly more verbose? i see in the colab_setup.sh file there are echos but they are not displayed

With subprocess you can store the output and print everything at the only for what I've seen, which is pretty useless.. It would be something like

result = subprocess.run('bash ./colab_setup.sh', shell=True, stdout=subprocess.PIPE)
print(result.stdout.decode('utf-8'))

Otherwise we can use !cmd syntax and it prints everything as from terminal