PyFiberModes 0.7.2__tar.gz → 0.7.4__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 (106) hide show
  1. pyfibermodes-0.7.4/.github/workflows/deploy_PyPi.yml +20 -0
  2. pyfibermodes-0.7.4/.github/workflows/deploy_anaconda.yml +21 -0
  3. pyfibermodes-0.7.4/.github/workflows/deploy_coverage.yml +25 -0
  4. pyfibermodes-0.7.4/.github/workflows/deploy_documentation.yml +23 -0
  5. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PKG-INFO +1 -1
  6. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/__future__.py +1 -1
  7. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/_version.py +2 -2
  8. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber.py +1 -1
  9. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes.egg-info/PKG-INFO +1 -1
  10. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes.egg-info/SOURCES.txt +0 -1
  11. pyfibermodes-0.7.2/.github/workflows/build_documentation.yml +0 -60
  12. pyfibermodes-0.7.2/.github/workflows/deploy_PyPi.yml +0 -30
  13. pyfibermodes-0.7.2/.github/workflows/deploy_anaconda.yml +0 -49
  14. pyfibermodes-0.7.2/.github/workflows/deploy_coverage.yml +0 -53
  15. pyfibermodes-0.7.2/.github/workflows/deploy_documentation.yml +0 -123
  16. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/.github/dependabot.yml +0 -0
  17. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/.gitignore +0 -0
  18. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/.readthedocs.yml +0 -0
  19. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/LICENSE +0 -0
  20. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/__init__.py +0 -0
  21. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/coordinates.py +0 -0
  22. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/directories.py +0 -0
  23. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/factory.py +0 -0
  24. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/1550BHP.yaml +0 -0
  25. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/DCF13.yaml +0 -0
  26. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/DCF1300S_20.yaml +0 -0
  27. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/DCF1300S_26.yaml +0 -0
  28. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/DCF1300S_33.yaml +0 -0
  29. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/DCF1300S_42.yaml +0 -0
  30. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/F2028M12.yaml +0 -0
  31. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/F2028M21.yaml +0 -0
  32. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/F2028M24.yaml +0 -0
  33. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/F2058G1.yaml +0 -0
  34. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/F2058L1.yaml +0 -0
  35. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/HI1060.yaml +0 -0
  36. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/HP630.yaml +0 -0
  37. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/SM1950.yaml +0 -0
  38. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/SMF28.yaml +0 -0
  39. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/fluorine_doped_1%_capillary.yaml +0 -0
  40. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/fluorine_doped_2%_capillary.yaml +0 -0
  41. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/test_fiber.yaml +0 -0
  42. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fiber_files/test_multimode_fiber.yaml +0 -0
  43. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/field.py +0 -0
  44. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/fundamentals.py +0 -0
  45. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/loader.py +0 -0
  46. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/mode.py +0 -0
  47. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/mode_instances.py +0 -0
  48. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/solver/__init__.py +0 -0
  49. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/solver/base_solver.py +0 -0
  50. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/solver/mlsif/__init__.py +0 -0
  51. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/solver/mlsif/neff.py +0 -0
  52. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/solver/ssif/__init__.py +0 -0
  53. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/solver/ssif/cutoff.py +0 -0
  54. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/solver/ssif/neff.py +0 -0
  55. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/solver/tlsif/__init__.py +0 -0
  56. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/solver/tlsif/cutoff.py +0 -0
  57. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/source.py +0 -0
  58. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/stepindex.py +0 -0
  59. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/tools/__init__.py +0 -0
  60. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/tools/directories.py +0 -0
  61. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes/tools/utils.py +0 -0
  62. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes.egg-info/dependency_links.txt +0 -0
  63. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes.egg-info/requires.txt +0 -0
  64. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/PyFiberModes.egg-info/top_level.txt +0 -0
  65. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/README.rst +0 -0
  66. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/Makefile +0 -0
  67. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/DCF/README.rst +0 -0
  68. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/DCF/plot_DCF_fields.py +0 -0
  69. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/README.rst +0 -0
  70. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/SMF28/README.rst +0 -0
  71. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/SMF28/plot_smf28.py +0 -0
  72. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/SMF28/plot_smf28_dispersion_vs_wavelength.py +0 -0
  73. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/SMF28/plot_smf28_group_index_vs_wavelength.py +0 -0
  74. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/README.rst +0 -0
  75. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_U_vs_V.py +0 -0
  76. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_comparison_solvers.py +0 -0
  77. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_dispersion.py +0 -0
  78. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_effective_index.py +0 -0
  79. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_fiber_LP_modes.py +0 -0
  80. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_group_index.py +0 -0
  81. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_mode_field.py +0 -0
  82. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_mode_field_1.py +0 -0
  83. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_mode_field_2.py +0 -0
  84. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/examples/basic/plot_neff_tapered_fiber.py +0 -0
  85. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/make.bat +0 -0
  86. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/source/_static/default.css +0 -0
  87. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/source/_static/thumbnail.png +0 -0
  88. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/source/code.rst +0 -0
  89. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/source/conf.py +0 -0
  90. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/source/examples.rst +0 -0
  91. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/docs/source/index.rst +0 -0
  92. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/meta.yaml +0 -0
  93. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/perso/test_1.py +0 -0
  94. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/perso/test_2.py +0 -0
  95. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/perso/test_3.py +0 -0
  96. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/pyproject.toml +0 -0
  97. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/setup.cfg +0 -0
  98. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/tests/__init__.py +0 -0
  99. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/tests/test_api.py +0 -0
  100. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/tests/test_coordinates.py +0 -0
  101. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/tests/test_fiber.py +0 -0
  102. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/tests/test_field.py +0 -0
  103. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/tests/test_file_loading.py +0 -0
  104. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/tests/test_ssif.py +0 -0
  105. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/tests/test_tlsif.py +0 -0
  106. {pyfibermodes-0.7.2 → pyfibermodes-0.7.4}/tests/test_validation.py +0 -0
