PyOptik 2.0.0__tar.gz → 2.0.1__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.
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PKG-INFO +1 -1
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/_version.py +3 -3
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/material/sellmeier_class.py +5 -2
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/material/tabulated_class.py +6 -3
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik.egg-info/PKG-INFO +1 -1
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/test_sellmeier.py +13 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/.flake8 +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/.github/dependabot.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/.github/workflows/deploy_PyPi.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/.github/workflows/deploy_anaconda.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/.github/workflows/deploy_coverage.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/.github/workflows/deploy_documentation.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/.gitignore +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/LICENSE +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/__init__.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/__main__.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/__init__.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/BAF10.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/BAK1.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/BK7.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/FK51A.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/LASF9.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/SF10.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/SF11.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/SF5.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/ZBLAN.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/acetone.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/acetylene.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/air.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/argon.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/cellulose.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/crown.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/ethane.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/ethanol.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/ethylene.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/flint.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/fused_silica.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/germanium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/glycerol.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/lithium_niobate.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/methane.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/methanol.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/polycarbonate.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/polystyren.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/polystyrene.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/propanol.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/pvc.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/soda_lime_glass.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/sellmeier/water.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/aluminium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/bismuth.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/calcium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/chromium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/copper.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/gold.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/iron.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/lead.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/magnesium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/nickel.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/paladium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/polyetylene.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/pva.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/rhodium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/silicon.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/silver.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/sodium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/tantalum.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/titanium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/tungsten.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/vanadium.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/data/tabulated/zinc.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/directories.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/libraries/__init__.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/libraries/classics.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/libraries/dielectrics.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/libraries/metals.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/libraries/minimal.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/libraries/organics.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/libraries/others.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/libraries/polymers.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/libraries/repertoire.yml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/material/__init__.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/material/base_class.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/material_bank.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/material_type.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik/utils.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik.egg-info/SOURCES.txt +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik.egg-info/dependency_links.txt +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik.egg-info/requires.txt +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/PyOptik.egg-info/top_level.txt +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/README.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/development/dev_0.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/Makefile +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/README.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/group_properties/README.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/group_properties/plot_group_properties.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/sellmeier/README.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/sellmeier/plot_bk7.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/sellmeier/plot_compare_glasses.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/sellmeier/plot_silica.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/sellmeier/plot_water.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/tabulated/README.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/tabulated/plot_polyethylene.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/tabulated/plot_silicon_nk.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/tabulated/plot_silver.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/utils/README.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/utils/__build_library.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/utils/__download_yml_file.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/utils/create_sellmeier_file.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/utils/create_tabulated_file.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/examples/utils/search_materials.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/images/example_bk7.png +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/images/logo.png +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/make.bat +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/source/_static/default.css +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/source/_static/thumbnail.png +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/source/code.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/source/conf.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/source/gallery/index.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/source/index.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/source/references.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/docs/source/sg_execution_times.rst +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/meta.yaml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/pyproject.toml +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/setup.cfg +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/__init__.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/test_base_material_decorator.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/test_group_properties.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/test_main_cli.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/test_material_bank_extra.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/test_tabulated.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/test_usual_materials.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/test_utils.py +0 -0
- {pyoptik-2.0.0 → pyoptik-2.0.1}/tests/test_utils_extra.py +0 -0
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '2.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 0,
|
|
31
|
+
__version__ = version = '2.0.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (2, 0, 1)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g052103443'
|
|
@@ -89,13 +89,13 @@ class SellmeierMaterial(BaseMaterial):
|
|
|
89
89
|
self.reference = parsed_yaml.get('REFERENCES', None)
|
|
90
90
|
|
|
91
91
|
@validate_units
|
|
92
|
-
def compute_refractive_index(self, wavelength: Length) -> RefractiveIndex:
|
|
92
|
+
def compute_refractive_index(self, wavelength: Length | float) -> RefractiveIndex:
|
|
93
93
|
r"""
|
|
94
94
|
Computes the refractive index n(\u03bb) using the appropriate formula (either Formula 1, 2, 5, or 6).
|
|
95
95
|
|
|
96
96
|
Parameters
|
|
97
97
|
----------
|
|
98
|
-
wavelength : Length
|
|
98
|
+
wavelength : Length | float
|
|
99
99
|
The wavelength \u03bb in meters, can be a single float or a numpy array.
|
|
100
100
|
|
|
101
101
|
Returns
|
|
@@ -108,6 +108,9 @@ class SellmeierMaterial(BaseMaterial):
|
|
|
108
108
|
ValueError
|
|
109
109
|
If the wavelength is outside the specified range or if an unsupported formula type is encountered.
|
|
110
110
|
"""
|
|
111
|
+
if not isinstance(wavelength, Length):
|
|
112
|
+
wavelength = wavelength * ureg.meter
|
|
113
|
+
|
|
111
114
|
return_as_scalar = numpy.isscalar(wavelength.magnitude)
|
|
112
115
|
|
|
113
116
|
wavelength = numpy.atleast_1d(wavelength)
|
|
@@ -6,7 +6,7 @@ from typing import Optional, Union
|
|
|
6
6
|
import yaml
|
|
7
7
|
import matplotlib.pyplot as plt
|
|
8
8
|
from MPSPlots.styles import mps
|
|
9
|
-
from TypedUnit import Length,
|
|
9
|
+
from TypedUnit import Length, validate_units, ureg
|
|
10
10
|
|
|
11
11
|
from PyOptik.material.base_class import BaseMaterial
|
|
12
12
|
from PyOptik.directories import tabulated_data_path
|
|
@@ -93,13 +93,13 @@ class TabulatedMaterial(BaseMaterial):
|
|
|
93
93
|
self.reference = parsed_yaml.get('REFERENCES', None)
|
|
94
94
|
|
|
95
95
|
@validate_units
|
|
96
|
-
def compute_refractive_index(self, wavelength: Length) -> numpy.ndarray:
|
|
96
|
+
def compute_refractive_index(self, wavelength: Length | float) -> numpy.ndarray:
|
|
97
97
|
"""
|
|
98
98
|
Interpolates the refractive index (n) and absorption (k) values for the given wavelength(s).
|
|
99
99
|
|
|
100
100
|
Parameters
|
|
101
101
|
----------
|
|
102
|
-
wavelength : Length
|
|
102
|
+
wavelength : Length | float
|
|
103
103
|
Wavelength(s) in micrometers for which to interpolate n and k.
|
|
104
104
|
|
|
105
105
|
Returns
|
|
@@ -112,6 +112,9 @@ class TabulatedMaterial(BaseMaterial):
|
|
|
112
112
|
ValueError
|
|
113
113
|
If the wavelength is outside the tabulated range.
|
|
114
114
|
"""
|
|
115
|
+
if not isinstance(wavelength, Length):
|
|
116
|
+
wavelength = wavelength * ureg.meter
|
|
117
|
+
|
|
115
118
|
return_as_scalar = numpy.isscalar(wavelength.magnitude)
|
|
116
119
|
|
|
117
120
|
wavelength = numpy.atleast_1d(wavelength)
|
|
@@ -165,6 +165,19 @@ def test_material_string_representation():
|
|
|
165
165
|
assert isinstance(material_repr, str)
|
|
166
166
|
assert isinstance(material_print, str)
|
|
167
167
|
|
|
168
|
+
def test_compute_refractive_index_single_wavelength():
|
|
169
|
+
"""Test computation of refractive index for given wavelengths."""
|
|
170
|
+
material = Material('water')
|
|
171
|
+
|
|
172
|
+
# Test single wavelength input
|
|
173
|
+
wavelength = 500 * ureg.nanometer
|
|
174
|
+
refractive_index_0 = material.compute_refractive_index(wavelength)
|
|
175
|
+
|
|
176
|
+
refractive_index_1 = material.compute_refractive_index(wavelength.to('meter').magnitude)
|
|
177
|
+
|
|
178
|
+
assert np.isclose(refractive_index_0, refractive_index_1)
|
|
179
|
+
|
|
180
|
+
|
|
168
181
|
|
|
169
182
|
if __name__ == "__main__":
|
|
170
183
|
pytest.main(["-W error", "-s", __file__])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|