BornSim 0.7.0__tar.gz → 0.8.0__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 (152) hide show
  1. {bornsim-0.7.0 → bornsim-0.8.0}/.zenodo.json +2 -2
  2. {bornsim-0.7.0 → bornsim-0.8.0/BornSim.egg-info}/PKG-INFO +4 -1
  3. {bornsim-0.7.0 → bornsim-0.8.0}/BornSim.egg-info/SOURCES.txt +7 -4
  4. {bornsim-0.7.0 → bornsim-0.8.0}/BornSim.egg-info/requires.txt +4 -0
  5. {bornsim-0.7.0 → bornsim-0.8.0}/CITATION.cff +1 -1
  6. {bornsim-0.7.0 → bornsim-0.8.0}/CONTRIBUTING.md +18 -0
  7. {bornsim-0.7.0/BornSim.egg-info → bornsim-0.8.0}/PKG-INFO +4 -1
  8. bornsim-0.8.0/bornsim/_version.py +5 -0
  9. {bornsim-0.7.0 → bornsim-0.8.0}/conda.recipe/meta.yaml +1 -1
  10. bornsim-0.8.0/docs/examples/born_orders/README.rst +10 -0
  11. bornsim-0.8.0/docs/examples/born_orders/contrast_sensitivity.py +66 -0
  12. bornsim-0.8.0/docs/examples/born_orders/coupled_spheres.py +84 -0
  13. bornsim-0.8.0/docs/examples/born_orders/wavelength_corrections.py +70 -0
  14. bornsim-0.8.0/docs/examples/results/README.rst +10 -0
  15. bornsim-0.8.0/docs/examples/results/angular_cut_and_full.py +75 -0
  16. bornsim-0.8.0/docs/examples/results/cross_section_and_volume.py +75 -0
  17. bornsim-0.8.0/docs/examples/results/phase_normalization.py +73 -0
  18. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/examples.rst +19 -1
  19. {bornsim-0.7.0 → bornsim-0.8.0}/makefile +4 -4
  20. {bornsim-0.7.0 → bornsim-0.8.0}/pyproject.toml +10 -2
  21. {bornsim-0.7.0 → bornsim-0.8.0}/tests/packaging/test_release_tools.py +8 -9
  22. bornsim-0.7.0/bornsim/_version.py +0 -1
  23. bornsim-0.7.0/docs/examples/born_orders/README.rst +0 -5
  24. bornsim-0.7.0/docs/examples/results/README.rst +0 -5
  25. bornsim-0.7.0/tools/check_release.py +0 -115
  26. bornsim-0.7.0/tools/next_release_version.py +0 -81
  27. bornsim-0.7.0/tools/release_tag.py +0 -208
  28. {bornsim-0.7.0 → bornsim-0.8.0}/.coveragerc +0 -0
  29. {bornsim-0.7.0 → bornsim-0.8.0}/.pre-commit-config.yaml +0 -0
  30. {bornsim-0.7.0 → bornsim-0.8.0}/BornSim.egg-info/dependency_links.txt +0 -0
  31. {bornsim-0.7.0 → bornsim-0.8.0}/BornSim.egg-info/top_level.txt +0 -0
  32. {bornsim-0.7.0 → bornsim-0.8.0}/LICENSE +0 -0
  33. {bornsim-0.7.0 → bornsim-0.8.0}/MANIFEST.in +0 -0
  34. {bornsim-0.7.0 → bornsim-0.8.0}/README.rst +0 -0
  35. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/__init__.py +0 -0
  36. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/angular_data.py +0 -0
  37. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/api.py +0 -0
  38. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/convergence.py +0 -0
  39. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/directions.py +0 -0
  40. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/ensemble.py +0 -0
  41. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/ensemble_sampling.py +0 -0
  42. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/geometry.py +0 -0
  43. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/green.py +0 -0
  44. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/grid.py +0 -0
  45. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/material.py +0 -0
  46. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/__init__.py +0 -0
  47. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/base.py +0 -0
  48. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/particles/__init__.py +0 -0
  49. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/particles/core_shell.py +0 -0
  50. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/particles/cylinder.py +0 -0
  51. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/particles/ellipsoid.py +0 -0
  52. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/particles/spheres.py +0 -0
  53. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/random/__init__.py +0 -0
  54. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/random/fields.py +0 -0
  55. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/random_medium.py +0 -0
  56. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/random_spheres.py +0 -0
  57. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/structured/__init__.py +0 -0
  58. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/structured/composite.py +0 -0
  59. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/medium/structured/periodic.py +0 -0
  60. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/results.py +0 -0
  61. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/rotation.py +0 -0
  62. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/sampling.py +0 -0
  63. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/series.py +0 -0
  64. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/solver.py +0 -0
  65. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/source.py +0 -0
  66. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/units.py +0 -0
  67. {bornsim-0.7.0 → bornsim-0.8.0}/bornsim/volume.py +0 -0
  68. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/README.rst +0 -0
  69. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/born_orders/absorbing_random_medium.py +0 -0
  70. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/born_orders/born_interference.py +0 -0
  71. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/born_orders/compare_orders.py +0 -0
  72. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/random_media/README.rst +0 -0
  73. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/random_media/covariance_models.py +0 -0
  74. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/random_media/phase_function.py +0 -0
  75. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/random_media/random_medium.py +0 -0
  76. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/random_media/random_spheres.py +0 -0
  77. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/random_media/theory_random_fields.py +0 -0
  78. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/random_media/wavelength_dependence.py +0 -0
  79. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/results/coherent_diffuse.py +0 -0
  80. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/results/result_plots.py +0 -0
  81. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/results/save_load_results.py +0 -0
  82. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/structured_media/README.rst +0 -0
  83. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/structured_media/antenna_rods.py +0 -0
  84. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/structured_media/dielectric_sphere.py +0 -0
  85. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/structured_media/particle_families.py +0 -0
  86. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/structured_media/periodic_array.py +0 -0
  87. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/structured_media/structured_media.py +0 -0
  88. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/structured_media/theory_directional_interference.py +0 -0
  89. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/validation/README.rst +0 -0
  90. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/validation/absorbing_sphere_balance.py +0 -0
  91. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/validation/angular_convergence.py +0 -0
  92. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/validation/convergence_reports.py +0 -0
  93. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/validation/ensemble_sampling.py +0 -0
  94. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/validation/finite_size_comparison.py +0 -0
  95. {bornsim-0.7.0 → bornsim-0.8.0}/docs/examples/validation/grid_refinement.py +0 -0
  96. {bornsim-0.7.0 → bornsim-0.8.0}/docs/images/bornsim_medium_opacity_3d.png +0 -0
  97. {bornsim-0.7.0 → bornsim-0.8.0}/docs/images/bornsim_spf_surface_3d.png +0 -0
  98. {bornsim-0.7.0 → bornsim-0.8.0}/docs/images/branding-prompts.rst +0 -0
  99. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/_static/favicon.png +0 -0
  100. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/_static/favicon.svg +0 -0
  101. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/_static/icon.png +0 -0
  102. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/_static/logo.png +0 -0
  103. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/_static/logo.svg +0 -0
  104. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/_static/phase_function.svg +0 -0
  105. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/absorption.rst +0 -0
  106. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/api.rst +0 -0
  107. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/conf.py +0 -0
  108. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/development.rst +0 -0
  109. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/gallery_config.py +0 -0
  110. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/getting_started.rst +0 -0
  111. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/guide.rst +0 -0
  112. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/index.rst +0 -0
  113. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/medium_visualization.rst +0 -0
  114. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/overview.rst +0 -0
  115. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/reliability.rst +0 -0
  116. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/research.rst +0 -0
  117. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/resources.rst +0 -0
  118. {bornsim-0.7.0 → bornsim-0.8.0}/docs/source/theory.rst +0 -0
  119. {bornsim-0.7.0 → bornsim-0.8.0}/pytest.ini +0 -0
  120. {bornsim-0.7.0 → bornsim-0.8.0}/setup.cfg +0 -0
  121. {bornsim-0.7.0 → bornsim-0.8.0}/tests/analytical/mie_reference.py +0 -0
  122. {bornsim-0.7.0 → bornsim-0.8.0}/tests/analytical/reference.py +0 -0
  123. {bornsim-0.7.0 → bornsim-0.8.0}/tests/analytical/test_absorbing_mie.py +0 -0
  124. {bornsim-0.7.0 → bornsim-0.8.0}/tests/analytical/test_model.py +0 -0
  125. {bornsim-0.7.0 → bornsim-0.8.0}/tests/analytical/test_numerical_reference.py +0 -0
  126. {bornsim-0.7.0 → bornsim-0.8.0}/tests/conftest.py +0 -0
  127. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_absorption.py +0 -0
  128. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_api.py +0 -0
  129. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_api_keywords.py +0 -0
  130. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_api_ownership.py +0 -0
  131. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_api_scope.py +0 -0
  132. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_configuration.py +0 -0
  133. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_directional_api.py +0 -0
  134. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_directions.py +0 -0
  135. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_engine.py +0 -0
  136. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_explicit_physics.py +0 -0
  137. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_geometry.py +0 -0
  138. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_media.py +0 -0
  139. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_medium_composition.py +0 -0
  140. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_medium_families.py +0 -0
  141. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_medium_metadata.py +0 -0
  142. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_plot_contract.py +0 -0
  143. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_random_spheres.py +0 -0
  144. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_reliability.py +0 -0
  145. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_result.py +0 -0
  146. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_result_contract.py +0 -0
  147. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_rotation.py +0 -0
  148. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_series.py +0 -0
  149. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_unit_contract.py +0 -0
  150. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_units.py +0 -0
  151. {bornsim-0.7.0 → bornsim-0.8.0}/tests/numerical/test_volume_plotting.py +0 -0
  152. {bornsim-0.7.0 → bornsim-0.8.0}/tools/check_wheel.py +0 -0