@@ -0,0 +1,20 @@
1
+ name: Deploy to PyPi
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ tags:
7
+ - '*'
8
+ pull_request:
9
+ branches: [ "master" ]
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ pure_package:
16
+ uses: MartinPdeS/MPSActions/.github/workflows/publish_pure_package_to_PyPi.yml@master
17
+ with:
18
+ python-version: "3.11"
19
+ secrets:
20
+ PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,21 @@
1
+ name: Deploy Conda Packages
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ tags:
7
+ - '*'
8
+ pull_request:
9
+ branches: [ "master" ]
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ ManyLinux_x86_64:
16
+ uses: MartinPdeS/MPSActions/.github/workflows/publish_compiled_package_to_anaconda.yml@master
17
+ with:
18
+ python-versions: '["3.11", "3.12"]'
19
+ secrets:
20
+ ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
21
+
@@ -0,0 +1,25 @@
1
+ # Simple workflow for deploying static content to GitHub Pages
2
+ name: Deploy coverage
3
+
4
+ on:
5
+ push:
6
+ branches: [ "master" ]
7
+ tags:
8
+ - '*'
9
+ pull_request:
10
+ branches: [ "master" ]
11
+
12
+
13
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14
+ permissions:
15
+ contents: write
16
+ pages: write
17
+ id-token: write
18
+
19
+ jobs:
20
+ ManyLinux_x86_64:
21
+ uses: MartinPdeS/MPSActions/.github/workflows/publish_coverage.yml@master
22
+ with:
23
+ python-version: "3.11"
24
+ secrets:
25
+ _GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,23 @@
1
+ # Simple workflow for deploying static content to GitHub Pages
2
+ name: Deploy documentation to github page
3
+
4
+ on:
5
+ push:
6
+ branches: [ "master" ]
7
+ tags:
8
+ - '*'
9
+ pull_request:
10
+ branches: [ "master" ]
11
+
12
+
13
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14
+ permissions:
15
+ contents: write
16
+ pages: write
17
+ id-token: write
18
+
19
+ jobs:
20
+ ManyLinux_x86_64:
21
+ uses: MartinPdeS/MPSActions/.github/workflows/publish_documentation.yml@master
22
+ with:
23
+ python-version: "3.11"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyFiberModes
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: A package for light propagation in fiber optics.
5
5
  Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -47,7 +47,7 @@ def get_normalized_LP_coupling(fiber, mode_0: Mode, mode_1: Mode) -> float:
