dkirkby / bayesdesign

Utilities for Bayesian experiment design
MIT License
1 stars 0 forks source link

Add support for running examples via colab #6

Open dkirkby opened 1 week ago

dkirkby commented 1 week ago

I just discovered that colab can run notebooks that are hosted in a github repo, so this issue is to enable that for the notebooks in our examples folder.

As an example: https://colab.research.google.com/github/dkirkby/bayesdesign/blob/main/examples/SineWave.ipynb

It looks like the only modification required is to add a cell to install this package near the top:

% pip install bayesdesign

I believe this works in non-colab environments (but need to check this, at least for jupyter lab and vs-code) and does nothing if the most recent version of the package is already installed.

dkirkby commented 1 week ago

Perhaps a better pattern is:

try:
    import bed
except ImportError:
    %pip install bayesdesign

This avoids automatically updating to the latest version when running in a python env which already has an older version.