Skip to content

Commit

Permalink
Updated Installation guide
Browse files Browse the repository at this point in the history
  • Loading branch information
kvrigor committed Nov 27, 2024
1 parent 51eea06 commit e1e00e0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 19 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: requirements.txt

- name: Install GCC and OpenMPI
uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -37,8 +30,8 @@ jobs:
- name: Install Jupyter Book and Psydac
run: |
pip3 install --upgrade pip
pip3 install -r requirements.txt
pip install --upgrade pip
pip install -r requirements.txt
- name: Build Jupyter Book
run: jupyter-book build .
Expand Down
50 changes: 40 additions & 10 deletions chapter1/install.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,56 @@
# Installation
*Author: Ahmed Ratnani*

It is recommanded to use a virtual environement.
To be able to run the examples in this guide, we recommend to follow these steps:

1. Download the [IGA-Python] source files.

```bash
git clone https://github.com/pyccel/IGA-Python.git

# 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
# create a virtual environement
python3 -m venv iga-python-env

# activate this environement using
source iga-python-env/bin/activate
# 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}"
```

Then install dependencies using
2. Install the necessary Python packages.

```shell
pip3 install 'psydac[extra] @ git+https://github.com/pyccel/psydac.git@devel#egg=psydac'
pip3 install notebook
cd ${IGA_PYTHON_DIR}

# Python packages required by IGA-Python will
# be installed in IGA-Python virtual environment.
source ${IGA_PYTHON_ENV}
pip3 install -r requirements.txt
```

Adding the virtual environement to Jupyter notebook, can be done using
3. Launch Jupyter notebook.

```shell
python3 -m ipykernel install --user --name=.iga-python
jupyter notebook
```

The above command should automatically launch your web browser and show you the [IGA-Python] files you've downloaded from Step 1:

![png](images/ch1-jupyter-root.png)

Try opening a sample notebook. Navigate to `chapter1/` and find `poisson.ipynb`:

![png](images/ch1-jupyter-poisson-1.png)


Open `poisson.ipynb`. Check that you can successfully run all cells in this notebook.

![png](images/ch1-jupyter-poisson-2.png)


[IGA-Python]: https://github.com/pyccel/IGA-Python.git
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ matplotlib
pyccel
ipykernel
notebook
nb-clean
psydac[extra] @ git+https://github.com/pyccel/psydac.git@devel#egg=psydac

0 comments on commit e1e00e0

Please sign in to comment.