Code Monkey home page Code Monkey logo

espin2021-lab's Introduction

Binder Test notebooks

Python Array and Visualization Libraries: Beyond Numpy and Matplotlib (ESPIn 2021)

This repository contains a collection of Jupyter notebooks for the ESPIn-2021 "Python Array and Visualization Libraries: Beyond Numpy and Matplotlib" lecture/lab.

How to run the notebooks?

Run in the cloud (Binder)

You can run the notebooks in your browser without installing anything thanks to binder. Just follow the link below or click on the "launch binder" badge above and it will launch remotely a new notebook server for you:

This service is for demo purpose only, do not rely on it for doing more serious work.

Install and run locally (Docker)

Docker images are built automatically for this repository. Those images provide the whole computing environment, pre-installed and pre-configured for running the notebooks. The only requirement is to have Docker installed on your machine. It is available on all platforms Linux/Windows/Mac and it can be installed from the Docker website or using one of your platform's package managers.

Run the command below in a terminal to first pull the latest image (note: the Docker application must be running, you might need to launch it first):

$ docker pull fastscape/espin2021-lab:latest

Then run the command below to start the Jupyterlab application from the Docker container. Replace espin2021-lab by any other name you want to give to your local container (optional). Also Replace /path/to/local-notebook-folder by the full path to the directory on your machine where you want to create/copy, edit and permanently store notebooks for this training course.

$ docker run \
    -it \
    --name espin2021-lab \
    -p 8888:8888 \
    -v /path/to/local-notebook-folder:/home/jovyan/my-local-folder \
    fastscape/espin2021-lab \
    jupyter lab --ip 0.0.0.0

You can then enter in your browser the url and token provided to start using the Jupyterlab application.

You may want to copy the notebooks folder in your local working folder mounted in the docker container as my-local-folder. Open a terminal in Jupyterlab and run the following command:

$ cp -R notebooks my-local-folder/

When you are done you can stop and remove the container:

$ docker stop espin2021-lab
$ docker rm espin2021-lab

Troubleshooting

The url I entered in my browser doesn't point to Jupyterlab

You may already have another application running on localhost using the port 8888. Try another port when running the docker run command above, e.g., using -p 8889:8888. You also need to change the port in the entered url accordingly (e.g., localhost:8889).

The url I entered in my browser gives a page asking for a token

Copy and paste the token given in the url. If the token is invalid, you may have another Jupyterlab application already running on your machine. Try using another port as described above.

Check Docker's documentation for additional command line help and options.

Install and run locally (Conda)

Assuming that you have git and conda installed, you can install all the packages required to run the notebooks in a new conda environment using the following commands:

$ git clone https://github.com/benbovy/espin2021-lab
$ cd espin2021-lab
$ conda env create -f environment.yml
$ conda activate espin2021-lab

Note: you could use mamba instead of conda. mamba is a faster alternative to conda.

Finally run the command below to start the Jupyterlab application. It should open a new tab in your browser.

$ jupyter lab

How to contribute?

Your contribution is welcome! Your can do so by reporting issues, suggesting new notebook examples or improvements to the current examples.

A few extra steps are required to prepare your contributions. You can first update the conda environment using the following command:

$ conda env update -n espin2021-lab --file environment-dev.yml 

This installs a few additional packages like pre-commit, which is used to ensure that all notebook cell outputs are cleared before adding or updating notebooks in this git repository. Run the command below to enable pre-commit (you only need to do this once):

$ pre-commit install

The script below is useful if you want to ensure that all notebooks are running without error:

$ python execute_all_notebooks.py

This script (as well as a script to build the Docker image) is run each time you open or update a pull-request on GitHub.

espin2021-lab's People

Contributors

benbovy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.