PyOptik 1.12.0__tar.gz → 2.0.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 (141) hide show
  1. pyoptik-2.0.0/PKG-INFO +427 -0
  2. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/__init__.py +2 -2
  3. pyoptik-2.0.0/PyOptik/__main__.py +37 -0
  4. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/_version.py +16 -3
  5. pyoptik-2.0.0/PyOptik/data/sellmeier/BAF10.yml +59 -0
  6. pyoptik-2.0.0/PyOptik/data/sellmeier/FK51A.yml +64 -0
  7. pyoptik-2.0.0/PyOptik/data/sellmeier/LASF9.yml +57 -0
  8. pyoptik-2.0.0/PyOptik/data/sellmeier/SF10.yml +56 -0
  9. pyoptik-2.0.0/PyOptik/data/sellmeier/SF11.yml +55 -0
  10. pyoptik-2.0.0/PyOptik/data/sellmeier/acetylene.yml +18 -0
  11. pyoptik-2.0.0/PyOptik/data/sellmeier/cellulose.yml +17 -0
  12. pyoptik-2.0.0/PyOptik/data/sellmeier/ethane.yml +20 -0
  13. pyoptik-2.0.0/PyOptik/data/sellmeier/ethanol.yml +16 -0
  14. pyoptik-2.0.0/PyOptik/data/sellmeier/ethylene.yml +18 -0
  15. pyoptik-2.0.0/PyOptik/data/sellmeier/glycerol.yml +16 -0
  16. pyoptik-2.0.0/PyOptik/data/sellmeier/methane.yml +18 -0
  17. pyoptik-2.0.0/PyOptik/data/sellmeier/methanol.yml +16 -0
  18. pyoptik-2.0.0/PyOptik/data/sellmeier/polycarbonate.yml +17 -0
  19. pyoptik-2.0.0/PyOptik/data/sellmeier/polystyrene.yml +17 -0
  20. pyoptik-2.0.0/PyOptik/data/sellmeier/propanol.yml +16 -0
  21. pyoptik-2.0.0/PyOptik/data/sellmeier/pvc.yml +16 -0
  22. pyoptik-2.0.0/PyOptik/data/tabulated/bismuth.yml +163 -0
  23. pyoptik-2.0.0/PyOptik/data/tabulated/chromium.yml +62 -0
  24. pyoptik-2.0.0/PyOptik/data/tabulated/lead.yml +163 -0
  25. pyoptik-2.0.0/PyOptik/data/tabulated/magnesium.yml +153 -0
  26. pyoptik-2.0.0/PyOptik/data/tabulated/paladium.yml +62 -0
  27. pyoptik-2.0.0/PyOptik/data/tabulated/pva.yml +635 -0
  28. pyoptik-2.0.0/PyOptik/data/tabulated/rhodium.yml +21 -0
  29. pyoptik-2.0.0/PyOptik/data/tabulated/tantalum.yml +163 -0
  30. pyoptik-2.0.0/PyOptik/data/tabulated/titanium.yml +62 -0
  31. pyoptik-2.0.0/PyOptik/data/tabulated/tungsten.yml +163 -0
  32. pyoptik-2.0.0/PyOptik/data/tabulated/vanadium.yml +62 -0
  33. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/material/base_class.py +76 -24
  34. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/material/sellmeier_class.py +20 -18
  35. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/material/tabulated_class.py +22 -18
  36. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/material_bank.py +51 -9
  37. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/utils.py +6 -4
  38. pyoptik-2.0.0/PyOptik.egg-info/PKG-INFO +427 -0
  39. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik.egg-info/SOURCES.txt +36 -2
  40. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik.egg-info/requires.txt +1 -0
  41. pyoptik-2.0.0/README.rst +367 -0
  42. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/README.rst +2 -0
  43. pyoptik-2.0.0/docs/examples/group_properties/README.rst +6 -0
  44. pyoptik-2.0.0/docs/examples/group_properties/plot_group_properties.py +48 -0
  45. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/sellmeier/plot_bk7.py +2 -3
  46. pyoptik-2.0.0/docs/examples/sellmeier/plot_compare_glasses.py +43 -0
  47. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/sellmeier/plot_silica.py +3 -5
  48. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/sellmeier/plot_water.py +4 -4
  49. pyoptik-2.0.0/docs/examples/tabulated/plot_polyethylene.py +21 -0
  50. pyoptik-2.0.0/docs/examples/tabulated/plot_silicon_nk.py +41 -0
  51. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/tabulated/plot_silver.py +4 -4
  52. pyoptik-2.0.0/docs/examples/utils/search_materials.py +23 -0
  53. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/source/conf.py +1 -1
  54. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/source/gallery/index.rst +4 -3
  55. pyoptik-2.0.0/docs/source/sg_execution_times.rst +73 -0
  56. {pyoptik-1.12.0 → pyoptik-2.0.0}/meta.yaml +2 -1
  57. {pyoptik-1.12.0 → pyoptik-2.0.0}/pyproject.toml +2 -1
  58. {pyoptik-1.12.0 → pyoptik-2.0.0}/tests/test_base_material_decorator.py +8 -7
  59. pyoptik-2.0.0/tests/test_group_properties.py +42 -0
  60. pyoptik-2.0.0/tests/test_main_cli.py +24 -0
  61. {pyoptik-1.12.0 → pyoptik-2.0.0}/tests/test_material_bank_extra.py +17 -4
  62. {pyoptik-1.12.0 → pyoptik-2.0.0}/tests/test_sellmeier.py +18 -29
  63. {pyoptik-1.12.0 → pyoptik-2.0.0}/tests/test_tabulated.py +12 -12
  64. {pyoptik-1.12.0 → pyoptik-2.0.0}/tests/test_utils.py +2 -1
  65. pyoptik-1.12.0/PKG-INFO +0 -299
  66. pyoptik-1.12.0/PyOptik/__main__.py +0 -7
  67. pyoptik-1.12.0/PyOptik/units.py +0 -61
  68. pyoptik-1.12.0/PyOptik.egg-info/PKG-INFO +0 -299
  69. pyoptik-1.12.0/README.rst +0 -240
  70. pyoptik-1.12.0/docs/examples/tabulated/plot_sf5.py +0 -22
  71. pyoptik-1.12.0/tests/test_group_properties.py +0 -27
  72. {pyoptik-1.12.0 → pyoptik-2.0.0}/.flake8 +0 -0
  73. {pyoptik-1.12.0 → pyoptik-2.0.0}/.github/dependabot.yml +0 -0
  74. {pyoptik-1.12.0 → pyoptik-2.0.0}/.github/workflows/deploy_PyPi.yml +0 -0
  75. {pyoptik-1.12.0 → pyoptik-2.0.0}/.github/workflows/deploy_anaconda.yml +0 -0
  76. {pyoptik-1.12.0 → pyoptik-2.0.0}/.github/workflows/deploy_coverage.yml +0 -0
  77. {pyoptik-1.12.0 → pyoptik-2.0.0}/.github/workflows/deploy_documentation.yml +0 -0
  78. {pyoptik-1.12.0 → pyoptik-2.0.0}/.gitignore +0 -0
  79. {pyoptik-1.12.0 → pyoptik-2.0.0}/LICENSE +0 -0
  80. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/__init__.py +0 -0
  81. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/BAK1.yml +0 -0
  82. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/BK7.yml +0 -0
  83. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/SF5.yml +0 -0
  84. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/ZBLAN.yml +0 -0
  85. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/acetone.yml +0 -0
  86. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/air.yml +0 -0
  87. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/argon.yml +0 -0
  88. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/crown.yml +0 -0
  89. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/flint.yml +0 -0
  90. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/fused_silica.yml +0 -0
  91. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/germanium.yml +0 -0
  92. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/lithium_niobate.yml +0 -0
  93. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/polystyren.yml +0 -0
  94. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/soda_lime_glass.yml +0 -0
  95. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/sellmeier/water.yml +0 -0
  96. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/aluminium.yml +0 -0
  97. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/calcium.yml +0 -0
  98. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/copper.yml +0 -0
  99. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/gold.yml +0 -0
  100. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/iron.yml +0 -0
  101. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/nickel.yml +0 -0
  102. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/polyetylene.yml +0 -0
  103. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/silicon.yml +0 -0
  104. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/silver.yml +0 -0
  105. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/sodium.yml +0 -0
  106. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/data/tabulated/zinc.yml +0 -0
  107. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/directories.py +0 -0
  108. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/libraries/__init__.py +0 -0
  109. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/libraries/classics.yml +0 -0
  110. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/libraries/dielectrics.yml +0 -0
  111. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/libraries/metals.yml +0 -0
  112. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/libraries/minimal.yml +0 -0
  113. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/libraries/organics.yml +0 -0
  114. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/libraries/others.yml +0 -0
  115. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/libraries/polymers.yml +0 -0
  116. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/libraries/repertoire.yml +0 -0
  117. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/material/__init__.py +0 -0
  118. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik/material_type.py +0 -0
  119. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik.egg-info/dependency_links.txt +0 -0
  120. {pyoptik-1.12.0 → pyoptik-2.0.0}/PyOptik.egg-info/top_level.txt +0 -0
  121. {pyoptik-1.12.0 → pyoptik-2.0.0}/development/dev_0.py +0 -0
  122. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/Makefile +0 -0
  123. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/sellmeier/README.rst +0 -0
  124. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/tabulated/README.rst +0 -0
  125. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/utils/README.rst +0 -0
  126. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/utils/__build_library.py +0 -0
  127. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/utils/__download_yml_file.py +0 -0
  128. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/utils/create_sellmeier_file.py +0 -0
  129. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/examples/utils/create_tabulated_file.py +0 -0
  130. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/images/example_bk7.png +0 -0
  131. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/images/logo.png +0 -0
  132. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/make.bat +0 -0
  133. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/source/_static/default.css +0 -0
  134. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/source/_static/thumbnail.png +0 -0
  135. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/source/code.rst +0 -0
  136. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/source/index.rst +0 -0
  137. {pyoptik-1.12.0 → pyoptik-2.0.0}/docs/source/references.rst +0 -0
  138. {pyoptik-1.12.0 → pyoptik-2.0.0}/setup.cfg +0 -0
  139. {pyoptik-1.12.0 → pyoptik-2.0.0}/tests/__init__.py +0 -0
  140. {pyoptik-1.12.0 → pyoptik-2.0.0}/tests/test_usual_materials.py +1 -1
  141. {pyoptik-1.12.0 → pyoptik-2.0.0}/tests/test_utils_extra.py +0 -0
