PyFiberModes 0.13.1__tar.gz → 0.13.2__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 (146) hide show
  1. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.github/workflows/tests.yml +1 -1
  2. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.zenodo.json +6 -3
  3. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/CHANGELOG.md +14 -1
  4. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/CITATION.cff +3 -0
  5. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/CONTRIBUTING.md +1 -1
  6. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PKG-INFO +17 -8
  7. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/_version.py +2 -2
  8. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/field.py +20 -36
  9. pyfibermodes-0.13.2/PyFiberModes/plotting.py +79 -0
  10. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes.egg-info/PKG-INFO +17 -8
  11. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes.egg-info/SOURCES.txt +1 -0
  12. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes.egg-info/requires.txt +5 -4
  13. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/README.rst +8 -2
  14. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/conda.recipe/meta.yaml +14 -10
  15. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/pyproject.toml +20 -7
  16. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_architecture.py +28 -5
  17. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tools/check_release.py +1 -4
  18. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.coveragerc +0 -0
  19. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.github/dependabot.yml +0 -0
  20. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.github/workflows/deploy_PyPi.yml +0 -0
  21. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.github/workflows/deploy_anaconda.yml +0 -0
  22. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.github/workflows/deploy_coverage.yml +0 -0
  23. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.github/workflows/deploy_documentation.yml +0 -0
  24. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.github/workflows/quality.yml +0 -0
  25. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/.gitignore +0 -0
  26. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/LICENSE +0 -0
  27. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/MANIFEST.in +0 -0
  28. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/Makefile +0 -0
  29. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/__init__.py +0 -0
  30. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/analysis.py +0 -0
  31. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/coordinates.py +0 -0
  32. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/directories.py +0 -0
  33. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/exceptions.py +0 -0
  34. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/factory.py +0 -0
  35. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber.py +0 -0
  36. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/1550BHP.yaml +0 -0
  37. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/DCF13.yaml +0 -0
  38. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/DCF1300S_20.yaml +0 -0
  39. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/DCF1300S_26.yaml +0 -0
  40. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/DCF1300S_33.yaml +0 -0
  41. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/DCF1300S_42.yaml +0 -0
  42. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/F2028M12.yaml +0 -0
  43. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/F2028M21.yaml +0 -0
  44. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/F2028M24.yaml +0 -0
  45. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/F2058G1.yaml +0 -0
  46. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/F2058L1.yaml +0 -0
  47. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/HI1060.yaml +0 -0
  48. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/HP630.yaml +0 -0
  49. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/SM1950.yaml +0 -0
  50. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/SMF28.yaml +0 -0
  51. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/fluorine_doped_1%_capillary.yaml +0 -0
  52. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/fluorine_doped_2%_capillary.yaml +0 -0
  53. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/test_fiber.yaml +0 -0
  54. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fiber_files/test_multimode_fiber.yaml +0 -0
  55. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/fundamentals.py +0 -0
  56. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/loader.py +0 -0
  57. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/mode.py +0 -0
  58. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/mode_instances.py +0 -0
  59. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/models.py +0 -0
  60. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/optimization.py +0 -0
  61. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/propagation.py +0 -0
  62. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/services.py +0 -0
  63. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/__init__.py +0 -0
  64. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/base_solver.py +0 -0
  65. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/mlsif/__init__.py +0 -0
  66. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/mlsif/neff.py +0 -0
  67. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/protocols.py +0 -0
  68. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/results.py +0 -0
  69. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/ssif/__init__.py +0 -0
  70. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/ssif/cutoff.py +0 -0
  71. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/ssif/neff.py +0 -0
  72. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/tlsif/__init__.py +0 -0
  73. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/solver/tlsif/cutoff.py +0 -0
  74. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/source.py +0 -0
  75. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes/stepindex.py +0 -0
  76. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes.egg-info/dependency_links.txt +0 -0
  77. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/PyFiberModes.egg-info/top_level.txt +0 -0
  78. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/benchmarks/README.md +0 -0
  79. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/benchmarks/test_field_performance.py +0 -0
  80. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/Makefile +0 -0
  81. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/DCF/README.rst +0 -0
  82. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/DCF/plot_DCF_fields.py +0 -0
  83. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/README.rst +0 -0
  84. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/SMF28/README.rst +0 -0
  85. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/SMF28/plot_smf28.py +0 -0
  86. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/SMF28/plot_smf28_dispersion_vs_wavelength.py +0 -0
  87. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/SMF28/plot_smf28_group_index_vs_wavelength.py +0 -0
  88. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/analysis/README.rst +0 -0
  89. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/analysis/plot_coupled_mode_exchange.py +0 -0
  90. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/analysis/plot_structured_wavelength_sweep.py +0 -0
  91. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/README.rst +0 -0
  92. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_U_vs_V.py +0 -0
  93. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_comparison_solvers.py +0 -0
  94. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_dispersion.py +0 -0
  95. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_effective_index.py +0 -0
  96. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_fiber_LP_modes.py +0 -0
  97. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_group_index.py +0 -0
  98. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_mode_field.py +0 -0
  99. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_mode_field_1.py +0 -0
  100. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_mode_field_2.py +0 -0
  101. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/basic/plot_neff_tapered_fiber.py +0 -0
  102. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/benchmarks/README.rst +0 -0
  103. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/benchmarks/plot_field_grid_scaling.py +0 -0
  104. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/fields/README.rst +0 -0
  105. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/fields/plot_vector_components.py +0 -0
  106. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/validation/README.rst +0 -0
  107. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/examples/validation/plot_effective_index_bounds.py +0 -0
  108. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/make.bat +0 -0
  109. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/_static/default.css +0 -0
  110. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/_static/favicon.png +0 -0
  111. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/_static/logo.png +0 -0
  112. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/_static/thumbnail.png +0 -0
  113. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/architecture.rst +0 -0
  114. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/code/analysis.rst +0 -0
  115. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/code/fibers.rst +0 -0
  116. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/code/fields.rst +0 -0
  117. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/code/fundamentals.rst +0 -0
  118. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/code.rst +0 -0
  119. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/conf.py +0 -0
  120. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/examples.rst +0 -0
  121. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/getting_started.rst +0 -0
  122. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/index.rst +0 -0
  123. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/performance.rst +0 -0
  124. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/references.rst +0 -0
  125. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/theory.rst +0 -0
  126. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/troubleshooting.rst +0 -0
  127. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/docs/source/workflows.rst +0 -0
  128. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/pytest.ini +0 -0
  129. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/setup.cfg +0 -0
  130. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/__init__.py +0 -0
  131. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/helpers.py +0 -0
  132. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_advanced_features.py +0 -0
  133. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_api.py +0 -0
  134. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_architecture_enhancements.py +0 -0
  135. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_coordinates.py +0 -0
  136. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_docstrings.py +0 -0
  137. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_fiber.py +0 -0
  138. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_field.py +0 -0
  139. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_file_loading.py +0 -0
  140. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_physics_regression.py +0 -0
  141. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_release_tools.py +0 -0
  142. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_ssif.py +0 -0
  143. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_tlsif.py +0 -0
  144. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tests/test_validation.py +0 -0
  145. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tools/next_release_version.py +0 -0
  146. {pyfibermodes-0.13.1 → pyfibermodes-0.13.2}/tools/release_tag.py +0 -0
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- python-version: ["3.10", "3.11", "3.12", "3.13"]
19
+ python-version: ["3.11", "3.12", "3.13"]
20
20
  steps:
