hughes2d 1.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. hughes2d-1.1.3/.coverage +0 -0
  2. hughes2d-1.1.3/.github/workflows/auto-release.yml +77 -0
  3. hughes2d-1.1.3/.github/workflows/draft-pdf.yml +29 -0
  4. hughes2d-1.1.3/.github/workflows/run_tests.yml +66 -0
  5. hughes2d-1.1.3/.github/workflows/versioning.yml +94 -0
  6. hughes2d-1.1.3/.gitignore +15 -0
  7. hughes2d-1.1.3/.pre-commit-config.yaml +29 -0
  8. hughes2d-1.1.3/.readthedocs.yaml +17 -0
  9. hughes2d-1.1.3/AUTHORS +4 -0
  10. hughes2d-1.1.3/CHANGELOG.md +24 -0
  11. hughes2d-1.1.3/CONTRIBUTING.md +26 -0
  12. hughes2d-1.1.3/LICENCE +674 -0
  13. hughes2d-1.1.3/PKG-INFO +329 -0
  14. hughes2d-1.1.3/README.md +308 -0
  15. hughes2d-1.1.3/docs/Makefile +20 -0
  16. hughes2d-1.1.3/docs/make.bat +35 -0
  17. hughes2d-1.1.3/docs/requirements.txt +2 -0
  18. hughes2d-1.1.3/docs/source/api.rst +7 -0
  19. hughes2d-1.1.3/docs/source/conf.py +54 -0
  20. hughes2d-1.1.3/docs/source/gettingStartedVid.gif +0 -0
  21. hughes2d-1.1.3/docs/source/index.rst +41 -0
  22. hughes2d-1.1.3/docs/source/maths.rst +399 -0
  23. hughes2d-1.1.3/docs/source/reference.rst +42 -0
  24. hughes2d-1.1.3/docs/source/usage.rst +371 -0
  25. hughes2d-1.1.3/examples/00-getting_started/getting_started.py +41 -0
  26. hughes2d-1.1.3/examples/01-Mesh_generation/Generating_square_mesh.py +31 -0
  27. hughes2d-1.1.3/examples/02-Simulating_Hughes_1/Simulating_Grandmont_Restaurant.py +60 -0
  28. hughes2d-1.1.3/examples/02-Simulating_Hughes_1/data/Mp4converter.py +6 -0
  29. hughes2d-1.1.3/examples/03-Simulating_Hughes_2/Comparison_Hughes_vs_explicit_vector_field.py +111 -0
  30. hughes2d-1.1.3/examples/04-Simulating_Eikonal_equation/Comparing_numerical_methods.py +58 -0
  31. hughes2d-1.1.3/examples/04-Simulating_Eikonal_equation/Simulating_shortest_path.py +31 -0
  32. hughes2d-1.1.3/examples/05-Simulating_LWR/Simulating_LWR.py +36 -0
  33. hughes2d-1.1.3/examples/06-File_handling/FreeFem/TestExportMSH.py +18 -0
  34. hughes2d-1.1.3/examples/06-File_handling/FreeFem/TestImportMSH.py +9 -0
  35. hughes2d-1.1.3/examples/06-File_handling/FreeFem/mesh_FF.msh +7904 -0
  36. hughes2d-1.1.3/examples/06-File_handling/dxf/DXFImport.py +13 -0
  37. hughes2d-1.1.3/examples/06-File_handling/dxf/config_simple.dxf +2962 -0
  38. hughes2d-1.1.3/examples/06-File_handling/dxf/config_simple_zones.dxf +4046 -0
  39. hughes2d-1.1.3/examples/06-File_handling/dxf/definingZones.py +7 -0
  40. hughes2d-1.1.3/examples/06-File_handling/msh/ImportMSH.py +11 -0
  41. hughes2d-1.1.3/examples/06-File_handling/msh/insulated-2.2.msh +214 -0
  42. hughes2d-1.1.3/examples/06-File_handling/vtk/mesh_FF.vtk +0 -0
  43. hughes2d-1.1.3/examples/07-Additional_Computations/AdditionalComputations.py +35 -0
  44. hughes2d-1.1.3/examples/08-Plot_methods/time_slices/TimeSlices.py +7 -0
  45. hughes2d-1.1.3/examples/08-Plot_methods/video/convert.py +7 -0
  46. hughes2d-1.1.3/logo/logo.gif +0 -0
  47. hughes2d-1.1.3/paper.bib +139 -0
  48. hughes2d-1.1.3/paper.md +136 -0
  49. hughes2d-1.1.3/pyproject.toml +28 -0
  50. hughes2d-1.1.3/src/hughes2d/EikonalSolver.py +1198 -0
  51. hughes2d-1.1.3/src/hughes2d/LWR2D.py +687 -0
  52. hughes2d-1.1.3/src/hughes2d/Mesh2D.py +2525 -0
  53. hughes2d-1.1.3/src/hughes2d/Plotter.py +266 -0
  54. hughes2d-1.1.3/src/hughes2d/Splitting.py +529 -0
  55. hughes2d-1.1.3/src/hughes2d/__init__.py +18 -0
  56. hughes2d-1.1.3/test/__init__.py +1 -0
  57. hughes2d-1.1.3/test/ressources/test_Domain.dxf +2922 -0
  58. hughes2d-1.1.3/test/ressources/test_mesh.msh +214 -0
  59. hughes2d-1.1.3/test/ressources/test_mesh_FreeFEM.msh +147 -0
  60. hughes2d-1.1.3/test/test_Mesh2D_importExport.py +48 -0
  61. hughes2d-1.1.3/test/test_Mesh2D_squareDomain.py +182 -0
  62. hughes2d-1.1.3/test/test_Mesh2D_squareDomain_plots.py +69 -0
  63. hughes2d-1.1.3/test/test_run_examples.py +45 -0
  64. hughes2d-1.1.3/test/test_solvers_LWR.py +61 -0
  65. hughes2d-1.1.3/test/test_solvers_eikonal.py +69 -0
  66. hughes2d-1.1.3/test/test_solvers_pedestrian.py +85 -0
  67. hughes2d-1.1.3/uv.lock +899 -0