pyoptik-2.0.0/PKG-INFO ADDED
@@ -0,0 +1,427 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyOptik
3
+ Version: 2.0.0
4
+ Summary: A package for refractive index values.
5
+ Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2020 Martin de Sivry
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Keywords: refractive index,optics
29
+ Classifier: Programming Language :: Python
30
+ Classifier: Programming Language :: Python :: 3
31
+ Classifier: Programming Language :: Python :: Implementation :: CPython
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Topic :: Scientific/Engineering :: Physics
34
+ Classifier: Intended Audience :: Science/Research
35
+ Requires-Python: >=3.10
36
+ Description-Content-Type: text/x-rst
37
+ License-File: LICENSE
38
+ Requires-Dist: pint~=0.24
39
+ Requires-Dist: numpy
40
+ Requires-Dist: matplotlib~=3.8
41
+ Requires-Dist: requests~=2.31
42
+ Requires-Dist: pyyaml~=6.0
43
+ Requires-Dist: MPSPlots>=1.6
44
+ Requires-Dist: tabulate~=0.9
45
+ Requires-Dist: TypedUnit
46
+ Provides-Extra: testing
47
+ Requires-Dist: pytest<9.0,>=7.4; extra == "testing"
48
+ Requires-Dist: pytest-cov<6,>=2; extra == "testing"
49
+ Requires-Dist: pytest-json-report~=1.5; extra == "testing"
50
+ Requires-Dist: coverage~=7.6; extra == "testing"
51
+ Provides-Extra: documentation
52
+ Requires-Dist: numpydoc==1.6.0; extra == "documentation"
53
+ Requires-Dist: sphinx>=5.1.1; extra == "documentation"
54
+ Requires-Dist: sphinx-gallery==0.15.0; extra == "documentation"
55
+ Requires-Dist: sphinx-rtd-theme==2.0.0; extra == "documentation"
56
+ Requires-Dist: pydata-sphinx-theme==0.14.1; extra == "documentation"
57
+ Provides-Extra: dev
58
+ Requires-Dist: flake8==7.1.1; extra == "dev"
59
+ Dynamic: license-file
60
+
61
+
62
+ |logo|
63
+
64
+ .. list-table::
65
+ :widths: 10 25 25
66
+ :header-rows: 0
67
+
68
+ * - Meta
69
+ - |python|
70
+ - |docs|
71
+ * - Testing
72
+ - |ci/cd|
73
+ - |coverage|
74
+ * - PyPi
75
+ - |PyPi|
76
+ - |PyPi_download|
77
+ * - Anaconda
78
+ - |anaconda|
79
+ - |anaconda_download|
80
+
81
+
82
+ PyOptik: Optical Material Properties Made Simple
83
+ =================================================
84
+
85
+ **PyOptik** is a powerful Python library that provides seamless access to optical material properties from the comprehensive `RefractiveIndex.INFO <https://refractiveindex.info>`_ database. Whether you're simulating light-matter interactions, designing optical systems, or conducting photonics research, PyOptik delivers the refractive index and extinction coefficient data you need with a clean, intuitive API.
86
+
87
+ **Quick Start**: Get material properties in just 3 lines of code!
88
+
89
+ .. code:: python
90
+
91
+ from TypedUnit import ureg
92
+ from PyOptik import MaterialBank
93
+
94
+ bk7 = MaterialBank.BK7
95
+ n = bk7.compute_refractive_index(550 * ureg.nanometer) # n ≈ 1.519
96
+
97
+ Key Features
98
+ ************
99
+
100
+ **Comprehensive Material Database**
101
+ Access thousands of materials from RefractiveIndex.INFO with automatic data management
102
+
103
+ **Multiple Data Formats**
104
+ Support for both Sellmeier equation materials and tabulated wavelength data
105
+
106
+ **High-Performance Computing**
107
+ Optimized calculations for group index, group velocity, and dispersion properties
108
+
109
+ **Simulation Ready**
110
+ Perfect for optical design, photonics simulations, and electromagnetic modeling
111
+
112
+ **Developer Friendly**
113
+ Clean API that integrates seamlessly with NumPy, Matplotlib, and scientific Python stack
114
+
115
+ **Advanced Analysis**
116
+ Built-in plotting and visualization tools powered by MPSPlots
117
+
118
+ Installation
119
+ ************
120
+
121
+ **Quick Install**
122
+
123
+ .. code:: bash
124
+
125
+ pip install PyOptik
126
+
127
+ **Conda Install**
128
+
129
+ .. code:: bash
130
+
131
+ conda install -c martinpdes pyoptik
132
+
133
+ **Development Install**
134
+
135
+ .. code:: bash
136
+
137
+ git clone https://github.com/MartinPdeS/PyOptik.git
138
+ cd PyOptik
139
+ pip install -e .
140
+
141
+ Building Your Material Library
142
+ *******************************
143
+
144
+ PyOptik downloads material data from RefractiveIndex.INFO organized into categories. Choose what you need or download everything at once.
145
+
146
+ **Available Categories:**
147
+
148
+ ``classics`` - Essential optical materials (BK7, fused silica, etc.)
149
+ ``glasses`` - Various optical glasses
150
+ ``metals`` - Metallic materials (gold, silver, aluminum, etc.)
151
+ ``organics`` - Organic and polymer materials
152
+ ``others`` - Specialized and exotic materials
153
+ ``all`` - Everything (recommended for comprehensive access)
154
+
155
+ **Quick Setup - Download Essentials:**
156
+
157
+ .. code:: python
158
+
159
+ from PyOptik import MaterialBank
160
+
161
+ # Get the most commonly used materials
162
+ MaterialBank.build_library('classics')
163
+
164
+ # See what's available
165
+ MaterialBank.print_materials()
166
+
167
+ **Complete Setup - Download Everything:**
168
+
169
+ .. code:: python
170
+
171
+ # Download all materials (recommended)
172
+ MaterialBank.build_library('all', remove_previous=True)
173
+
174
+ **Custom Selection:**
175
+
176
+ .. code:: python
177
+
178
+ # Download specific categories
179
+ MaterialBank.build_library('glasses')
180
+ MaterialBank.build_library('metals')
181
+
182
+ # Or chain them
183
+ for category in ['classics', 'glasses', 'metals']:
184
+ MaterialBank.build_library(category)
185
+
186
+ Quick Start Guide
187
+ *****************
188
+
189
+ **Basic Usage - Refractive Index**
190
+
191
+ .. code:: python
192
+
193
+ from TypedUnit import ureg
194
+ from PyOptik import MaterialBank
195
+ import numpy as np
196
+
197
+ # Access BK7 glass properties
198
+ bk7 = MaterialBank.BK7
199
+
200
+ # Single wavelength (550 nm)
201
+ n = bk7.compute_refractive_index(550 * ureg.nanometer)
202
+ print(f"BK7 refractive index at 550nm: {n:.4f}")
203
+
204
+ # Multiple wavelengths
205
+ wavelengths = np.linspace(400, 800, 100) * ureg.nanometer
206
+ n_values = bk7.compute_refractive_index(wavelengths)
207
+
208
+ **Advanced Properties - Group Index & Velocity**
209
+
210
+ .. code:: python
211
+
212
+ # Group index (important for pulse propagation)
213
+ n_g = bk7.compute_group_index(550 * ureg.nanometer)
214
+
215
+ # Group velocity (speed of pulse envelope)
216
+ v_g = bk7.compute_group_velocity(550 * ureg.nanometer)
217
+
218
+ print(f"Group index: {n_g:.4f}")
219
+ print(f"Group velocity: {v_g:.2e} m/s")
220
+
221
+ **Visualization**
222
+
223
+ .. code:: python
224
+
225
+ # Quick plot of material dispersion
226
+ bk7.plot()
227
+
228
+ # Custom wavelength range
229
+ wavelengths = np.linspace(300, 2000, 500) * ureg.nanometer
230
+ bk7.plot(wavelengths)
231
+
232
+ Detailed Example - Material Analysis
233
+ ************************************
234
+
235
+ Here's a comprehensive example showing PyOptik's capabilities:
236
+
237
+ .. code:: python
238
+
239
+ import numpy as np
240
+ import matplotlib.pyplot as plt
241
+ from PyOptik import MaterialBank
242
+
243
+ # Define wavelength range (UV to Near-IR)
244
+ wavelengths = np.linspace(200, 2500, 1000) * ureg.nanometer
245
+
246
+ # Compare different materials
247
+ materials = {
248
+ 'BK7 Glass': MaterialBank.BK7,
249
+ 'Fused Silica': MaterialBank.fused_silica,
250
+ 'Sapphire': MaterialBank.Al2O3
251
+ }
252
+
253
+ plt.figure(figsize=(12, 8))
254
+
255
+ for name, material in materials.items():
256
+ # Calculate refractive index across spectrum
257
+ n_values = material.compute_refractive_index(wavelengths)
258
+
259
+ # Plot dispersion curve
260
+ plt.subplot(2, 2, 1)
261
+ plt.plot(wavelengths*1e9, n_values, label=name, linewidth=2)
262
+
263
+ # Group velocity dispersion
264
+ group_indices = material.compute_group_index(wavelengths)
265
+ plt.subplot(2, 2, 2)
266
+ plt.plot(wavelengths*1e9, group_indices, label=name, linewidth=2)
267
+
268
+ plt.subplot(2, 2, 1)
269
+ plt.xlabel('Wavelength (nm)')
270
+ plt.ylabel('Refractive Index')
271
+ plt.title('Material Dispersion Comparison')
272
+ plt.legend()
273
+ plt.grid(True, alpha=0.3)
274
+
275
+ plt.subplot(2, 2, 2)
276
+ plt.xlabel('Wavelength (nm)')
277
+ plt.ylabel('Group Index')
278
+ plt.title('Group Index Comparison')
279
+ plt.legend()
280
+ plt.grid(True, alpha=0.3)
281
+
282
+ plt.tight_layout()
283
+ plt.show()
284
+
285
+ **Output:** |example_bk7|
286
+
287
+ This example demonstrates PyOptik's power for comparative material analysis and optical design.
288
+
289
+ Advanced Usage - Custom Materials
290
+ **********************************
291
+
292
+ **Adding Materials from RefractiveIndex.INFO**
293
+
294
+ Easily extend your library with materials from the web:
295
+
296
+ .. code:: python
297
+
298
+ from PyOptik import MaterialBank, MaterialType
299
+
300
+ # Add water at 19°C from RefractiveIndex.INFO
301
+ MaterialBank.add_material_to_bank(
302
+ filename='water_19C',
303
+ material_type=MaterialType.SELLMEIER,
304
+ url='https://refractiveindex.info/database/data-nk/main/H2O/Daimon-19.0C.yml'
305
+ )
306
+
307
+ # Now you can use it
308
+ water = MaterialBank.water_19C
309
+ n_water = water.compute_refractive_index(589e-9) # Sodium D-line
310
+
311
+ **Managing Your Library**
312
+
313
+ .. code:: python
314
+
315
+ # View all available materials
316
+ MaterialBank.print_materials()
317
+
318
+ # Remove unwanted materials
319
+ MaterialBank.remove_item(filename='water_19C')
320
+
321
+ # Check what's available after removal
322
+ MaterialBank.print_available()
323
+
324
+ **Material Types**
325
+
326
+ PyOptik supports two material data formats:
327
+
328
+ **Sellmeier Materials**: Mathematical dispersion formulas (compact, smooth)
329
+ **Tabulated Materials**: Discrete wavelength-index pairs (experimental data)
330
+
331
+ Development & Testing
332
+ *********************
333
+
334
+ **Running Tests**
335
+
336
+ .. code:: bash
337
+
338
+ # Clone and setup
339
+ git clone https://github.com/MartinPdeS/PyOptik.git
340
+ cd PyOptik
341
+ pip install -e ".[testing]"
342
+
343
+ # Run test suite
344
+ pytest
345
+
346
+ # Run with coverage
347
+ pytest --cov=PyOptik --cov-report=html
348
+
349
+ **Code Quality**
350
+
351
+ .. code:: bash
352
+
353
+ # Linting
354
+ flake8 PyOptik/
355
+
356
+ # Type checking (if using mypy)
357
+ mypy PyOptik/
358
+
359
+ Contributing
360
+ ************
361
+
362
+ We welcome contributions! PyOptik thrives on community input:
363
+
364
+ **Bug Reports**: Found an issue? Open an issue on GitHub
365
+ **Feature Requests**: Have ideas? We'd love to hear them
366
+ **Documentation**: Help improve our docs and examples
367
+ **Code**: Submit pull requests for fixes and enhancements
368
+
369
+ **Development Workflow:**
370
+
371
+ 1. Fork the repository
372
+ 2. Create a feature branch: ``git checkout -b feature-name``
373
+ 3. Make your changes and add tests
374
+ 4. Run the test suite: ``pytest``
375
+ 5. Submit a pull request
376
+
377
+ Contact & Support
378
+ *****************
379
+
380
+ **Author**: `Martin Poinsinet de Sivry-Houle <https://github.com/MartinPdS>`_
381
+
382
+ **Email**: `martin.poinsinet.de.sivry@gmail.com <mailto:martin.poinsinet.de.sivry@gmail.com?subject=PyOptik>`_
383
+
384
+ **GitHub**: `PyOptik Repository <https://github.com/MartinPdeS/PyOptik>`_
385
+
386
+ **Documentation**: `Full Documentation <https://martinpdes.github.io/PyOptik/>`_
387
+
388
+ PyOptik is actively developed and maintained. We're always looking for collaborators interested in optical simulation and materials science!
389
+
390
+ .. |python| image:: https://img.shields.io/pypi/pyversions/pyoptik.svg
391
+ :alt: Python
392
+ :target: https://www.python.org/
393
+
394
+ .. |logo| image:: https://github.com/MartinPdeS/PyOptik/raw/master/docs/images/logo.png
395
+ :alt: PyOptik logo
396
+
397
+ .. |example_bk7| image:: https://github.com/MartinPdeS/PyOptik/raw/master/docs/images/example_bk7.png
398
+ :alt: PyOptik example: BK7
399
+ :target: https://github.com/MartinPdeS/PyOptik/blob/master/docs/images/example_bk7.png
400
+
401
+ .. |docs| image:: https://github.com/martinpdes/pyoptik/actions/workflows/deploy_documentation.yml/badge.svg
402
+ :target: https://martinpdes.github.io/PyOptik/
403
+ :alt: Documentation Status
404
+
405
+ .. |ci/cd| image:: https://github.com/martinpdes/pyoptik/actions/workflows/deploy_coverage.yml/badge.svg
406
+ :target: https://martinpdes.github.io/PyOptik/actions
407
+ :alt: Unittest Status
408
+
409
+ .. |PyPi| image:: https://badge.fury.io/py/pyoptik.svg
410
+ :alt: PyPi version
411
+ :target: https://badge.fury.io/py/pyoptik
412
+
413
+ .. |PyPi_download| image:: https://img.shields.io/pypi/dm/pyoptik.svg
414
+ :alt: PyPi version
415
+ :target: https://pypistats.org/packages/pyoptik
416
+
417
+ .. |anaconda_download| image:: https://anaconda.org/martinpdes/pyoptik/badges/downloads.svg
418
+ :alt: Anaconda downloads
419
+ :target: https://anaconda.org/martinpdes/pyoptik
420
+
421
+ .. |coverage| image:: https://raw.githubusercontent.com/MartinPdeS/PyOptik/python-coverage-comment-action-data/badge.svg
422
+ :alt: Unittest coverage
423
+ :target: https://htmlpreview.github.io/?https://github.com/MartinPdeS/PyOptik/blob/python-coverage-comment-action-data/htmlcov/index.html
424
+
425
+ .. |anaconda| image:: https://anaconda.org/martinpdes/pyoptik/badges/version.svg
426
+ :alt: Anaconda version
427
+ :target: https://anaconda.org/martinpdes/pyoptik
@@ -12,6 +12,6 @@ from .material import TabulatedMaterial
12
12
  from .material import SellmeierMaterial
