-
Notifications
You must be signed in to change notification settings - Fork 9
Update examples to support latest Psydac and Python 3.12 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
75060e4
Simplified Psydac installation
kvrigor c804362
CI: Simplified dependency installation
kvrigor f09510c
CI: Install Psdyac dependencies
kvrigor addbe4a
CI: matrix.os == 'ubuntu-latest' is unnecessary
kvrigor a8b34b8
Fixed jupyter-book complaints in references.bib
kvrigor 51eea06
Removed machine-specific metadata embedded in .ipynb files
kvrigor e1e00e0
Updated Installation guide
kvrigor ee4171f
Improved the Installation guide
kvrigor 4ceaead
Uploaded images used in the Installation guide
kvrigor 9581dbb
Added missing newlines
kvrigor 624140d
Added macos-15 test
kvrigor 6f56d21
CI: Set default Fortran compiler
kvrigor c2f95ad
CI: Changed to another way of setting Fortran compiler
kvrigor b0efb86
CI: Downgrade to macOS 14
kvrigor b28f0ef
requirements.txt: removed [extra] identifier when installing psydac
kvrigor 036d64e
CI: Enabled parallel builds with Make
kvrigor 0997f1b
CI: Added setup python step and switched back to macos-15
kvrigor d2e7769
CI: Enabled SSH debugging
kvrigor 49fa5c0
CI: Used upterm fork from owenthereal
kvrigor 912b1f1
CI: Upterm not working for macOS; Tried explicitly setting gfortran
kvrigor b909589
CI: aliasing gfortran not working in macOS. Increased pip verbosity t…
kvrigor 708440c
CI: Test pyccel on macOS
kvrigor fb472a8
CI: Try aliasing gfortran in macOS
kvrigor e03b098
CI: Create gfortran symlink in macos
kvrigor 9aef593
CI: Fixed typo in 'Check gfortran version' step
kvrigor cd16f57
CI: Removed ineffective MAKEFLAGS and test pyccel step. Also only all…
kvrigor ac30ed9
Removed hardcoded author info
kvrigor 5633e42
Removed newlines in .ipynb files which was introduced in the previous…
kvrigor eedd7ae
Updated README and added AUTHORS file
kvrigor bcca7e5
Wrapped jupyterbook build command via Makefile
kvrigor de48937
Added missing newlines in AUTHORS and Makefile
kvrigor 3032cb9
AUTHORS.md -> AUTHORS
kvrigor 1bdf216
intro.md: referred to list of authors as a footnote
kvrigor b0060ca
Added missing newlines
kvrigor dfba9c8
Added myself to AUTHORS
kvrigor 0473381
README: Make a separate step for psydac installation so it could be s…
kvrigor 5a9a302
Removed notebook metadata via nb-clean
kvrigor 03ee341
Added a contributing section to README; added logs to Makefile steps
kvrigor c1685a4
README: Removed line breaks and simplified some sentences
kvrigor a66206f
install.md: Added separate step for Psydac installation
kvrigor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,85 @@ | ||
| name: Build and Deploy Jupyter Book | ||
| name: Build IGA-Python Jupyter Book | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| deploy-book: | ||
| runs-on: ubuntu-latest | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: true | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-24.04 | ||
| python-version: '3.12' | ||
|
|
||
| - os: macos-15 | ||
| python-version: '3.12' | ||
|
|
||
| env: | ||
| FC: gfortran-14 | ||
|
|
||
| name: ${{ matrix.os }} / Python ${{ matrix.python-version }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v2 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.9' | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'pip' | ||
| cache-dependency-path: requirements.txt | ||
|
|
||
| - name: Install dependencies | ||
| - name: Install non-Python dependencies on Ubuntu | ||
| if: startsWith(matrix.os, 'ubuntu') | ||
| uses: awalsh128/cache-apt-pkgs-action@latest | ||
| with: | ||
| packages: gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev | ||
| version: 1.0 | ||
| execute_install_scripts: true | ||
|
|
||
| # When loading cached apt packages, the default MPI compiler isn't set. | ||
| # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform | ||
| # installation (since openmpi-bin already exists), but instead reruns | ||
| # `update-alternatives` which fixes the symlinks to mpicc/mpif90. | ||
| - name: Reconfigure non-Python dependencies on Ubuntu | ||
| if: startsWith(matrix.os, 'ubuntu') | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| sudo apt-get update | ||
| sudo apt-get install gfortran | ||
| sudo apt-get install openmpi-bin libopenmpi-dev | ||
| sudo apt-get install libhdf5-openmpi-dev | ||
| git clone https://github.com/pyccel/psydac.git | ||
| cd psydac | ||
| python -m pip install -r requirements.txt | ||
| python -m pip install -r requirements_extra.txt --no-build-isolation | ||
| pip install . | ||
| pip install jupyter-book ghp-import sphinx_proof | ||
| python -m ipykernel install --user --name .iga-python --display-name "IGA-Python" | ||
| python -m ipykernel install --user --name v_psydac --display-name "Python (v_psydac)" | ||
| sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev | ||
|
|
||
| - name: Install non-Python dependencies on macOS | ||
| if: startsWith(matrix.os, 'macos') | ||
| run: | | ||
| brew install open-mpi hdf5-mpi libomp | ||
|
|
||
| - name: Check gfortran version | ||
| run: | | ||
| if [[ "${{ matrix.os }}" == *"macos"* ]]; then | ||
| # pyccel searches for a Fortran compiler exactly named 'gfortran' | ||
| # which the macos runner doesn't have. A simple workaround is to | ||
| # create a symlink named 'gfortran'. | ||
| FC_path=$(which $FC) | ||
| FC_dir=$(dirname ${FC_path}) | ||
| ln -sv ${FC_path} ${FC_dir}/gfortran | ||
| fi | ||
| gfortran --version | ||
|
|
||
| - name: Install Jupyter Book and Psydac | ||
| run: | | ||
| pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
|
|
||
| - name: Build Jupyter Book | ||
| run: jupyter-book build . | ||
| run: make docs | ||
|
|
||
| - name: Deploy to GitHub Pages | ||
| if: ${{ (github.ref == 'refs/heads/master') && startsWith(matrix.os, 'ubuntu') }} | ||
| run: ghp-import -n -p -f _build/html | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Ahmed Ratnani | ||
| Mohamed Jalal Maaouni | ||
| Paul Rigor | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| BUILD_DIR = ./_build | ||
| SRC_DIR = . | ||
|
|
||
| .PHONY: docs docs-strict clean clean-notebooks | ||
|
|
||
| docs: | ||
| @echo "Building IGA-Python docs..." | ||
| @jupyter-book build . | ||
| @echo "Done." | ||
|
|
||
| docs-strict: | ||
| @echo "Building IGA-Python docs with strict rules on..." | ||
| @jupyter-book build --warningiserror --nitpick --keep-going . | ||
| @echo "Done." | ||
|
|
||
| clean: | ||
| @echo "Removing previous IGA-Python build artifacts..." | ||
| @jupyter-book clean . | ||
| @echo "Done." | ||
|
|
||
| clean-notebooks: | ||
| @echo "Running 'nb-clean --remove-empty-cells --remove-all-notebook-metadata' on all '*.ipynb' files..." | ||
| @find . -type f -iname '*.ipynb' -exec nb-clean clean --remove-empty-cells --remove-all-notebook-metadata {} \+ | ||
| @echo "Done." | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,72 @@ | ||
| # Welcome to IGA-Python | ||
|
|
||
| This project provides a tutorial for isogeometric analysis (IGA) using Python and the Psydac library (pyccel/psydac). The numerical examples can be consulted online at pyccel.github.io/IGA-Python, or run with JupyterNotebook on a personal computer. | ||
|
|
||
| ## Editing and building IGA-Python locally | ||
|
|
||
| 1. Clone this repository and then install the required dependencies. | ||
|
|
||
| ```bash | ||
| git clone https://github.com/pyccel/IGA-Python.git | ||
| cd IGA-Python | ||
| IGA_PYTHON_DIR=$(pwd) | ||
|
|
||
| # Install dependencies on a virtual environment | ||
| python3 -m venv iga-python-env | ||
| source iga-python-env/bin/activate | ||
| pip3 install -r requirements_ntbk.txt | ||
| ``` | ||
|
|
||
| 2. Install Psydac. Skip this step if Psydac is already installed. | ||
|
|
||
| ```bash | ||
| # Modify these variables if you're using your own psydac fork/branch | ||
| PSYDAC_REMOTE="https://github.com/pyccel/psydac.git" | ||
| BRANCH="devel" | ||
|
|
||
| # Install psydac | ||
| pip install git+${PSYDAC_REMOTE}@${BRANCH} | ||
| ``` | ||
|
|
||
| 3. Run or modify the desired Python notebooks (`*.ipynb`) and Markdown files (`*.md`). Check the [MyST syntax cheat sheet](https://jupyterbook.org/en/stable/reference/cheatsheet.html) for reference. | ||
|
|
||
| > [!NOTE] | ||
| > Before committing changes to git, the notebooks have to be cleaned first. See ["Committing your changes to git"](#committing-your-changes-to-git) for more information. | ||
|
|
||
| 4. Build the docs by running `make` under the IGA-Python folder. This involves running all `*.ipynb` files in the background to make sure they are functional. | ||
|
|
||
| ```bash | ||
| cd ${IGA_PYTHON_DIR} | ||
| make | ||
| ``` | ||
|
|
||
| 5. View your changes on the browser. | ||
|
|
||
| ```bash | ||
| open ${IGA_PYTHON_DIR}/_build/html/index.html | ||
| ``` | ||
|
|
||
| ## Committing your changes to git | ||
|
|
||
| Running the Python notebooks embeds extra information like the name of virtual environment, Python version used, cell outputs, etc. The notebooks should be free of system- and runtime-specific information before committing them to source control. We suggest the following commit workflow: | ||
|
|
||
| 1. Run [`nb-clean`](https://github.com/srstevenson/nb-clean) on the modified notebook/s. There are different ways to run this command: | ||
|
|
||
| ```bash | ||
| # Clean a single notebook | ||
| nb-clean clean --remove-empty-cells --remove-all-notebook-metadata chapter1/poisson.ipynb | ||
|
|
||
| # Clean all '.ipynb' files under IGA-Python | ||
| make clean-notebooks | ||
|
|
||
| # Automatically run nb-clean on `git add`-ed *.ipynb files | ||
| nb-clean add-filter --remove-empty-cells --remove-all-notebook-metadata | ||
|
|
||
| # Undo previous command | ||
| nb-clean remove-filter | ||
| ``` | ||
|
|
||
| 2. Create a branch for your local changes, e.g. `git checkout -b my-local-fixes`. | ||
| 3. Stage the modified files with `git add`. Then run `git diff` to check if the changed `*.ipynb` notebooks doesn't include unnecessary diffs (e.g. notebook metadata). | ||
| 4. `git commit` your changes. | ||
| 5. *OPTIONAL*. Share your changes to this repo via a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # Bézier curves | ||
| *Author: Ahmed Ratnani* | ||
|
|
||
|
|
||
| We recall the definition of a Bézier curve: | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Computer Aided Design | ||
| *Author: Ahmed Ratnani* | ||
|
|
||
|
|
||
| TODO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| # What to expect from IGA-Python | ||
| *Author: Ahmed Ratnani* | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Isogeometric Analysis | ||
| *Author: Ahmed Ratnani* | ||
|
|
||
|
|
||
| TODO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Discrete Mapping | ||
| *Author: Ahmed Ratnani* | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.