@@ -8,11 +8,11 @@
8
8
  }
9
9
  ],
10
10
  "license": "mit",
11
- "version": "0.7.0",
11
+ "version": "0.8.0",
12
12
  "keywords": [
13
13
  "Born approximation",
14
14
  "light scattering",
15
15
  "random media"
16
16
  ],
17
- "publication_date": "2026-10-23"
17
+ "publication_date": "2026-10-25"
18
18
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: BornSim
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: Vector Born-series scattering from continuous random dielectric media
5
5
  Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
6
6
  License-Expression: MIT
@@ -23,7 +23,10 @@ Requires-Dist: TypedUnit>=0.2.9
23
23
  Requires-Dist: pint<0.26,>=0.24
24
24
  Requires-Dist: matplotlib<4,>=3.7
25
25
  Requires-Dist: plotly<7,>=6
26
+ Provides-Extra: release
27
+ Requires-Dist: martinpdes-maintenance==0.2.2; extra == "release"
26
28
  Provides-Extra: testing
29
+ Requires-Dist: martinpdes-maintenance==0.2.2; extra == "testing"
27
30
  Requires-Dist: pytest<10,>=8; extra == "testing"
28
31
  Requires-Dist: pytest-cov<8,>=5; extra == "testing"
29
32
  Provides-Extra: test
