From ee4171ff6060d8e6fd70e49a440dd44d64441332 Mon Sep 17 00:00:00 2001 From: kvrigor Date: Wed, 4 Dec 2024 16:23:05 +0100 Subject: [PATCH] Improved the Installation guide --- _toc.yml | 2 +- chapter1/install.md | 49 +++++++++++++++++++-------------------------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/_toc.yml b/_toc.yml index 8159f13..1db5e02 100644 --- a/_toc.yml +++ b/_toc.yml @@ -32,7 +32,7 @@ parts: - file: chapter1/topology - file: chapter1/space - file: chapter1/rules - - file: chapter1/poisson + - file: chapter1/poisson - file: chapter1/boundary-conditions - file: chapter1/geometry sections: diff --git a/chapter1/install.md b/chapter1/install.md index d1bb9e3..20e490c 100644 --- a/chapter1/install.md +++ b/chapter1/install.md @@ -1,56 +1,49 @@ # Installation -To be able to run the examples in this guide, we recommend to follow these steps: +To run the examples in this guide, we recommend to follow these steps: -1. Download the [IGA-Python] source files. +1. Download the [IGA-Python] repository and then install its dependencies. ```bash +# Download IGA-Python git clone https://github.com/pyccel/IGA-Python.git +cd IGA-Python -# Save and show the absolute path to the IGA-Python directory. -IGA_PYTHON_DIR=$(realpath IGA-Python) -echo "IGA_PYTHON_DIR=${IGA_PYTHON_DIR}" -``` - -2. Create a virtual Python environment. - -```shell +# Install required Python packages python3 -m venv iga-python-env - -# Save and show the absolute path to the IGA-Python environment script. -IGA_PYTHON_ENV=$(realpath iga-python-env/bin/activate) -echo "IGA_PYTHON_ENV=${IGA_PYTHON_ENV}" -``` - -2. Install the necessary Python packages. - -```shell -cd ${IGA_PYTHON_DIR} - -# Python packages required by IGA-Python will -# be installed in IGA-Python virtual environment. -source ${IGA_PYTHON_ENV} +source iga-python-env/bin/activate pip3 install -r requirements.txt ``` -3. Launch Jupyter notebook. +2. Access [IGA-Python] examples through Jupyter notebook. ```shell +# Run this command under IGA-Python folder jupyter notebook ``` -The above command should automatically launch your web browser and show you the [IGA-Python] files you've downloaded from Step 1: +Running `jupyter notebook` should automatically launch your web browser and show you the files in the current directory—in this case the [IGA-Python] files: ![png](images/ch1-jupyter-root.png) -Try opening a sample notebook. Navigate to `chapter1/` and find `poisson.ipynb`: +Try opening a sample notebook, e.g. `chapter1/poisson.ipynb`: ![png](images/ch1-jupyter-poisson-1.png) -Open `poisson.ipynb`. Check that you can successfully run all cells in this notebook. +Open `poisson.ipynb` and verify that you can successfully run all cells in this notebook. ![png](images/ch1-jupyter-poisson-2.png) +3. When you close Jupyter and would like to run the [IGA-Python] examples, just open your Terminal/Console app and run these commands: + +```shell +cd /full/path/to/your/IGA-Python # Change this to where your IGA-Python folder is located +source iga-python-env/bin/activate +jupyter notebook +``` + +**Congratulations!** You can now head over to the [Poisson example problem](poisson.ipynb) to get started. + [IGA-Python]: https://github.com/pyccel/IGA-Python.git \ No newline at end of file