Binary file
@@ -0,0 +1,77 @@
1
+ name: Auto-release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: write
8
+ id-token: write
9
+
10
+ jobs:
11
+ release:
12
+ name: Create a new release
13
+ runs-on: ubuntu-latest
14
+
15
+ defaults:
16
+ run:
17
+ shell: bash -l {0}
18
+
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v6
22
+ with:
23
+ fetch-depth: 0
24
+ fetch-tags: true
25
+
26
+ - name: Check if already released
27
+ id: check_release
28
+ run: |
29
+ CURRENT_COMMIT=$(git rev-parse HEAD)
30
+ echo "Current commit: $CURRENT_COMMIT"
31
+ if git tag --points-at $CURRENT_COMMIT | grep -q "^v"; then
32
+ echo "already_released=true" >> $GITHUB_OUTPUT
33
+ echo "This commit already has a release tag. Will skip release."
34
+ git tag --points-at $CURRENT_COMMIT
35
+ else
36
+ echo "already_released=false" >> $GITHUB_OUTPUT
37
+ echo "No release tag found. Proceeding with release."
38
+ fi
39
+
40
+ - name: Setup Python environment
41
+ if: steps.check_release.outputs.already_released == 'false'
42
+ uses: actions/setup-python@v6
43
+ with:
44
+ python-version: 3.13
45
+
46
+ - name: Install uv
47
+ if: steps.check_release.outputs.already_released == 'false'
48
+ uses: astral-sh/setup-uv@v7
49
+
50
+ - name: Ensure repo status is clean
51
+ if: steps.check_release.outputs.already_released == 'false'
52
+ run: git status
53
+
54
+ - name: Build package
55
+ if: steps.check_release.outputs.already_released == 'false'
56
+ run: uv build
57
+
58
+ - name: Publish package (trusted publishing)
59
+ if: steps.check_release.outputs.already_released == 'false'
60
+ run: uv publish --trusted-publishing always
61
+
62
+ - name: Get version number from uv
63
+ if: steps.check_release.outputs.already_released == 'false'
64
+ run: echo "VERSION_NUM = $(uv version --short)" >> $GITHUB_OUTPUT
65
+ id: version
66
+
67
+ - name: Create release in GitHub repo
68
+ if: steps.check_release.outputs.already_released == 'false'
69
+ uses: ncipollo/release-action@v1
70
+ with:
71
+ bodyFile: "docs/releases/v${{ steps.version.outputs.VERSION_NUM }}.md"
72
+ token: ${{ secrets.GITHUB_TOKEN }}
73
+ tag: v${{ steps.version.outputs.VERSION_NUM }}
74
+
75
+ - name: Ensure complete
76
+ if: steps.check_release.outputs.already_released == 'false'
77
+ run: echo "Auto-release complete!"
@@ -0,0 +1,29 @@
1
+ name: Draft PDF
2
+ on:
3
+ push:
4
+ paths:
5
+ - paper.md
6
+ - paper.bib
7
+ - .github/workflows/draft-pdf.yml
8
+
9
+ jobs:
10
+ paper:
11
+ runs-on: ubuntu-latest
12
+ name: Paper Draft
13
+ steps:
14
+ - name: Checkout
15
+ uses: actions/checkout@v4
16
+ - name: Build draft PDF
17
+ uses: openjournals/openjournals-draft-action@master
18
+ with:
19
+ journal: joss
20
+ # This should be the path to the paper within your repo.
21
+ paper-path: paper.md
22
+ - name: Upload
23
+ uses: actions/upload-artifact@v4
24
+ with:
25
+ name: paper
26
+ # This is the output path where Pandoc will write the compiled
27
+ # PDF. Note, this should be the same directory as the input
28
+ # paper.md
29
+ path: paper.pdf
@@ -0,0 +1,66 @@
1
+ # This workflow will install Python dependencies, run tests and generate a coverage badge with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+ # And for example of an integration with uv see: https://github.com/pyjanitor-devs/pyjanitor/tree/dev/.github/workflows
4
+
5
+ name: Tests with pytest
6
+
7
+ on:
8
+ push:
9
+ branches: [ "main" ]
10
+ pull_request:
11
+ branches: [ "main" ]
12
+
13
+ permissions:
14
+ contents: write
15
+
16
+ jobs:
17
+ build:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ python-version:
24
+ - "3.11"
25
+ - "3.12"
26
+ - "3.13"
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - name: Set up Python ${{ matrix.python-version }}
31
+ uses: actions/setup-python@v3
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+
35
+ - name: Install uv
36
+ uses: astral-sh/setup-uv@v7
37
+ with:
38
+ python-version: ${{ matrix.python-version }}
39
+
40
+ - name: Install dependencies without extras
41
+ run: |
42
+ uv sync
43
+ uv add pytest
44
+
45
+ - name: Test with pytest without extras
46
+ run: |
47
+ #This only test the import errors when extras are not installed
48
+ uv run -m pytest test/test_Mesh2D_squareDomain_plots.py test/test_run_examples.py
49
+
50
+ - name: setup ffmpeg for matplotlib save testing
51
+ uses: FedericoCarboni/setup-ffmpeg@v3
52
+ id: setup-ffmpeg
53
+
54
+ - name: Test with all extras and generate .coverage
55
+ run: |
56
+ uv sync --all-extras
57
+ uv run coverage run -m pytest
58
+
59
+ - name: Run coveralls
60
+ run: |
61
+ uv run pip install coveralls
62
+ coveralls
63
+ env:
64
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65
+
66
+
@@ -0,0 +1,94 @@
1
+ #Based on the auto-release action of pyjanitor: https://github.com/pyjanitor-devs/pyjanitor/blob/dev/.github/workflows/auto-release.yml
2
+
3
+ name: Auto-versioning
4
+
5
+ on:
6
+ # Manual release for minor/major versions.
7
+ # To cut a new release, navigate to the Actions section of the repo
8
+ # and select this workflow (Auto-release) on the right hand side.
9
+ # Then, click "Run workflow" and select major, minor, or patch.
10
+ workflow_dispatch:
11
+ inputs:
12
+ version_name:
13
+ description: "One of major, minor, or patch"
14
+ required: true
15
+ type: choice
16
+ options:
17
+ - major
18
+ - minor
19
+ - patch
20
+ change_log_note:
21
+ description: "The changelog entry for the version"
22
+ required: true
23
+ type: string
24
+
25
+ permissions:
26
+ contents: write
27
+ id-token: write
28
+
29
+ jobs:
30
+ version:
31
+ name: Create a new version
32
+ runs-on: ubuntu-latest
33
+
34
+ steps:
35
+ - name: Checkout repository
36
+ uses: actions/checkout@v6
37
+
38
+ - name: Setup Python environment
39
+ uses: actions/setup-python@v6
40
+ with:
41
+ python-version: 3.13
42
+
43
+ - name: Install uv
44
+ uses: astral-sh/setup-uv@v7
45
+
46
+ - name: Set version name
47
+ run: echo "VERSION_NAME=${{ github.event.inputs.version_name }}" >> $GITHUB_ENV
48
+
49
+ - name: Dry run uv version bump
50
+ run: uv version --bump ${{ env.VERSION_NAME }} --dry-run --short
51
+
52
+ - name: Store new version number
53
+ run: echo "version_number=$(uv version --bump ${{ env.VERSION_NAME }} --dry-run --short | tr -d ' \n')" >> $GITHUB_ENV
54
+
55
+ - name: Display new version number
56
+ run: |
57
+ echo "version_name: ${{ env.VERSION_NAME }}"
58
+ echo "version_number: v${{ env.version_number }}"
59
+
60
+ - name: Ensure repo status is clean
61
+ run: git status
62
+
63
+ - name: Configure Git
64
+ run: |
65
+ git config user.name github-actions
66
+ git config user.email github-actions@github.com
67
+
68
+ - name: Run uv version bump
69
+ run: uv version --bump ${{ env.VERSION_NAME }} --frozen
70
+
71
+ - name: Update CHANGELOG
72
+ run: sed -i "1s;^;\n## [${{ env.version_number }}] - ($(date +'%d/%m/%Y'))\n\n${{ github.event.inputs.change_log_note }};" CHANGELOG.md
73
+
74
+ - name: Update doc
75
+ run: sed -i "s|version = .*|version = '${{ env.version_number }}'|" docs/source/conf.py
76
+
77
+ - name: Update __init__.py
78
+ run: sed -i "s|__version__ = .*|__version__ = '${{ env.version_number }}'|" src/hughes2d/__init__.py
79
+
80
+ - name: Commit version bump and create tag
81
+ run: |
82
+ git add pyproject.toml CHANGELOG.md docs/source/conf.py src/hughes2d/__init__.py
83
+ git commit -m "Bump version to ${{ env.version_number }}"
84
+ git tag v${{ env.version_number }}
85
+
86
+ - name: Ensure tag creation
87
+ run: git tag | grep ${{ env.version_number }}
88
+
89
+ - name: Push changes with tags
90
+ run: |
91
+ git push && git push --tags
92
+
93
+ - name: Ensure complete
94
+ run: echo "Auto-versioning complete!"
@@ -0,0 +1,15 @@
1
+ #Untrack pyc and pycache folder
2
+
3
+ *.pyc
4
+ **/__pycache__/
5
+
6
+ #Untrack data files
7
+
8
+ *.csv
9
+ *.json
10
+
11
+ #Untrack rendered files
12
+
13
+ *.png
14
+ *.mp4
15
+ *.svg
@@ -0,0 +1,29 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/astral-sh/ruff-pre-commit
5
+ # Ruff version.
6
+ rev: v0.15.10
7
+ hooks:
8
+ # Run the linter.
9
+ - id: ruff-check
10
+ types_or: [ python, pyi, pyproject ]
11
+ args: [ --fix ]
12
+ # Run the formatter.
13
+ - id: ruff-format
14
+ types_or: [ python, pyi ]
15
+
16
+ - repo: https://github.com/pre-commit/pre-commit-hooks
17
+ rev: v3.2.0
18
+ hooks:
19
+ - id: trailing-whitespace
20
+ - id: end-of-file-fixer
21
+ - id: check-yaml
22
+ - id: check-toml
23
+ - id: check-added-large-files
24
+
25
+ - repo: https://github.com/astral-sh/uv-pre-commit
26
+ # uv version.
27
+ rev: 0.11.7
28
+ hooks:
29
+ - id: uv-lock
@@ -0,0 +1,17 @@
1
+ version: "2"
2
+
3
+ build:
4
+ os: "ubuntu-22.04"
5
+ tools:
6
+ python: "3.11"
7
+
8
+ python:
9
+ install:
10
+ - requirements: docs/requirements.txt
11
+
12
+ sphinx:
13
+ configuration: docs/source/conf.py
14
+
15
+ formats:
16
+ - pdf
17
+ - epub
hughes2d-1.1.3/AUTHORS ADDED
@@ -0,0 +1,4 @@
1
+ # Creation, code and development
2
+
3
+ - Théo Girard (Laboratoire Jacques-Louis Lions, Université Paris cité)
4
+ <theo.girard@math.cnrs.fr>.
@@ -0,0 +1,24 @@
1
+
2
+ ## [1.1.3] - (16/04/2026)
3
+
4
+ - Setup of auto-versioning
5
+ ## [1.1.2] - (14/04/2026)
6
+
7
+ - Fixing example 08/time-slices
8
+ - Fixing the warning due to the use of the deprecated datetime.utcnow() in the default filenames
9
+ - The default file format for pictures is now svg instead of png in save_time_slices()
10
+
11
+ ## [1.1.1] - (25/12/2025)
12
+
13
+ - Adding AUTHORS, LICENCE files
14
+ - Adding "Citation" section in both documentation and README
15
+
16
+ ## [1.1.0] - (04/12/2025)
17
+
18
+ - Paper.md now detail both the models and numerical schemes.
19
+ - The README.md and documentation usage.rst now present how to create a simple domain, mesh and how to run simple simulations.
20
+ - python version (>=3.10) --> (>=3.11) because of the use of **typing.Self** for type hint of special methods *__add__* and *__mult__* of CellValueMap and VertexValueMap objects.
21
+
22
+ ## [1.0.0] - (27/10/2025)
23
+
24
+ _First release._
@@ -0,0 +1,26 @@
1
+ # Contributing to Hughes2d
2
+
3
+ Thanks for your interest and for taking contribution into consideration for the Hughes2d package !!!
4
+ Below are a few information about how to contribute to this project.
5
+
6
+
7
+
8
+ #### Table of contents
9
+ * [Useful links and contact](#useful-links-and-contact)
10
+ * [Setting up the environment](https://github.com/TheoRGirard/hughes2d/README.md)
11
+ * [How to submit changes](#how-to-submit-changes)
12
+ * [How to report a bug](#how-to-report-a-bug)
13
+
14
+
15
+ ## Useful links and contact
16
+
17
+ * [documentation](https://hughes2d.readthedocs.io/en/latest/index.html)
18
+ * [bugs and known issues]
19
+ * Contact: theo.girard\\@\math.cnrs.fr
20
+
21
+ ## How to submit changes
22
+ If you want to, you're welcome to submit changes to the Hughes2d via a pull request.
23
+ You should expect an answer within the 3 next weeks in the worst case scenario.
24
+
25
+ ## How to report a bug
26
+ Feel free to report a bug using the issue section of the github repo.