47
47
 
48
48
  term_0 = abs(beta_0 - beta_1)
49
49
  term_1 = numpy.sqrt(beta_0 * beta_1)
50
- term_2 = 0.5 * fiber.wavelength.k0**2
50
+ term_2 = 0.5 * (2 * numpy.pi / fiber.wavelength)**2
51
51
  term_3 = term_2 / (term_0 * term_1)
52
52
 
53
53
  coupling = integral * term_3
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.7.2'
16
- __version_tuple__ = version_tuple = (0, 7, 2)
15
+ __version__ = version = '0.7.4'
16
+ __version_tuple__ = version_tuple = (0, 7, 4)
@@ -490,7 +490,7 @@ class Fiber(object):
490
490
  mode=mode,
491
491
  )
492
492
 
493
- beta = neff * self.wavelength.k0
493
+ beta = neff * (2 * numpy.pi / self.wavelength)
494
494
 
495
495
  return beta
496
496
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyFiberModes
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: A package for light propagation in fiber optics.
5
5
  Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -5,7 +5,6 @@ README.rst
5
5
  meta.yaml
6
6
  pyproject.toml
7
7
  .github/dependabot.yml
8
- .github/workflows/build_documentation.yml
9
8
  .github/workflows/deploy_PyPi.yml
10
9
  .github/workflows/deploy_anaconda.yml
11
10
  .github/workflows/deploy_coverage.yml