@@ -54,6 +54,9 @@ docs/examples/born_orders/README.rst
54
54
  docs/examples/born_orders/absorbing_random_medium.py
55
55
  docs/examples/born_orders/born_interference.py
56
56
  docs/examples/born_orders/compare_orders.py
57
+ docs/examples/born_orders/contrast_sensitivity.py
58
+ docs/examples/born_orders/coupled_spheres.py
59
+ docs/examples/born_orders/wavelength_corrections.py
57
60
  docs/examples/random_media/README.rst
58
61
  docs/examples/random_media/covariance_models.py
59
62
  docs/examples/random_media/phase_function.py
@@ -62,7 +65,10 @@ docs/examples/random_media/random_spheres.py
62
65
  docs/examples/random_media/theory_random_fields.py
63
66
  docs/examples/random_media/wavelength_dependence.py
64
67
  docs/examples/results/README.rst
68
+ docs/examples/results/angular_cut_and_full.py
65
69
  docs/examples/results/coherent_diffuse.py
70
+ docs/examples/results/cross_section_and_volume.py
71
+ docs/examples/results/phase_normalization.py
66
72
  docs/examples/results/result_plots.py
67
73
  docs/examples/results/save_load_results.py
68
74
  docs/examples/structured_media/README.rst
@@ -135,7 +141,4 @@ tests/numerical/test_unit_contract.py
135
141
  tests/numerical/test_units.py
136
142
  tests/numerical/test_volume_plotting.py
137
143
  tests/packaging/test_release_tools.py
138
- tools/check_release.py
139
- tools/check_wheel.py
140
- tools/next_release_version.py
141
- tools/release_tag.py
144
+ tools/check_wheel.py
@@ -14,9 +14,13 @@ pre-commit<5,>=4
14
14
  [documentation]
15
15
  MartinPdeS-docs<0.3,>=0.2.5
16
16
 
17
+ [release]
18
+ martinpdes-maintenance==0.2.2
19
+
17
20
  [test]
18
21
  BornSim[testing]
19
22
 
20
23
  [testing]
24
+ martinpdes-maintenance==0.2.2
21
25
  pytest<10,>=8
22
26
  pytest-cov<8,>=5
@@ -2,7 +2,7 @@ cff-version: 1.2.0
2
2
  message: "If you use BornSim in research, please cite the software version used."
3
3
  title: "BornSim"
4
4
  type: software
5
- version: "0.7.0"
5
+ version: "0.8.0"
6
6
  authors:
7
7
  - family-names: "Poinsinet de Sivry-Houle"
8
8
  given-names: "Martin"
@@ -21,3 +21,21 @@ Install local hooks with `.venv/bin/pre-commit install`. Format changes with `ma
21
21
  Versions are declared in project metadata and checked across the package, citation, Zenodo and Conda files. Commit work before tagging. `make tag VERSION=v0.1.0` creates a local release commit and annotated tag. `make release patch`, `minor`, or `major` chooses a version above the highest semantic Git tag, aligns all metadata, commits, tags and pushes the resulting HEAD and that specific tag. These commands are never part of ordinary tests.
22
22
 
23
23
  CI builds/tests on Python 3.11–3.13 across Linux, macOS and Windows. The tag-triggered PyPI workflow requires the repository's `PYPI_API_TOKEN` secret. Documentation builds are checked by CI; hosting configuration is separate. Conda builds can be verified manually through the Conda workflow; no channel upload is configured. Remote repository creation and publishing credentials must be configured before publication.
24
+
25
+ ## Shared release versioning
26
+
27
+ Versions are explicit in `[project].version`; builds never derive versions from
28
+ Git. Install the pinned release tool in the interpreter used by Make:
29
+
30
+ ```sh
31
+ python -m pip install "martinpdes-maintenance==0.2.2"
32
+ make release-check PYTHON=python
33
+ ```
34
+
35
+ The `release` extra declares the same tool. The Makefile calls the installed module directly, and
36
+ `[tool.mps-maintenance]` declares the package's release files. Use
37
+ `python -m martinpdes_maintenance.cli tag vX.Y.Z --dry-run` to preview changes from a clean,
38
+ full checkout. The tool aligns configured metadata, commits, and creates an
39
+ annotated tag; it never pushes. Existing Makefile publishing shortcuts retain
40
+ their push behavior. Fetch remote tags first. With no release tags, `next` uses
41
+ the explicit project version as its starting point.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: BornSim
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: Vector Born-series scattering from continuous random dielectric media
5
5
  Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
6
6
  License-Expression: MIT
@@ -23,7 +23,10 @@ Requires-Dist: TypedUnit>=0.2.9
23
23
  Requires-Dist: pint<0.26,>=0.24
24
24
  Requires-Dist: matplotlib<4,>=3.7
25
25
  Requires-Dist: plotly<7,>=6
26
+ Provides-Extra: release
27
+ Requires-Dist: martinpdes-maintenance==0.2.2; extra == "release"
26
28
  Provides-Extra: testing
29
+ Requires-Dist: martinpdes-maintenance==0.2.2; extra == "testing"
27
30
  Requires-Dist: pytest<10,>=8; extra == "testing"
28
31
  Requires-Dist: pytest-cov<8,>=5; extra == "testing"
29
32
  Provides-Extra: test
@@ -0,0 +1,5 @@
1
+ """Release version maintained by martinpdes-maintenance."""
2
+
3
+ __version__ = version = "0.8.0"
4
+ __version_tuple__ = version_tuple = tuple(int(part) for part in version.split("."))
5
+ __commit_id__ = commit_id = None
@@ -1,6 +1,6 @@
1
1
  package:
2
2
  name: bornsim
3
- version: 0.7.0
3
+ version: "0.8.0"
4
4
 
5
5
  source:
6
6
  path: ..
@@ -0,0 +1,10 @@
1
+ Born orders and interference
2
+ ============================
3
+
4
+ Compare cumulative Born orders and inspect coherent amplitude interference.
5
+ Field-term diagnostics alone do not certify convergence.
6
+
7
+ Six examples cover order comparisons, term interference, absorption,
8
+ contrast sensitivity, wavelength dependence through fifth order, and coupling
9
+ between two spheres. Higher orders retain the linearized dielectric contrast
10
+ and spherical Green self cell; decreasing corrections do not certify convergence.
@@ -0,0 +1,66 @@
1
+ """
2
+ Contrast sensitivity of successive Born corrections
3
+ ===================================================
4
+
5
+ Compare positive and negative refractive index offsets at fixed geometry.
6
+ The first intensity is even in contrast; higher orders can break that symmetry.
7
+ All orders use linearized dielectric contrast and the spherical Green self cell.
8
+ These small examples illustrate corrections, not a universal convergence bound.
9
+ """
10
+
11
+ import matplotlib.pyplot as plt
12
+
13
+ from bornsim import Grid, Solver, Source, Sphere, StructuredMedium
14
+ from bornsim.units import ureg
15
+
16
+ grid = Grid(
17
+ shape=(12, 12, 12),
18
+ spacing=20 * ureg.nanometer,
19
+ )
20
+
21
+ # %%
22
+ source = Source(wavelength=633 * ureg.nanometer)
23
+
24
+ solver = Solver(
25
+ source=source,
26
+ order=4,
27
+ )
28
+
29
+ scattering_areas = []
30
+
31
+ for delta_refractive_index in (-0.04, -0.02, 0.02, 0.04):
32
+ sphere = Sphere(
33
+ radius=70 * ureg.nanometer,
34
+ refractive_index=1.33 + delta_refractive_index,
35
+ )
36
+
37
+ medium = StructuredMedium()
38
+
39
+ medium.add_background(refractive_index=1.33)
40
+
41
+ medium.add_structures(sphere)
42
+
43
+ volume = medium.to_volume(grid=grid)
44
+
45
+ volume.plot_slice(title=f"Refractive index offset {delta_refractive_index:+.2f}")
46
+
47
+ plt.show()
48
+
49
+ result = solver.solve(target=volume)
50
+
51
+ scattering_area = (result.mu_s * result.sample_volume).to("nanometer**2")
52
+
53
+ scattering_areas.append(scattering_area)
54
+
55
+ # %%
56
+ # Compare cumulative cross sections on the same scale.
57
+ figure, axis = plt.subplots(layout="constrained")
58
+
59
+ for delta_refractive_index, scattering_area in zip((-0.04, -0.02, 0.02, 0.04), scattering_areas, strict=True):
60
+ axis.plot(range(1, 5), scattering_area.magnitude, "o-", label=f"Offset {delta_refractive_index:+.2f}")
61
+
62
+ axis.set(xlabel="Cumulative Born order", ylabel="Scattering cross section (nm²)", xticks=range(1, 5))
63
+
64
+ axis.legend()
65
+
66
+ plt.show()
@@ -0,0 +1,84 @@
1
+ """
2
+ Higher-order coupling in a pair of spheres
3
+ ==========================================
4
+
5
+ Compare a jointly solved sphere pair with the coherent sum of isolated
6
+ sphere amplitudes. At first order these coincide. Higher orders in the joint
7
+ solve also include propagation between particles; isolated solves omit it.
8
+ The spheres do not overlap. This remains a linearized dielectric model.
9
+ """
10
+
11
+ import matplotlib.pyplot as plt
12
+ import numpy as np
13
+
14
+ from bornsim import Grid, Solver, Source, Sphere, StructuredMedium
15
+ from bornsim.units import ureg
16
+
17
+ grid = Grid(
18
+ shape=(12, 12, 12),
19
+ spacing=20 * ureg.nanometer,
20
+ )
21
+
22
+ left_sphere = Sphere(
23
+ radius=40 * ureg.nanometer,
24
+ refractive_index=1.37,
25
+ centre=[-60, 0, 0] * ureg.nanometer,
26
+ )
27
+
28
+ right_sphere = Sphere(
29
+ radius=40 * ureg.nanometer,
30
+ refractive_index=1.37,
31
+ centre=[60, 0, 0] * ureg.nanometer,
32
+ )
33
+
34
+ source = Source(wavelength=633 * ureg.nanometer)
35
+
36
+ solver = Solver(
37
+ source=source,
38
+ order=3,
39
+ )
40
+
41
+ angles = np.linspace(0, 180, 91) * ureg.degree
42
+
43
+ results = []
44
+
45
+ for structures in ((left_sphere,), (right_sphere,), (left_sphere, right_sphere)):
46
+ medium = StructuredMedium()
47
+
48
+ medium.add_background(refractive_index=1.33)
49
+
50
+ medium.add_structures(*structures)
51
+
52
+ volume = medium.to_volume(grid=grid)
53
+
54
+ volume.plot_slice()
55
+
56
+ plt.show()
57
+
58
+ result = solver.solve_cut(
59
+ target=volume,
60
+ angles=angles,
61
+ )
62
+
63
+ results.append(result)
64
+
65
+ # %%
66
+ # Compare amplitudes before squaring; average incident polarizations afterward.
67
+ independent_amplitudes = results[0].amplitudes + results[1].amplitudes
68
+
69
+ independent_intensity = np.mean(np.sum(abs(independent_amplitudes.to("nanometer").magnitude) ** 2, axis=-1), axis=-1)
70
+
71
+ joint_intensity = results[2].differential_cross_section.to("nanometer**2 / steradian").magnitude
72
+
73
+ figure, axis = plt.subplots(layout="constrained")
74
+
75
+ for order in (1, 3):
76
+ axis.plot(angles.magnitude, joint_intensity[order - 1], label=f"Joint, order {order}")
77
+
78
+ axis.plot(angles.magnitude, independent_intensity[order - 1], "--", label=f"Isolated amplitude sum, order {order}")
79
+
80
+ axis.set(xlabel="Scattering angle (degrees)", ylabel="Cross section (nm² sr⁻¹)")
81
+
82
+ axis.legend()
83
+
84
+ plt.show()
@@ -0,0 +1,70 @@
1
+ """
2
+ Wavelength dependence of higher-order corrections
3
+ =================================================
4
+
5
+ Keep one voxelized sphere fixed while changing vacuum wavelength.
6
+ Compare cumulative orders through fifth order using the same angular cut.
7
+ The material is nondispersive here: its refractive index is held fixed.
8
+ A small correction does not assess grid accuracy or the contrast approximation.
9
+ """
10
+
11
+ import matplotlib.pyplot as plt
12
+ import numpy as np
13
+
14
+ from bornsim import Grid, Solver, Source, Sphere, StructuredMedium
15
+ from bornsim.units import ureg
16
+
17
+ grid = Grid(
18
+ shape=(12, 12, 12),
19
+ spacing=20 * ureg.nanometer,
20
+ )
21
+
22
+ sphere = Sphere(
23
+ radius=70 * ureg.nanometer,
24
+ refractive_index=1.35,
25
+ )
26
+
27
+ medium = StructuredMedium()
28
+
29
+ medium.add_background(refractive_index=1.33)
30
+
31
+ medium.add_structures(sphere)
32
+
33
+ volume = medium.to_volume(grid=grid)
34
+
35
+ volume.plot_slice(title="Input sphere: central refractive index slice")
36
+
37
+ plt.show()
38
+
39
+ # %%
40
+ angles = np.linspace(0, 180, 91) * ureg.degree
41
+
42
+ figure, axes = plt.subplots(1, 3, figsize=(12, 3.5), layout="constrained")
43
+
44
+ for wavelength, axis in zip((450, 633, 850), axes, strict=True):
45
+ source = Source(wavelength=wavelength * ureg.nanometer)
46
+
47
+ solver = Solver(
48
+ source=source,
49
+ order=5,
50
+ )
51
+
52
+ result = solver.solve_cut(
53
+ target=volume,
54
+ angles=angles,
55
+ )
56
+
57
+ differential = result.differential_cross_section.to("nanometer**2 / steradian")
58
+
59
+ for order in (1, 2, 3, 5):
60
+ axis.plot(angles.magnitude, differential.magnitude[order - 1], label=f"Order {order}")
61
+
62
+ axis.set(
63
+ title=f"Vacuum wavelength {wavelength} nm",
64
+ xlabel="Scattering angle (degrees)",
65
+ ylabel="Cross section (nm² sr⁻¹)",
66
+ )
67
+
68
+ axis.legend()
69
+
70
+ plt.show()
@@ -0,0 +1,10 @@
1
+ Plotting and saving results
2
+ ===========================
3
+
4
+ Plot differential scattering and directional phase functions, then save and
5
+ restore unitful results with their calculation settings.
6
+
7
+ Six examples cover plotting, archives, coherent and diffuse scattering,
8
+ phase-density normalization, angular cuts versus full directional solves,
9
+ and the distinction between cross sections and box-normalized coefficients.
10
+ The calculations include second-, third-, and fourth-order solves.
@@ -0,0 +1,75 @@
1
+ """
2
+ Angular cuts and full directional results
3
+ =========================================
4
+
5
+ Compare a meridian cut with the matching meridian of a full solve through
6
+ second order. The cut keeps complex amplitudes but has no integrated scattering
7
+ coefficient. Full quadrature additionally supplies finite-sample coefficients.
8
+ Changing observation sampling does not change the internal Born field.
9
+ """
10
+
11
+ import matplotlib.pyplot as plt
12
+ import numpy as np
13
+
14
+ from bornsim import AngularSampling, Grid, Solver, Source, Sphere, StructuredMedium
15
+ from bornsim.units import ureg
16
+
17
+ grid = Grid(
18
+ shape=(12, 12, 12),
19
+ spacing=20 * ureg.nanometer,
20
+ )
21
+
22
+ sphere = Sphere(
23
+ radius=70 * ureg.nanometer,
24
+ refractive_index=1.35,
25
+ )
26
+
27
+ medium = StructuredMedium()
28
+
29
+ medium.add_background(refractive_index=1.33)
30
+
31
+ medium.add_structures(sphere)
32
+
33
+ volume = medium.to_volume(grid=grid)
34
+
35
+ volume.plot_slice(title="Input sphere: central refractive index slice")
36
+
37
+ plt.show()
38
+
39
+ # %%
40
+ source = Source(wavelength=633 * ureg.nanometer)
41
+
42
+ solver = Solver(
43
+ source=source,
44
+ order=2,
45
+ )
46
+
47
+ sampling = AngularSampling(
48
+ n_points=91,
49
+ polar_samples=24,
50
+ azimuth_samples=16,
51
+ )
52
+
53
+ full_result = solver.solve(
54
+ target=volume,
55
+ sampling=sampling,
56
+ )
57
+
58
+ cut_result = solver.solve_cut(
59
+ target=volume,
60
+ angles=full_result.angles,
61
+ )
62
+
63
+ meridian = full_result.meridian(azimuth=0 * ureg.degree)
64
+
65
+ relative_difference = np.max(abs(cut_result.differential.magnitude - meridian.differential.magnitude)) / np.max(
66
+ abs(cut_result.differential.magnitude)
67
+ )
68
+
69
+ print(f"Maximum relative meridian difference: {relative_difference:.3e}")
70
+
71
+ print(f"Full-solve finite-sample scattering coefficient: {full_result.mu_s}")
72
+
73
+ cut_result.plot_cross_section()
74
+
75
+ plt.show()
@@ -0,0 +1,75 @@
1
+ """
2
+ Cross sections and box-normalized coefficients
3
+ ==============================================
4
+
5
+ Pad one fixed physical sphere with background voxels at fixed spacing.
6
+ The box-normalized scattering coefficient changes with sample volume, while
7
+ its product with that volume is the scattering cross section. Padding tests
8
+ representation and normalization, not an infinite-medium transport limit.
9
+ """
10
+
11
+ import matplotlib.pyplot as plt
12
+
13
+ from bornsim import Grid, Solver, Source, Sphere, StructuredMedium
14
+ from bornsim.units import ureg
15
+
16
+ grid = Grid(
17
+ shape=(12, 12, 12),
18
+ spacing=20 * ureg.nanometer,
19
+ )
20
+
21
+ sphere = Sphere(
22
+ radius=70 * ureg.nanometer,
23
+ refractive_index=1.35,
24
+ )
25
+
26
+ medium = StructuredMedium()
27
+
28
+ medium.add_background(refractive_index=1.33)
29
+
30
+ medium.add_structures(sphere)
31
+
32
+ volume = medium.to_volume(grid=grid)
33
+
34
+ volume.plot_slice(title="Input sphere: central refractive index slice")
35
+
36
+ plt.show()
37
+
38
+ # %%
39
+ source = Source(wavelength=633 * ureg.nanometer)
40
+
41
+ solver = Solver(
42
+ source=source,
43
+ order=4,
44
+ )
45
+
46
+ figure, axes = plt.subplots(1, 2, figsize=(10, 4), layout="constrained")
47
+
48
+ for count in (10, 12, 16):
49
+ grid = Grid(
50
+ shape=(count, count, count),
51
+ spacing=20 * ureg.nanometer,
52
+ )
53
+
54
+ volume = medium.to_volume(grid=grid)
55
+
56
+ result = solver.solve(target=volume)
57
+
58
+ scattering_area = (result.mu_s * result.sample_volume).to("nanometer**2")
59
+
60
+ axes[0].plot(range(1, 5), result.mu_s.to("1 / meter").magnitude, "o-", label=f"{count}³ box")
61
+
62
+ axes[1].plot(range(1, 5), scattering_area.magnitude, "o-", label=f"{count}³ box")
63
+
64
+ print(f"Box {count}³, fourth-order scattering cross section: {scattering_area[-1]}")
65
+
66
+ axes[0].set(ylabel="Box-normalized coefficient (m⁻¹)")
67
+
68
+ axes[1].set(ylabel="Scattering cross section (nm²)")
69
+
70
+ for axis in axes:
71
+ axis.set(xlabel="Cumulative Born order", xticks=range(1, 5))
72
+
73
+ axis.legend()
74
+
75
+ plt.show()
@@ -0,0 +1,73 @@
1
+ """
2
+ Phase density and polar-angle probability
3
+ =========================================
4
+
5
+ A phase function is a density per steradian. After explicit azimuth averaging,
6
+ 2*pi*p(theta)*sin(theta) is the polar-angle probability density per radian.
7
+ Full solid-angle sampling supplies normalization separately at each Born order.
8
+ An angular cut alone cannot provide this normalization.
9
+ """
10
+
11
+ import matplotlib.pyplot as plt
12
+ import numpy as np
13
+
14
+ from bornsim import Grid, Solver, Source, Sphere, StructuredMedium
15
+ from bornsim.units import ureg
16
+
17
+ grid = Grid(
18
+ shape=(12, 12, 12),
19
+ spacing=20 * ureg.nanometer,
20
+ )
21
+
22
+ sphere = Sphere(
23
+ radius=70 * ureg.nanometer,
24
+ refractive_index=1.35,
25
+ )
26
+
27
+ medium = StructuredMedium()
28
+
29
+ medium.add_background(refractive_index=1.33)
30
+
31
+ medium.add_structures(sphere)
32
+
33
+ volume = medium.to_volume(grid=grid)
34
+
35
+ volume.plot_slice(title="Input sphere: central refractive index slice")
36
+
37
+ plt.show()
38
+
39
+ # %%
40
+ source = Source(wavelength=633 * ureg.nanometer)
41
+
42
+ solver = Solver(
43
+ source=source,
44
+ order=3,
45
+ )
46
+
47
+ result = solver.solve(target=volume)
48
+
49
+ averaged = result.azimuth_average()
50
+
51
+ theta = averaged.angles.to("radian").magnitude
52
+
53
+ phase_density = averaged.phase_function.to("1 / steradian").magnitude
54
+
55
+ figure, axes = plt.subplots(1, 2, figsize=(10, 4), layout="constrained")
56
+
57
+ for order in (1, 2, 3):
58
+ polar_density = 2 * np.pi * phase_density[order - 1] * np.sin(theta)
59
+
60
+ axes[0].plot(theta, phase_density[order - 1], label=f"Order {order}")
61
+
62
+ axes[1].plot(theta, polar_density, label=f"Order {order}")
63
+
64
+ axes[0].set(ylabel="Phase density (sr⁻¹)")
65
+
66
+ axes[1].set(ylabel="Polar-angle density (rad⁻¹)")
67
+
68
+ for axis in axes:
69
+ axis.set(xlabel="Polar angle (radians)")
70
+
71
+ axis.legend()
72
+
73
+ plt.show()
@@ -3,7 +3,9 @@ Examples
3
3
 
4
4
  Browse runnable examples by topic: random media, structured media, Born orders
5
5
  and interference, plotting and saving results, and numerical validation.
6
- Each gallery example includes a three-dimensional view of its input medium.
6
+ Each topic contains six runnable examples. Input media are shown with
7
+ three-dimensional views or Matplotlib slices, with explicit physical settings.
8
+ The gallery includes Born calculations through orders two to five.
7
9
  Ensemble examples show a labelled seeded realization on the calculation grid;
8
10
  that view is one finite sample, rather than the ensemble average. Comparisons
9
11
  of covariance models, correlation lengths, or sphere arrangements show each
@@ -242,3 +244,19 @@ empirical covariance with the discrete spectral and continuum predictions.
242
244
  translation invariance and shows how relative sphere positions introduce
243
245
  azimuth-dependent interference. Both examples expose their grids, materials,
244
246
  seeds and numerical settings.
247
+
248
+ More higher-order studies
249
+ -------------------------
250
+
251
+ * :doc:`auto_examples/born_orders/contrast_sensitivity` compares positive and
252
+ negative refractive index offsets through fourth order.
253
+ * :doc:`auto_examples/born_orders/wavelength_corrections` holds geometry fixed
254
+ and compares wavelength-dependent corrections through fifth order.
255
+ * :doc:`auto_examples/born_orders/coupled_spheres` compares a joint third-order
256
+ solve with the coherent amplitude sum of isolated particles.
257
+ * :doc:`auto_examples/results/phase_normalization` distinguishes per-steradian
258
+ phase density from polar-angle probability through third order.
259
+ * :doc:`auto_examples/results/angular_cut_and_full` compares second-order
260
+ meridian data and explains why cuts lack integrated coefficients.
261
+ * :doc:`auto_examples/results/cross_section_and_volume` separates physical
262
+ cross sections from box normalization through fourth order.
@@ -53,15 +53,15 @@ package-check: build
53
53
  $(PYTHON) tools/check_wheel.py dist
54
54
 
55
55
  release-check:
56
- $(PYTHON) tools/check_release.py $(if $(VERSION),--version $(VERSION),)
56
+ $(PYTHON) -m martinpdes_maintenance.cli check $(if $(VERSION),--version $(VERSION),)
57
57
 
58
58
  tag:
59
- $(PYTHON) tools/release_tag.py "$(VERSION)"
59
+ $(PYTHON) -m martinpdes_maintenance.cli tag "$(VERSION)"
60
60
 
61
61
  release:
62
62
  @test "$(words $(RELEASE_KIND))" -eq 1 || { echo "usage: make release [patch|minor|major]" >&2; exit 2; }
63
- @set -eu; release_tag="$$($(PYTHON) tools/next_release_version.py $(RELEASE_KIND))"; \
64
- $(PYTHON) tools/release_tag.py "$$release_tag"; \
63
+ @set -eu; release_tag="$$($(PYTHON) -m martinpdes_maintenance.cli next $(RELEASE_KIND))"; \
64
+ $(PYTHON) -m martinpdes_maintenance.cli tag "$$release_tag"; \
65
65
  git push origin HEAD "refs/tags/$$release_tag"
66
66
 
67
67
  major minor patch: