Add google colaboratory badge to main README.md
Closed this issue · 5 comments
Main goal
This is a relatively easy task on my TODO list for a while now. Basically I'd like to make the jupyter notebooks in this github repository more readily accessible to others without having to spend too much time installing all the dependencies.
Technically, there is a "Launch in Binder" badge on the main README.md that looks like (as of #91) but it can be a bit slow to load ...
A similar alternative is an "Open in Colab" badge, which allows people with a google account to open launch one of the public jupyter notebooks here directly on Google's servers. What I'd like is a badge that like next to the current Binder badge.
The markdown code to insert into the README.md file will look something like this:
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/weiji14/deepbedmap/]
References:
Stretch goals
If you're really keen, I also need to make sure that the python libraries can actually run in Google Colaboratory! This is slightly more complicated, and will involve adapting the conda/pipenv installation instructions for Colaboratory. You'll need to add a jupyter notebook cell to the top of the data_prep.ipynb or srgan_train.ipynb notebooks and include the installation code.
One way to do it is to mimic what Chainer does in this repository, which is to use an install script:
!curl https://colab.chainer.org/install | sh -
Note that Google Colaboratory doesn't come with conda
, so the GMT and CUDA binaries might be hard to install. You might only need to worry about GMT though, since CUDA should already on the servers.
Pip
will be available in Google Colab, but there is no pipenv
. You could maybe try running in a cell:
!pip install pipenv==2018.11.26
and then have pipenv
install the libraries from the Pipfile/Pipfile.lock file. Alternatively, have it create a requirements.txt file and use pip
to install the python libraries.
Update:
With #105 IPython 7.3.0 merged in, it might be easier to install some pip and conda dependencies with the new %pip
and %conda
magics. You'll need to have a look at the documentation, see ipython/ipython#11524.
References:
- https://pipenv.readthedocs.io/en/latest/advanced/
- https://chainer-colab-notebook.readthedocs.io/en/latest/
How do I start?
Create a fork of this repository (click on fork button on the top right), and make the relevant changes to the README.md. Feel free to leave a comment below saying you're tackling this. Mention what works and/or what doesn't, and I'll try to help you out. Once you're done, submit a pull request and I'll review it and merge it into the project!
References:
@weiji14 Hi I have added an open in collab badge in the readme file. For now, I am pointing it to data_prep.ipynb. Can u tell me to which other files you need this badge?
Or we can add the badge in the notebook itself on top.
Hi @gshanbhag525, is it possible to point one badge to several files? How about you submit a Pull Request and I'll take a closer look 😄
@weiji14 For multiple files we can do like this.
Once user clicks on Open in Collab it will show a dialog where all the notebooks present in your repo will be shown.
so shall I add this one or Only one file i.e deepbedmap one in the PR?
Just this one will do. And make sure it's linked to the upstream repository.