@@ -1,60 +0,0 @@
1
- # .github/workflows/deploy_documentation.yml
2
- name: Documentation
3
-
4
- on:
5
- push:
6
- branches: [ "master" ]
7
- tags:
8
- - '*'
9
- pull_request:
10
- branches: [ "master" ]
11
-
12
- jobs:
13
- documentation:
14
- name: Run the documentation building tools
15
- runs-on: ubuntu-latest
16
- permissions:
17
- pull-requests: write
18
- contents: write
19
-
20
- steps:
21
- - name: "Set-up: Python 3.11"
22
- uses: actions/setup-python@v5
23
- id: cp311
24
- with:
25
- python-version: 3.11
26
-
27
- - name: "Install: Dependencies for headless server"
28
- shell: bash
29
- run: |
30
- sudo apt-get update
31
- sudo apt-get install -y xvfb jq
32
-
33
- - name: "Checkout requirements and files for testing"
34
- uses: actions/checkout@v4
35
- with:
36
- fetch-depth: 0
37
- submodules: true
38
- ref: master
39
-
40
- - name: Install everything, run the tests, produce the .coverage file
41
- run: |
42
- python -m pip install wheel build
43
- python -m build --wheel
44
- python -m pip install .[documentation]
45
-
46
- - name: Get current tag
47
- id: get_tag
48
- run: |
49
- git fetch --tags
50
- echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
51
-
52
- - name: "Sphinx build"
53
- run: |
54
- sphinx-build docs/source documentation_build
55
-
56
- - name: "Upload Documentation Artifact"
57
- uses: actions/upload-artifact@v4
58
- with:
59
- name: documentation_build
60
- path: documentation_build
@@ -1,30 +0,0 @@
1
- name: Deploy to PyPi
2
-
3
- on:
4
- push:
5
- branches: [ "master" ]
6
- tags:
7
- - '*'
8
- pull_request:
9
- branches: [ "master" ]
10
-
11
- permissions:
12
- contents: write
13
-
14
- jobs:
15
- build_pure_python:
16
- runs-on: ubuntu-latest
17
- steps:
18
- - uses: MartinPdeS/MPSActions/build_pure_python_package@master
19
- with:
20
- python-version: 3.11
21
-
22
- publish_wheel:
23
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
24
- needs: [build_pure_python]
25
- runs-on: ubuntu-latest
26
- steps:
27
- - uses: MartinPdeS/MPSActions/publish_pypi@master
28
- with:
29
- python-version: 3.11
30
- password: ${{ secrets.PYPI_API_TOKEN }}
@@ -1,49 +0,0 @@
1
- name: Deploy to Conda
2
-
3
- on:
4
- push:
5
- branches: [ "master" ]
6
- tags:
7
- - '*'
8
- pull_request:
9
- branches: [ "master" ]
10
-
11
- jobs:
12
- conda_deployment:
13
- name: OS [${{ matrix.os }}] -- Python [${{ matrix.python-version }}]
14
- runs-on: ${{ matrix.os }}
15
- strategy:
16
- matrix:
17
- os: [ubuntu-latest, macos-latest]
18
- python-version: ["3.11", "3.12"]
19
-
20
- steps:
21
- - uses: actions/checkout@v3
22
- with:
23
- fetch-depth: 0
24
-
25
- - name: Set up Conda environment
26
- uses: conda-incubator/setup-miniconda@v3
27
- with:
28
- auto-activate-base: true
29
- python-version: ${{ matrix.python-version }}
30
- channels: conda-forge, martinpdes
31
-
32
- - name: Install Conda tools
33
- run: |
34
- conda install anaconda-client conda-build
35
-
36
- - name: Configure Conda for Upload (if applicable)
37
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
38
- run: |
39
- conda config --set anaconda_upload true
40
-
41
- - name: Configure Conda for No Upload (if applicable)
42
- if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/')
43
- run: |
44
- conda config --set anaconda_upload false
45
-
46
- - name: Build Conda package
47
- run: |
48
- conda build . --python ${{ matrix.python-version }} --user martinpdes --token ${{ secrets.ANACONDA_API_TOKEN }}
49
-
@@ -1,53 +0,0 @@
1
- # .github/workflows/coverage.yml
2
- name: Coverage
3
-
4
- on:
5
- push:
6
- branches: [ "master" ]
7
- tags:
8
- - '*'
9
- pull_request:
10
- branches: [ "master" ]
11
-
12
- jobs:
13
- coverage:
14
- name: Run test and generate coverage data
15
- runs-on: ubuntu-latest
16
- permissions:
17
- pull-requests: write
18
- contents: write
19
-
20
- steps:
21
- - name: "Set-up: Python ${{ env.cp_python_version }}"
22
- uses: actions/setup-python@v5
23
- id: cp310
24
- with:
25
- python-version: "3.11"
26
-
27
-
28
- - name: "Install: Dependencies for headless server"
29
- shell: bash
30
- run: |
31
- sudo apt-get update
32
- # sudo apt-get install libgl1-mesa-glx xvfb
33
- sudo apt-get install xvfb
34
-
35
- - name: "Checkout requirements and files for testing"
36
- uses: actions/checkout@v4
37
- with:
38
- fetch-depth: 0
39
- submodules: true
40
-
41
- - name: Install everything, run the tests, produce the .coverage file
42
- run: |
43
- python -m pip install wheel build
44
- python -m build --wheel
45
- python -m pip install .[testing]
46
- pytest
47
-
48
- - name: Coverage comment
49
- uses: py-cov-action/python-coverage-comment-action@v3
50
- with:
51
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52
- MINIMUM_GREEN: 90
53
- MINIMUM_ORANGE: 50
@@ -1,123 +0,0 @@
1
- # Simple workflow for deploying static content to GitHub Pages
2
- name: Deploy static content to Pages
3
-
4
-
5
- on:
6
- workflow_run:
7
- workflows: ["Documentation"] # This references the name of the first workflow
8
- types:
9
- - completed # Run when the Documentation workflow is completed successfully
10
-
11
-
12
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13
- permissions:
14
- contents: write
15
- pages: write
16
- id-token: write
17
-
18
- jobs:
19
- deploy:
20
- runs-on: ubuntu-latest
21
- environment:
22
- name: github-pages
23
- url: ${{ steps.deployment.outputs.page_url }}
24
-
25
- steps:
26
- - name: Checkout
27
- uses: actions/checkout@v4
28
- with:
29
- fetch-depth: 0
30
- ref: documentation_page
31
-
32
- - name: Set up Git user
33
- run: |
34
- git config --global user.name "GitHub Actions"
35
- git config --global user.email "actions@github.com"
36
-
37
- - name: Download artifact
38
- id: download-artifact
39
- uses: dawidd6/action-download-artifact@v6
40
- with:
41
- workflow: build_documentation.yml
42
- name: documentation_build
43
- path: ./documentation_build
44
-
45
- - name: Get current tag
46
- id: get_tag
47
- run: |
48
- # Fetch all tags to ensure they are available
49
- git fetch --tags
50
- git tag -l
51
-
52
- # Get the latest tag by creation date
53
- TAG=$(git tag --sort=-creatordate | head -n 1)
54
-
55
- # Fallback to a default tag if no tag is found
56
- if [ -z "$TAG" ]; then
57
- TAG="0.0.0.0"
58
- fi
59
-
60
- echo "tag=$TAG" >> $GITHUB_ENV
61
- echo "Tag found or default: $TAG"
62
-
63
- - name: Update new documentation version
64
- run: |
65
- rm -rf docs/${{ env.tag }}
66
- mv documentation_build docs/${{ env.tag }}
67
-
68
- - name: Scan, sort versions, and update version_switcher.json
69
- run: |
70
- # Define the path to version_switcher.json
71
- json_file="version_switcher.json"
72
- rm $json_file
73
- docs_path="docs"
74
- base_url="https://martinpdes.github.io/PyFiberModes"
75
-
76
- # Start the JSON array
77
- echo "[" > $json_file
78
-
79
- # Get sorted version directories in descending order
80
- version_dirs=$(ls -v $docs_path | sort -V -r)
81
-
82
-
83
- # Loop over sorted versions and add to JSON file
84
- first_entry=true
85
- for version in $version_dirs; do
86
- version_url="${base_url}/${docs_path}/${version}"
87
-
88
- # Add a comma if it's not the first entry
89
- if [ "$first_entry" = true ]; then
90
- first_entry=false
91
- else
92
- echo "," >> $json_file
93
- fi
94
-
95
- # Append each version as a JSON entry
96
- jq -n \
97
- --arg name "$version" \
98
- --arg version "$version" \
99
- --arg url "$version_url" \
100
- '{name: $name, version: $version, url: $url}' >> $json_file
101
- done
102
-
103
- # End the JSON array
104
- echo "]" >> $json_file
105
-
106
- # Add and commit the updated version_switcher.json
107
- git add $json_file
108
- echo $json_file
109
- git add docs/
110
- git commit --allow-empty -m "Update version_switcher.json"
111
- git push origin HEAD
112
-
113
- - name: Setup Pages
114
- uses: actions/configure-pages@v5
115
-
116
- - name: Upload artifact
117
- uses: actions/upload-pages-artifact@v3
118
- with:
119
- path: '.'
120
-
121
- - name: Deploy to GitHub Pages
122
- id: deployment
123
- uses: actions/deploy-pages@v4
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes