Jupyter Notebooks
General information
Jupyter notebooks are used throughout this course. In order to make the installation of the relatively old meshign libraries we rely on as easy as possible, we have set up different ways of getting the Jupyter notebooks to run. Please choose below if you are a UCPH student or participating in the course online.
UCPH students
For UCPH students we have prepared a containerized environment where all notebooks run smoothly. In order to access it, UCPH students need to sign up for/into the Electronic Research Data Archive at University of Copenhagen (also called ERDA) at erda.dk. Once you have an account, follow this step by step procedure: * When you are signed in you can see a welcome page. * Choose the Jupyter icon which brings you to the Data Analysis Gateway (DAG). * Start your DAG server. This will allow you to choose from a variety of containerized environments, where you choose the 'Computational Models in Simulation'. * Once you have chosen it, you just have to wait. Especially th first time it will take some time to start up. * Once it is started you are in a regular jupyter environment. You can make a folder CMIS and upload all the exercise notebooks and files that we make available throughout the course. And you are ready to code!
Online students
Anaconda is used to set up a conda environment for the notebooks. Youc na do this via a local install on your machine or you can also use Google's Colaboratory to work with the notebooks.
Anaconda
In order to install Anaconda, go to https://www.anaconda.com/distribution/ and download the Python 3.7 version. If you already have it installed, you can just downgrade Python like below.
Conda Environment
This is how to install and setup your conda environment inside the Anaconda Prompt/Terminal
conda create -n cmis python=3.7
conda activate cmis
conda config --add channels conda-forge
conda install meshplot
conda install ipympl
conda install igl
conda install wildmeshing
conda install jupyter
When you want to run the Jupyter notebook you have to do
conda activate cmis
jupyter notebook
Anaconda issues
New MAC chips
Since Python 3.8 had been released for about a year when Apple Silicon hit the market, Python 3.7 builds for osx-arm64 were never part of the regular build matrix for Conda Forge. This means we need to find a work around for this. Replace the first line in the code box above with the following:## create empty environment
conda create -n cmis
## activate
conda activate cmis
## use x86_64 architecture channel(s)
conda config --env --set subdir osx-64
## install python, numpy, etc. (add more packages here...)
conda install python=3.7
Jupyter notebook not opening
In some cases the Jupyter client gives issue. Go to your Anaconda Prompt/Terminal and enter the cmis environemnt. Once in your cmis environment, it helps to upgrade the jupyter_client like below:pip install --upgrade jupyter_client
Python Tips in General
The official site offers documentation, tutorials, references to books, etc.
- For Python Basics: www.python.org.
- A nice tutorial on Python basics including some numpy and scipy. http://cs231n.github.io/python-numpy-tutorial/
- Whirlwind tour of Python: https://github.com/jakevdp/WhirlwindTourOfPython .
- For Data Science in Python: http://github.com/jakevdp/PythonDataScienceHandbook
The last two links are excellent books, freely available online with Jupyter notebooks for the examples.