13
13
  from .material import base_class
14
14
 
15
- Material = MaterialBank # For retro-compatiibility
15
+ Material = MaterialBank # For retro-compatibility
16
16
 
17
- TIMEOUT = 10 # Default timeout for requests in seconds
17
+ TIMEOUT = 10 # Default timeout for requests in seconds
@@ -0,0 +1,37 @@
1
+ from PyOptik import MaterialBank
2
+ import argparse
3
+ import logging
4
+
5
+
6
+ def main() -> None:
7
+ """Command line entry point for downloading material libraries."""
8
+ parser = argparse.ArgumentParser(description="Download material library")
9
+ parser.add_argument(
10
+ "library",
11
+ nargs="?",
12
+ default="all",
13
+ help="Library name to download (default: 'all')",
14
+ )
15
+ parser.add_argument(
16
+ "--remove-previous",
17
+ action="store_true",
18
+ help="Remove previously downloaded files before downloading",
19
+ )
20
+ parser.add_argument(
21
+ "--list-libraries",
22
+ action="store_true",
23
+ help="List available library names and exit",
24
+ )
25
+ args = parser.parse_args()
26
+
27
+ if args.list_libraries:
28
+ for lib in MaterialBank.list_available_libraries():
29
+ print(lib)
30
+ return
31
+
32
+ logging.info("Building material library")
33
+ MaterialBank.build_library(args.library, remove_previous=args.remove_previous)
34
+
35
+
36
+ if __name__ == "__main__":
37
+ main()
@@ -1,7 +1,14 @@
1
1
  # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
3
 
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
5
12
 
6
13
  TYPE_CHECKING = False
7
14
  if TYPE_CHECKING:
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
9
16
  from typing import Union
10
17
 
11
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
12
20
  else:
13
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
14
23
 
15
24
  version: str
16
25
  __version__: str
17
26
  __version_tuple__: VERSION_TUPLE
18
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
19
30
 
20
- __version__ = version = '1.12.0'
21
- __version_tuple__ = version_tuple = (1, 12, 0)
31
+ __version__ = version = '2.0.0'
32
+ __version_tuple__ = version_tuple = (2, 0, 0)
33
+
34
+ __commit_id__ = commit_id = 'g9ce3b3906'
@@ -0,0 +1,59 @@
1
+ # this file is part of refractiveindex.info database
2
+ # refractiveindex.info database is in the public domain
3
+ # copyright and related rights waived via CC0 1.0
4
+
5
+ REFERENCES: |
6
+ <a href="https://refractiveindex.info/download/data/2017/schott_2017-01-20b.agf">SCHOTT Zemax catalog 2017-01-20b</a> (obtained from <a href="https://www.schott.com/en-us/products/optical-glass-p1000267/downloads/">http://www.schott.com</a>)<br>See also <a href="https://refractiveindex.info/download/data/2017/schott_2017-01-20.pdf">SCHOTT glass data sheets</a>
7
+ COMMENTS: |
8
+
9
+ DATA:
10
+ - type: formula 2
11
+ wavelength_range: 0.35 2.5
12
+ coefficients: 0 1.5851495 0.00926681282 0.143559385 0.0424489805 1.08521269 105.613573
13
+ - type: tabulated k
14
+ data: |
15
+ 0.350 5.1305E-06
16
+ 0.365 1.3607E-06
17
+ 0.370 9.6691E-07
18
+ 0.380 5.0260E-07
19
+ 0.390 2.7701E-07
20
+ 0.400 1.6276E-07
21
+ 0.405 1.3583E-07
22
+ 0.420 8.2721E-08
23
+ 0.436 6.5355E-08
24
+ 0.460 4.9135E-08
25
+ 0.500 3.0530E-08
26
+ 0.546 1.7467E-08
27
+ 0.580 1.8555E-08
28
+ 0.620 1.7842E-08
29
+ 0.660 2.1114E-08
30
+ 0.700 1.3409E-08
31
+ 1.060 2.0305E-08
32
+ 1.530 9.8390E-08
33
+ 1.970 5.2286E-07
34
+ 2.325 2.8542E-06
35
+ 2.500 6.3543E-06
36
+ CONDITIONS:
37
+ temperature: 293
38
+ PROPERTIES:
39
+ thermal_dispersion:
40
+ - type: formula A
41
+ coefficients: 3.79e-06 1.28e-08 -1.42e-11 5.84e-07 7.6e-10 0.22
42
+ nd: 1.67003
43
+ Vd: 47.11
44
+ glass_code: 670471.375
45
+ glass_status: standard
46
+ density:
47
+ - value: 3745
48
+ thermal_expansion:
49
+ - temperature_range: 243 343
50
+ value: 6.18e-06
51
+ - temperature_range: 293 573
52
+ value: 7.04e-06
53
+ dPgF: -0.0016
54
+ resistance:
55
+ climatic: 1.0
56
+ stain: 0.0
57
+ acid: 4.3
58
+ alkali: 1.3
59
+ phosphate: 1.0
@@ -0,0 +1,64 @@
1
+ # this file is part of refractiveindex.info database
2
+ # refractiveindex.info database is in the public domain
3
+ # copyright and related rights waived via CC0 1.0
4
+
5
+ REFERENCES: |
6
+ <a href="https://refractiveindex.info/download/data/2017/schott_2017-01-20b.agf">SCHOTT Zemax catalog 2017-01-20b</a> (obtained from <a href="https://www.schott.com/en-us/products/optical-glass-p1000267/downloads/">http://www.schott.com</a>)<br>See also <a href="https://refractiveindex.info/download/data/2017/schott_2017-01-20.pdf">SCHOTT glass data sheets</a>
7
+ COMMENTS: |
8
+ was replaced by N-FK51A
9
+ DATA:
10
+ - type: formula 2
11
+ wavelength_range: 0.29 2.5
12
+ coefficients: 0 0.971247817 0.00472301995 0.216901417 0.0153575612 0.904651666 168.68133
13
+ - type: tabulated k
14
+ data: |
15
+ 0.290 4.2510E-06
16
+ 0.300 3.2013E-06
17
+ 0.310 2.0922E-06
18
+ 0.320 1.2264E-06
19
+ 0.334 4.9122E-07
20
+ 0.350 1.4877E-07
21
+ 0.365 4.3803E-08
22
+ 0.370 2.8611E-08
23
+ 0.380 1.4603E-08
24
+ 0.390 9.9712E-09
25
+ 0.400 8.9440E-09
26
+ 0.405 9.0558E-09
27
+ 0.420 1.0738E-08
28
+ 0.436 1.1147E-08
29
+ 0.460 1.0286E-08
30
+ 0.500 6.3790E-09
31
+ 0.546 5.2218E-09
32
+ 0.580 5.5469E-09
33
+ 0.620 7.9099E-09
34
+ 0.660 1.0531E-08
35
+ 0.700 1.1169E-08
36
+ 1.060 2.0305E-08
37
+ 1.530 9.8390E-08
38
+ 1.970 3.8800E-07
39
+ 2.325 1.2903E-06
40
+ 2.500 2.2893E-06
41
+ CONDITIONS:
42
+ temperature: 293
43
+ PROPERTIES:
44
+ thermal_dispersion:
45
+ - type: formula A
46
+ coefficients: -1.83e-05 -7.89e-09 -1.63e-12 3.74e-07 3.46e-10 0.15
47
+ nd: 1.48656
48
+ Vd: 84.47
49
+ glass_code: 487845.366
50
+ glass_status: preferred
51
+ density:
52
+ - value: 3660
53
+ thermal_expansion:
54
+ - temperature_range: 243 343
55
+ value: 1.33e-05
56
+ - temperature_range: 293 573
57
+ value: 1.549e-05
58
+ dPgF: 0.0342
59
+ resistance:
60
+ climatic: 2.0
61
+ stain: 0.0
62
+ acid: 52.3
63
+ alkali: 2.2
64
+ phosphate: 4.3
@@ -0,0 +1,57 @@
1
+ # this file is part of refractiveindex.info database
2
+ # refractiveindex.info database is in the public domain
3
+ # copyright and related rights waived via CC0 1.0
4
+
5
+ REFERENCES: |
6
+ <a href="https://refractiveindex.info/download/data/2017/schott_2017-01-20b.agf">SCHOTT Zemax catalog 2017-01-20b</a> (obtained from <a href="https://www.schott.com/en-us/products/optical-glass-p1000267/downloads/">http://www.schott.com</a>)<br>See also <a href="https://refractiveindex.info/download/data/2017/schott_2017-01-20.pdf">SCHOTT glass data sheets</a>
7
+ COMMENTS: |
8
+
9
+ DATA:
10
+ - type: formula 2
11
+ wavelength_range: 0.365 2.5
12
+ coefficients: 0 2.00029547 0.0121426017 0.298926886 0.0538736236 1.80691843 156.530829
13
+ - type: tabulated k
14
+ data: |
15
+ 0.370 3.7910E-06
16
+ 0.380 1.9467E-06
17
+ 0.390 1.1375E-06
18
+ 0.400 7.1571E-07
19
+ 0.405 5.9564E-07
20
+ 0.420 3.4942E-07
21
+ 0.436 2.4197E-07
22
+ 0.460 1.5753E-07
23
+ 0.500 9.0035E-08
24
+ 0.546 4.9357E-08
25
+ 0.580 4.1070E-08
26
+ 0.620 4.1885E-08
27
+ 0.660 4.0300E-08
28
+ 0.700 3.1415E-08
29
+ 1.060 2.0305E-08
30
+ 1.530 6.8664E-08
31
+ 1.970 5.2968E-07
32
+ 2.325 2.5139E-06
33
+ 2.500 4.0916E-06
34
+ CONDITIONS:
35
+ temperature: 293
36
+ PROPERTIES:
37
+ thermal_dispersion:
38
+ - type: formula A
39
+ coefficients: 1.05e-06 1.02e-08 -2.38e-11 9.19e-07 1.18e-09 0.257
40
+ nd: 1.85025
41
+ Vd: 32.17
42
+ glass_code: 850322.441
43
+ glass_status: standard
44
+ density:
45
+ - value: 4410
46
+ thermal_expansion:
47
+ - temperature_range: 243 343
48
+ value: 7.37e-06
49
+ - temperature_range: 293 573
50
+ value: 8.38e-06
51
+ dPgF: 0.0037
52
+ resistance:
53
+ climatic: 1.0
54
+ stain: 0.0
55
+ acid: 2.0
56
+ alkali: 1.0
57
+ phosphate: 1.0