Awesome
Alfalfa Notebooks
The Alfalfa Notebooks repository is a collection of introductory jupyter notebooks for how to interact with an Alfalfa instance via the alfalfa-client python library.
Setup
- Download this repository and save it to a folder on your computer.
- Install poetry.
- Open your command line interface and navigate to this folder.
- Run
poetry install
(this project requires python 3.7+ to run) - Run
poetry run jupyter lab
to launch JupyterLab or interact with notebooks in an editor (ex: VSCode) that supports Jupyter Notebooks natively. - In the browser window with jupyter lab in it select the
twobldgs.ipnb
or thesimple_run.ipynb
file. - If you are running the alfalfa server locally no changes are required. If not, change the the
host
in the second cell ('http://localhost' by default) to the url of your alfalfa server. (Trailing slashes in the URL can lead to errors. This will be fixed in the future but as of now it is still a bug) - You can now run the contents of the notebook. (Note: the
twobldgs.ipynb
notebook runs two models simulaneously, this means your Alfalfa server will need at least two workers)
Installation Troubleshooting
Poetry is not using the correct version of Python
- Run
poetry env list
to list the current environments poetry has created - If there is one with the incorrect version of python run
poetry env remove {environment name}
- Run
poetry env use 3.8
(replace 3.8 with whatever version of python 3.7 or higher you would like to use) - If that fails you may need to make sure that you have that version of python installed and if using pyenv make sure it is configured correctly.
- Run
poetry install
hopefully with no problems this time