21
21
  - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
22
22
  - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "PyFiberModes: guided-mode analysis and design for optical fibers",
3
- "description": "PyFiberModes solves guided modes in circularly symmetric step-index and multilayer optical fibers, including field analysis, modal sweeps, inverse design, and coupled-mode propagation.",
3
+ "description": "Guided-mode analysis and design for circular optical fibers, with field analysis, dispersion, modal sweeps, inverse design, and coupled-mode propagation.",
4
4
  "creators": [
5
5
  {
6
6
  "name": "Poinsinet de Sivry-Houle, Martin"
@@ -9,11 +9,14 @@
9
9
  "license": "MIT",
10
10
  "upload_type": "software",
11
11
  "access_right": "open",
12
- "version": "0.13.1",
13
- "publication_date": "2026-09-22",
12
+ "version": "0.13.2",
13
+ "publication_date": "2026-09-23",
14
14
  "keywords": [
15
15
  "optical fibers",
16
16
  "guided modes",
17
+ "mode solver",
18
+ "optical waveguides",
19
+ "photonics",
17
20
  "effective index",
18
21
  "dispersion",
19
22
  "coupled-mode theory"
@@ -6,6 +6,18 @@ use [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.13.2] - 2026-09-23
10
+
11
+ ### Changed
12
+
13
+ - Raised the minimum supported Python version to 3.11 and aligned CI,
14
+ contributor guidance, Ruff, and Conda metadata with that policy.
15
+ - Moved Matplotlib rendering into the optional `PyFiberModes.plotting` module
16
+ and added the `plotting` installation extra, keeping it out of core runtime
17
+ dependencies while preserving the `Field.plot` convenience method.
18
+ - Replaced generic package descriptions and keywords with fiber-mode,
19
+ photonics, waveguide, dispersion, and coupled-mode metadata.
20
+
9
21
  ## [0.13.1] - 2026-09-22
10
22
 
11
23
  ### Added
@@ -74,7 +86,8 @@ use [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
74
86
 
75
87
  - Established the current tagged baseline for subsequent documented releases.
76
88
 
77
- [Unreleased]: https://github.com/MartinPdeS/PyFiberModes/compare/v0.13.1...HEAD
89
+ [Unreleased]: https://github.com/MartinPdeS/PyFiberModes/compare/v0.13.2...HEAD
90
+ [0.13.2]: https://github.com/MartinPdeS/PyFiberModes/releases/tag/v0.13.2
78
91
  [0.13.1]: https://github.com/MartinPdeS/PyFiberModes/releases/tag/v0.13.1
79
92
  [0.13.0]: https://github.com/MartinPdeS/PyFiberModes/releases/tag/v0.13.0
80
93
  [0.12.0]: https://github.com/MartinPdeS/PyFiberModes/releases/tag/v0.12.0
@@ -14,6 +14,9 @@ url: "https://martinpdes.github.io/PyFiberModes/"
14
14
  keywords:
15
15
  - optical fibers
16
16
  - guided modes
17
+ - mode solver
18
+ - optical waveguides
19
+ - photonics
17
20
  - effective index
18
21
  - dispersion
19
22
  - coupled-mode theory
@@ -1,6 +1,6 @@
1
1
  # Contributing to PyFiberModes
2
2
 
3
- Use Python 3.10 or newer. Install development dependencies with `python -m pip install -e ".[testing,documentation]"`, then run `python -m pytest`.
3
+ Use Python 3.11 or newer. Install development dependencies with `python -m pip install -e ".[testing,documentation]"`, then run `python -m pytest`.
4
4
 
5
5
  Releases use semantic version tags. Run `make patch`, `make minor`, or `make major` from a clean `master` checkout; the command creates the release commit, tags it, and pushes both. Publishing workflows run only for `v*` tags.
6
6
 
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyFiberModes
3
- Version: 0.13.1
4
- Summary: A package for light propagation in fiber optics.
3
+ Version: 0.13.2
4
+ Summary: Guided-mode analysis and design for circular optical fibers.
5
5
  Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
7
7
  Version 3, 29 June 2007
@@ -682,9 +682,10 @@ Project-URL: Homepage, https://github.com/MartinPdeS/PyFiberModes
682
682
  Project-URL: Repository, https://github.com/MartinPdeS/PyFiberModes
683
683
  Project-URL: Issues, https://github.com/MartinPdeS/PyFiberModes/issues
684
684
  Project-URL: Documentation, https://martinpdes.github.io/PyFiberModes/
685
- Keywords: finit-difference,matrix
685
+ Keywords: fiber optics,guided modes,mode solver,optical waveguides,photonics,dispersion,coupled-mode theory
686
686
  Classifier: Programming Language :: Python
687
687
  Classifier: Programming Language :: Python :: 3
688
+ Classifier: Programming Language :: Python :: 3 :: Only
688
689
  Classifier: Programming Language :: Python :: 3.11
689
690
  Classifier: Programming Language :: Python :: 3.12
690
691
  Classifier: Programming Language :: Python :: 3.13
@@ -693,12 +694,11 @@ Classifier: Development Status :: 4 - Beta
693
694
  Classifier: Topic :: Scientific/Engineering :: Physics
694
695
  Classifier: License :: OSI Approved :: MIT License
695
696
  Classifier: Intended Audience :: Science/Research
696
- Requires-Python: >=3.10
697
+ Requires-Python: >=3.11
697
698
  Description-Content-Type: text/x-rst
698
699
  License-File: LICENSE
699
700
  Requires-Dist: PyOptik<3,>=2
700
701
  Requires-Dist: PyFinitDiff
701
- Requires-Dist: matplotlib>=3.8
702
702
  Requires-Dist: pyyaml
703
703
  Requires-Dist: numpy
704
704
  Requires-Dist: scipy
@@ -708,10 +708,13 @@ Requires-Dist: pytest-cov<8,>=2; extra == "testing"
708
708
  Requires-Dist: pytest-json-report~=1.5; extra == "testing"
709
709
  Requires-Dist: coverage~=7.6; extra == "testing"
710
710
  Requires-Dist: ruff<1,>=0.8; extra == "testing"
711
- Requires-Dist: tomli<3,>=2; python_version < "3.11" and extra == "testing"
711
+ Requires-Dist: matplotlib>=3.8; extra == "testing"
712
+ Provides-Extra: plotting
713
+ Requires-Dist: matplotlib>=3.8; extra == "plotting"
712
714
  Provides-Extra: benchmarking
713
715
  Requires-Dist: pytest-benchmark<6,>=5; extra == "benchmarking"
714
716
  Provides-Extra: documentation
717
+ Requires-Dist: matplotlib>=3.8; extra == "documentation"
715
718
  Requires-Dist: numpydoc==1.10.0; extra == "documentation"
716
719
  Requires-Dist: sphinx>=5.1.1; extra == "documentation"
717
720
  Requires-Dist: sphinx-gallery==0.21.0; extra == "documentation"
@@ -784,13 +787,19 @@ Features
784
787
  Installation
785
788
  ------------
786
789
 
787
- PyFiberModes requires Python 3.10 or newer. Install the released package from
790
+ PyFiberModes requires Python 3.11 or newer. Install the released package from
788
791
  PyPI:
789
792
 
790
793
  .. code-block:: bash
791
794
 
792
795
  python -m pip install PyFiberModes
793
796
 
797
+ Matplotlib-based field visualizations are optional:
798
+
799
+ .. code-block:: bash
800
+
801
+ python -m pip install "PyFiberModes[plotting]"
802
+
794
803
  or from Anaconda:
795
804
 
796
805
  .. code-block:: bash
@@ -1028,7 +1037,7 @@ Or run the complete local check target:
1028
1037
 
1029
1038
  make check
1030
1039
 
1031
- Tests run on Python 3.10 through 3.13 in GitHub Actions. Bug reports and
1040
+ Tests run on Python 3.11 through 3.13 in GitHub Actions. Bug reports and
1032
1041
  feature proposals are welcome through the
1033
1042
  `issue tracker <https://github.com/MartinPdeS/PyFiberModes/issues>`_.
1034
1043
 
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.13.1'
22
- __version_tuple__ = version_tuple = (0, 13, 1)
21
+ __version__ = version = '0.13.2'
22
+ __version_tuple__ = version_tuple = (0, 13, 2)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -1,24 +1,16 @@
1
1
  """Vectorized electric and magnetic field evaluation on Cartesian grids."""
2
2
 
3
3
  import numpy
4
- from typing import Callable
4
+ from typing import Any, Callable
5
5
  import scipy
6
6
  import numpy as np
7
7
  from PyFiberModes.mode_instances import HE11
8
8
  from PyFiberModes.mode import Mode
9
9
  from dataclasses import dataclass
10
- import matplotlib.pyplot as plt
11
- from matplotlib.colors import LinearSegmentedColormap
12
10
  from PyFiberModes.coordinates import CartesianCoordinates
13
11
  from PyFiberModes.coordinates import CylindricalCoordinates as CylindricalCoordinates # noqa: F401
14
12
 
15
13
 
16
- BLUE_BLACK_RED = LinearSegmentedColormap.from_list(
17
- "blue_black_red",
18
- ("#2455a4", "#000000", "#d73027"),
19
- )
20
-
21
-
22
14
  @dataclass
23
15
  class Field:
24
16
  """
@@ -1167,10 +1159,12 @@ class Field:
1167
1159
  return overlap(self, other)
1168
1160
 
1169
1161
  def plot(
1170
- self, plot_type: list = (), show: bool = True, save_filename: str = None
1171
- ) -> plt.Figure:
1172
- """
1173
- Plotting function.
1162
+ self,
1163
+ plot_type: list[str] | tuple[str, ...] = (),
1164
+ show: bool = True,
1165
+ save_filename: str | None = None,
1166
+ ) -> Any:
1167
+ """Plot selected field components using the optional plotting layer.
1174
1168
 
1175
1169
  Parameters
1176
1170
  ----------
@@ -1184,32 +1178,22 @@ class Field:
1184
1178
 
1185
1179
  Returns
1186
1180
  -------
1187
- plt.Figure
1181
+ matplotlib.figure.Figure
1188
1182
  The matplotlib Figure object created or used for the plot.
1189
- """
1190
- with plt.style.context("default"):
1191
- figure, axes = plt.subplots(1, len(plot_type))
1192
-
1193
- axes = np.atleast_1d(axes)
1194
- fields = self.get_components(components=plot_type)
1195
- for ax, field_string in zip(axes, plot_type):
1196
- ax.set_aspect("equal")
1197
- field = fields[field_string]
1198
- field = numpy.real_if_close(field)
1199
- if numpy.iscomplexobj(field):
1200
- field = numpy.abs(field)
1201
- max_abs = abs(max(field.max(), field.min()))
1202
- ax.pcolormesh(field, vmin=-max_abs, vmax=max_abs, cmap=BLUE_BLACK_RED)
1203
1183
 
1204
- figure.tight_layout()
1205
-
1206
- if save_filename:
1207
- figure.savefig(save_filename)
1208
-
1209
- if show:
1210
- plt.show()
1184
+ Raises
1185
+ ------
1186
+ ImportError
1187
+ If the optional plotting dependencies are not installed.
1188
+ """
1189
+ from PyFiberModes.plotting import plot_field
1211
1190
 
1212
- return figure
1191
+ return plot_field(
1192
+ self,
1193
+ plot_type=plot_type,
1194
+ show=show,
1195
+ save_filename=save_filename,
1196
+ )
1213
1197
 
1214
1198
 
1215
1199
  # -
@@ -0,0 +1,79 @@
1
+ """Optional Matplotlib visualizations for fiber-mode results."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING
6
+
7
+ import numpy as np
8
+
9
+ if TYPE_CHECKING:
10
+ from matplotlib.figure import Figure
11
+
12
+ from PyFiberModes.field import Field
13
+
14
+
15
+ def plot_field(
16
+ field: "Field",
17
+ plot_type: list[str] | tuple[str, ...] = (),
18
+ show: bool = True,
19
+ save_filename: str | None = None,
20
+ ) -> "Figure":
21
+ """Plot selected components of a computed modal field.
22
+
23
+ Parameters
24
+ ----------
25
+ field : Field
26
+ Modal field whose components will be rendered.
27
+ plot_type : list of str or tuple of str, optional
28
+ Names of the field components to plot.
29
+ show : bool, optional
30
+ Display the figure interactively after rendering.
31
+ save_filename : str, optional
32
+ Destination at which to save the rendered figure.
33
+
34
+ Returns
35
+ -------
36
+ matplotlib.figure.Figure
37
+ Figure containing one axis per requested component.
38
+
39
+ Raises
40
+ ------
41
+ ImportError
42
+ If Matplotlib is not installed.
43
+ ValueError
44
+ If no field components are requested.
45
+ """
46
+ try:
47
+ import matplotlib.pyplot as plt
48
+ from matplotlib.colors import LinearSegmentedColormap
49
+ except ImportError as error:
50
+ raise ImportError(
51
+ "Field plotting requires the optional plotting dependencies. "
52
+ "Install them with `python -m pip install 'PyFiberModes[plotting]'`."
53
+ ) from error
54
+
55
+ if not plot_type:
56
+ raise ValueError("plot_type must contain at least one field component")
57
+
58
+ color_map = LinearSegmentedColormap.from_list(
59
+ "blue_black_red",
60
+ ("#2455a4", "#000000", "#d73027"),
61
+ )
62
+ with plt.style.context("default"):
63
+ figure, axes = plt.subplots(1, len(plot_type))
64
+
65
+ components = field.get_components(components=plot_type)
66
+ for axis, component_name in zip(np.atleast_1d(axes), plot_type):
67
+ axis.set_aspect("equal")
68
+ values = np.real_if_close(components[component_name])
69
+ if np.iscomplexobj(values):
70
+ values = np.abs(values)
71
+ maximum = float(np.max(np.abs(values)))
72
+ axis.pcolormesh(values, vmin=-maximum, vmax=maximum, cmap=color_map)
73
+
74
+ figure.tight_layout()
75
+ if save_filename:
76
+ figure.savefig(save_filename)
77
+ if show:
78
+ plt.show()
79
+ return figure
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyFiberModes
3
- Version: 0.13.1
4
- Summary: A package for light propagation in fiber optics.
3
+ Version: 0.13.2
4
+ Summary: Guided-mode analysis and design for circular optical fibers.
5
5
  Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
7
7
  Version 3, 29 June 2007
@@ -682,9 +682,10 @@ Project-URL: Homepage, https://github.com/MartinPdeS/PyFiberModes
682
682
  Project-URL: Repository, https://github.com/MartinPdeS/PyFiberModes
683
683
  Project-URL: Issues, https://github.com/MartinPdeS/PyFiberModes/issues
684
684
  Project-URL: Documentation, https://martinpdes.github.io/PyFiberModes/
685
- Keywords: finit-difference,matrix
685
+ Keywords: fiber optics,guided modes,mode solver,optical waveguides,photonics,dispersion,coupled-mode theory
686
686
  Classifier: Programming Language :: Python
687
687
  Classifier: Programming Language :: Python :: 3
688
+ Classifier: Programming Language :: Python :: 3 :: Only
688
689
  Classifier: Programming Language :: Python :: 3.11
689
690
  Classifier: Programming Language :: Python :: 3.12
690
691
  Classifier: Programming Language :: Python :: 3.13
@@ -693,12 +694,11 @@ Classifier: Development Status :: 4 - Beta
693
694
  Classifier: Topic :: Scientific/Engineering :: Physics
694
695
  Classifier: License :: OSI Approved :: MIT License
695
696
  Classifier: Intended Audience :: Science/Research
696
- Requires-Python: >=3.10
697
+ Requires-Python: >=3.11
697
698
  Description-Content-Type: text/x-rst
698
699
  License-File: LICENSE
699
700
  Requires-Dist: PyOptik<3,>=2
700
701
  Requires-Dist: PyFinitDiff
701
- Requires-Dist: matplotlib>=3.8
702
702
  Requires-Dist: pyyaml
703
703
  Requires-Dist: numpy
704
704
  Requires-Dist: scipy
@@ -708,10 +708,13 @@ Requires-Dist: pytest-cov<8,>=2; extra == "testing"
708
708
  Requires-Dist: pytest-json-report~=1.5; extra == "testing"
709
709
  Requires-Dist: coverage~=7.6; extra == "testing"
710
710
  Requires-Dist: ruff<1,>=0.8; extra == "testing"
711
- Requires-Dist: tomli<3,>=2; python_version < "3.11" and extra == "testing"
711
+ Requires-Dist: matplotlib>=3.8; extra == "testing"
712
+ Provides-Extra: plotting
713
+ Requires-Dist: matplotlib>=3.8; extra == "plotting"
712
714
  Provides-Extra: benchmarking
713
715
  Requires-Dist: pytest-benchmark<6,>=5; extra == "benchmarking"
714
716
  Provides-Extra: documentation
717
+ Requires-Dist: matplotlib>=3.8; extra == "documentation"
715
718
  Requires-Dist: numpydoc==1.10.0; extra == "documentation"
716
719
  Requires-Dist: sphinx>=5.1.1; extra == "documentation"
717
720
  Requires-Dist: sphinx-gallery==0.21.0; extra == "documentation"
@@ -784,13 +787,19 @@ Features
784
787
  Installation
785
788
  ------------
786
789
 
787
- PyFiberModes requires Python 3.10 or newer. Install the released package from
790
+ PyFiberModes requires Python 3.11 or newer. Install the released package from
788
791
  PyPI:
789
792
 
790
793
  .. code-block:: bash
791
794
 
792
795
  python -m pip install PyFiberModes
793
796
 
797
+ Matplotlib-based field visualizations are optional:
798
+
799
+ .. code-block:: bash
800
+
801
+ python -m pip install "PyFiberModes[plotting]"
802
+
794
803
  or from Anaconda:
795
804
 
796
805
  .. code-block:: bash
@@ -1028,7 +1037,7 @@ Or run the complete local check target:
1028
1037
 
1029
1038
  make check
1030
1039
 
1031
- Tests run on Python 3.10 through 3.13 in GitHub Actions. Bug reports and
1040
+ Tests run on Python 3.11 through 3.13 in GitHub Actions. Bug reports and
1032
1041
  feature proposals are welcome through the
1033
1042
  `issue tracker <https://github.com/MartinPdeS/PyFiberModes/issues>`_.
1034
1043
 
@@ -32,6 +32,7 @@ PyFiberModes/mode.py
32
32
  PyFiberModes/mode_instances.py
33
33
  PyFiberModes/models.py
34
34
  PyFiberModes/optimization.py
35
+ PyFiberModes/plotting.py
35
36
  PyFiberModes/propagation.py
36
37
  PyFiberModes/services.py
37
38
  PyFiberModes/source.py
@@ -1,6 +1,5 @@
1
1
  PyOptik<3,>=2
2
2
  PyFinitDiff
3
- matplotlib>=3.8
4
3
  pyyaml
5
4
  numpy
6
5
  scipy
@@ -12,6 +11,7 @@ pytest-benchmark<6,>=5
12
11
  ruff<1,>=0.8
13
12
 
14
13
  [documentation]
14
+ matplotlib>=3.8
15
15
  numpydoc==1.10.0
16
16
  sphinx>=5.1.1
17
17
  sphinx-gallery==0.21.0
@@ -19,12 +19,13 @@ sphinx-design<1,>=0.6
19
19
  sphinx-rtd-theme==3.1.0
20
20
  pydata-sphinx-theme==0.17.1
21
21
 
22
+ [plotting]
23
+ matplotlib>=3.8
24
+
22
25
  [testing]
23
26
  pytest<10.0,>=7.4
24
27
  pytest-cov<8,>=2
25
28
  pytest-json-report~=1.5
26
29
  coverage~=7.6
27
30
  ruff<1,>=0.8
28
-
29
- [testing:python_version < "3.11"]
30
- tomli<3,>=2
31
+ matplotlib>=3.8
@@ -60,13 +60,19 @@ Features
60
60
  Installation
61
61
  ------------
62
62
 
63
- PyFiberModes requires Python 3.10 or newer. Install the released package from
63
+ PyFiberModes requires Python 3.11 or newer. Install the released package from
64
64
  PyPI:
65
65
 
66
66
  .. code-block:: bash
67
67
 
68
68
  python -m pip install PyFiberModes
69
69
 
70
+ Matplotlib-based field visualizations are optional:
71
+
72
+ .. code-block:: bash
73
+
74
+ python -m pip install "PyFiberModes[plotting]"
75
+
70
76
  or from Anaconda:
71
77
 
72
78
  .. code-block:: bash
@@ -304,7 +310,7 @@ Or run the complete local check target:
304
310
 
305
311
  make check
306
312
 
307
- Tests run on Python 3.10 through 3.13 in GitHub Actions. Bug reports and
313
+ Tests run on Python 3.11 through 3.13 in GitHub Actions. Bug reports and
308
314
  feature proposals are welcome through the
309
315
  `issue tracker <https://github.com/MartinPdeS/PyFiberModes/issues>`_.
310
316
 
@@ -1,6 +1,6 @@
1
1
  package:
2
2
  name: pyfibermodes
3
- version: 0.13.1
3
+ version: 0.13.2
4
4
 
5
5
  source:
6
6
  path: ../
@@ -16,37 +16,41 @@ channels:
16
16
 
17
17
  requirements:
18
18
  host:
19
- - python {{ PY_VER }}*
19
+ - python >=3.11
20
20
  - setuptools >=40.8.0
21
21
  - wheel
22
22
  - setuptools-scm >=8.0
23
23
  - pip
24
24
  run:
25
+ - python >=3.11
25
26
  - martinpdes::pyfinitdiff
26
27
  - martinpdes::pyoptik >=2,<3
27
28
  - pyyaml
28
- - matplotlib
29
29
  - numpy
30
30
  - scipy
31
31
 
32
32
  about:
33
33
  home: https://github.com/MartinPdeS/PyFiberModes
34
34
  license: MIT
35
- summary: "A package for exact fiber optics mode solving."
36
- description: PyFiberModes is a package that solves cymetrically symmetric fiber optics propagation modes.
35
+ summary: "Guided-mode analysis and design for circular optical fibers."
36
+ description: PyFiberModes solves guided modes in circularly symmetric step-index and multilayer optical fibers.
37
37
  dev_url: https://github.com/MartinPdeS/PyFiberModes
38
- doc_url: https://PyFiberModes.readthedocs.io
38
+ doc_url: https://martinpdes.github.io/PyFiberModes/
39
39
  license_file: LICENSE
40
40
  keywords:
41
- - optics
42
- - refractive index
43
- - fiber
41
+ - fiber optics
42
+ - guided modes
43
+ - mode solver
44
+ - optical waveguides
45
+ - photonics
46
+ - dispersion
44
47
 
45
48
  test:
46
49
  imports:
47
50
  - PyFiberModes
48
51
  requires:
49
- - python {{ PY_VER }}*
52
+ - python >=3.11
53
+ - matplotlib>=3.8
50
54
  - pytest>=0.6
51
55
  - pytest-cov>=2.0
52
56
  - pytest-json-report==1.5.0
@@ -4,15 +4,16 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PyFiberModes"
7
- version = "0.13.1"
8
- description = "A package for light propagation in fiber optics."
7
+ version = "0.13.2"
8
+ description = "Guided-mode analysis and design for circular optical fibers."
9
9
  license = {file = "LICENSE"}
10
10
  readme = "README.rst"
11
- requires-python = ">=3.10"
11
+ requires-python = ">=3.11"
12
12
  authors = [{ name="Martin Poinsinet de Sivry-Houle", email="martin.poinsinet.de.sivry@gmail.com"}]
13
13
  classifiers = [
14
14
  'Programming Language :: Python',
15
15
  'Programming Language :: Python :: 3',
16
+ 'Programming Language :: Python :: 3 :: Only',
16
17
  'Programming Language :: Python :: 3.11',
17
18
  'Programming Language :: Python :: 3.12',
18
19
  'Programming Language :: Python :: 3.13',
@@ -23,12 +24,19 @@ classifiers = [
23
24
  'Intended Audience :: Science/Research',
24
25
  ]
25
26
 
26
- keywords = ["finit-difference", "matrix"]
27
+ keywords = [
28
+ "fiber optics",
29
+ "guided modes",
30
+ "mode solver",
31
+ "optical waveguides",
32
+ "photonics",
33
+ "dispersion",
34
+ "coupled-mode theory",
35
+ ]
27
36
 
28
37
  dependencies = [
29
38
  "PyOptik>=2,<3",
30
39
  "PyFinitDiff",
31
- "matplotlib>=3.8",
32
40
  "pyyaml",
33
41
  "numpy",
34
42
  "scipy",
@@ -57,7 +65,11 @@ testing = [
57
65
  "pytest-json-report ~=1.5",
58
66
  "coverage ~=7.6",
59
67
  "ruff>=0.8,<1",
60
- "tomli>=2,<3; python_version<'3.11'",
68
+ "matplotlib>=3.8",
69
+ ]
70
+
71
+ plotting = [
72
+ "matplotlib>=3.8",
61
73
  ]
62
74
 
63
75
  benchmarking = [
@@ -66,6 +78,7 @@ benchmarking = [
66
78
 
67
79
 
68
80
  documentation = [
81
+ "matplotlib>=3.8",
69
82
  "numpydoc ==1.10.0",
70
83
  "sphinx >=5.1.1",
71
84
  "sphinx-gallery ==0.21.0",
@@ -79,7 +92,7 @@ dev = [
79
92
  ]
80
93
 
81
94
  [tool.ruff]
82
- target-version = "py310"
95
+ target-version = "py311"
83
96
  line-length = 100
84
97
 
85
98
  [tool.ruff.lint]
@@ -1,13 +1,11 @@
1
1
  from pathlib import Path
2
+ import subprocess
2
3
  import sys
3
4
 
4
5
  import PyFiberModes
5
6
  from PyFiberModes import directories
6
7
 
7
- if sys.version_info >= (3, 11):
8
- import tomllib
9
- else:
10
- import tomli as tomllib
8
+ import tomllib
11
9
 
12
10
 
13
11
  def test_directory_locations_are_derived_from_module_location():
@@ -33,4 +31,29 @@ def test_mpsplots_is_not_a_declared_dependency():
33
31
 
34
32
  assert not any("mpsplots" in dependency for dependency in dependencies)
35
33
  assert "mpsplots" not in conda_recipe
36
- assert any(dependency.startswith("matplotlib") for dependency in dependencies)
34
+ assert not any(dependency.startswith("matplotlib") for dependency in dependencies)
35
+ assert any(
36
+ dependency.startswith("matplotlib")
37
+ for dependency in pyproject["project"]["optional-dependencies"]["plotting"]
38
+ )
39
+
40
+
41
+ def test_importing_core_does_not_import_plotting_module():
42
+ """Keep the package plotting module outside the core import graph."""
43
+ script = """
44
+ import sys
45
+ import types
46
+
47
+ pyoptik = types.ModuleType("PyOptik")
48
+ pyoptik.MaterialBank = object
49
+ sys.modules["PyOptik"] = pyoptik
50
+
51
+ import PyFiberModes
52
+
53
+ assert "PyFiberModes.plotting" not in sys.modules
54
+ """
55
+ subprocess.run(
56
+ [sys.executable, "-c", script],
57
+ cwd=directories.PROJECT_PATH,
58
+ check=True,
59
+ )
@@ -7,10 +7,7 @@ from pathlib import Path
7
7
  import re
8
8
  import subprocess
9
9
  import sys
10
- try:
11
- import tomllib
12
- except ImportError: # pragma: no cover - exercised by the Python 3.10 CI job
13
- import tomli as tomllib
10
+ import tomllib
14
11
 
15
12
  ROOT = Path(__file__).resolve().parents[1]
16
13
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes