This is a part of the inversion course. You can either run the notebooks from Colab or run them locally in your own machine.
- From GitHub, navigate to the notebook you'd like to run
- Click on the "Open on Colab" badge at the top of the notebook
- Within Colab, uncomment the code block with
# !git clone https://github.com/msambridge/InversionPracticalsand run this block - Run the rest of the notebook as normal
- There are several options if you'd like to save your changes. To do this, click "File" (on top left of Colab page) -> "Save a copy...", or "Download".
Here are detailed instructions on how to get all the dependencies.
It's recommended to use a python virtual environment (e.g. venv, virtualenv, mamba or conda) so that installation of dependendcies doesn't conflict with your other Python projects.
Open a terminal (or a Cygwin shell for Windows users) and refer to the cheat sheet below for how to create, activate, exit and remove a virtual environment. $ is the system prompt.
venv
Ensure you have and are using python >= 3.6. It may not be called python but something like python3, python3.10 etc.
Use the first two lines below to create and activate the new virtual environment. The other lines are for your future reference.
$ python -m venv <path-to-new-env>/inversion_course # to create
$ source <path-to-new-env>/inversion_course/bin/activate # to activate
$ deactivate # to exit
$ rm -rf <path-to-new-env>/inversion_course # to removevirtualenv
Use the first two lines below to create and activate the new virtual environment. The other lines are for your future reference.
$ virtualenv <path-to-new-env>/inversion_course -p=3.10 # to create
$ source <path-to-new-env>/inversion_course/bin/activate # to activate
$ deactivate # to exit
$ rm -rf <path-to-new-env>/inversion_course # to removemamba
Use the first two lines below to create and activate the new virtual environment. The other lines are for your future reference.
$ mamba create -n inversion_course python=3.10 # to create
$ mamba activate inversion_course # to activate
$ mamba deactivate # to exit
$ mamba env remove -n inversion_course # to removeconda
Use the first two lines below to create and activate the new virtual environment. The other lines are for your future reference.
$ conda create -n inversion_course python=3.10 # to create
$ conda activate inversion_course # to activate
$ conda deactivate # to exit
$ conda env remove -n inversion_course # to removeType the following in your terminal (or Cygwin shell for Windows users):
$ pip install jupyterlab matplotlib numpy scipy pyrf96 seaborn tqdmTroubleshooting installation
If you run into an error while running the above command, try the following:
$ pip install jupyterlab matplotlib seaborn tqdm
$ pip install pyrf96If you see any error while running the command, try to search for the error you see on Google/DuckDuckGo/ChatGPT.
If you see an error while running the second command, (ctrl/cmd + f) search error from
your terminal history to locate which error is causing the installation failure.
Type the following in your terminal (or Cygwin shell for Windows users):
$ cd <path-where-you-want-it-to-be-downloaded>
$ git clone https://github.com/msambridge/InversionPracticals.gitcd (change directory) into the path where this repository was downloaded and run jupyter-lab:
$ cd <path-to-practicals>/JupyterPracticals
$ jupyter-labWait for a while and your browser will be opened up automatically with a web-based IDE.