PyMieSimX 0.1.0__py3-none-any.whl
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.
- PyMieSimX/__init__.py +5 -0
- PyMieSimX/__main__.py +35 -0
- PyMieSimX/gui/__init__.py +5 -0
- PyMieSimX/gui/assets/card-state.js +41 -0
- PyMieSimX/gui/assets/dashboard.css +3352 -0
- PyMieSimX/gui/assets/default-settings.json +32 -0
- PyMieSimX/gui/assets/logo.png +0 -0
- PyMieSimX/gui/assets/pymiesim-favicon.svg +6 -0
- PyMieSimX/gui/assets/pymiesim-logo-dark.svg +15 -0
- PyMieSimX/gui/assets/pymiesim-logo.svg +39 -0
- PyMieSimX/gui/components/__init__.py +5 -0
- PyMieSimX/gui/components/cards.py +64 -0
- PyMieSimX/gui/defaults.py +18 -0
- PyMieSimX/gui/interface.py +688 -0
- PyMieSimX/gui/layout.py +329 -0
- PyMieSimX/gui/pages/__init__.py +9 -0
- PyMieSimX/gui/pages/citation.py +66 -0
- PyMieSimX/gui/pages/documentation.py +132 -0
- PyMieSimX/gui/pages/experiment/__init__.py +5 -0
- PyMieSimX/gui/pages/experiment/page.py +49 -0
- PyMieSimX/gui/pages/experiment/sections/__init__.py +5 -0
- PyMieSimX/gui/pages/experiment/sections/configuration.py +42 -0
- PyMieSimX/gui/pages/home.py +152 -0
- PyMieSimX/gui/pages/install_local.py +110 -0
- PyMieSimX/gui/pages/settings.py +87 -0
- PyMieSimX/gui/pages/single/__init__.py +5 -0
- PyMieSimX/gui/pages/single/page.py +28 -0
- PyMieSimX/gui/pages/single/sections/__init__.py +6 -0
- PyMieSimX/gui/pages/single/sections/representations.py +38 -0
- PyMieSimX/gui/pages/single/sections/setup.py +27 -0
- PyMieSimX/gui/parsing.py +149 -0
- PyMieSimX/gui/schemas.py +118 -0
- PyMieSimX/gui/services.py +735 -0
- pymiesimx-0.1.0.dist-info/METADATA +90 -0
- pymiesimx-0.1.0.dist-info/RECORD +39 -0
- pymiesimx-0.1.0.dist-info/WHEEL +5 -0
- pymiesimx-0.1.0.dist-info/entry_points.txt +2 -0
- pymiesimx-0.1.0.dist-info/licenses/LICENSE +21 -0
- pymiesimx-0.1.0.dist-info/top_level.txt +1 -0
PyMieSimX/gui/schemas.py
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""Declarative field schemas for the experiment dashboard."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any, Optional
|
|
5
|
+
|
|
6
|
+
from PyMieSim.units import ureg
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(frozen=True)
|
|
10
|
+
class FieldSpec:
|
|
11
|
+
"""Describe one configurable experiment field rendered by the dashboard."""
|
|
12
|
+
|
|
13
|
+
name: str
|
|
14
|
+
label: str
|
|
15
|
+
kind: str
|
|
16
|
+
default: str
|
|
17
|
+
unit: Optional[Any] = None
|
|
18
|
+
optional: bool = False
|
|
19
|
+
help_text: str = ""
|
|
20
|
+
placeholder: str = ""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
SOURCE_FIELDS = {
|
|
24
|
+
"GaussianSet": (
|
|
25
|
+
FieldSpec("wavelength", "Wavelength", "quantity", "600:1000:150", ureg.nanometer, help_text="Use a single value, comma-separated values, or start:end:count."),
|
|
26
|
+
FieldSpec("polarization", "Polarization Angles", "polarization", "0,90", ureg.degree, help_text="Angles in degrees used to build a PolarizationSet."),
|
|
27
|
+
FieldSpec("optical_power", "Optical Power", "quantity", "1e-3", ureg.watt),
|
|
28
|
+
FieldSpec("numerical_aperture", "Numerical Aperture", "numeric", "0.2"),
|
|
29
|
+
),
|
|
30
|
+
"PlaneWaveSet": (
|
|
31
|
+
FieldSpec("wavelength", "Wavelength", "quantity", "400:1000:350", ureg.nanometer),
|
|
32
|
+
FieldSpec("polarization", "Polarization Angles", "polarization", "0", ureg.degree),
|
|
33
|
+
FieldSpec("amplitude", "Amplitude", "quantity", "1", ureg.volt / ureg.meter),
|
|
34
|
+
),
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
SCATTERER_FIELDS = {
|
|
38
|
+
"SphereSet": (
|
|
39
|
+
FieldSpec("diameter", "Diameter", "quantity", "100,200", ureg.nanometer),
|
|
40
|
+
FieldSpec("material", "Material", "material", "4", help_text="Use refractive indices, complex values, or names such as fused_silica or silver."),
|
|
41
|
+
FieldSpec("medium", "Medium", "medium", "1.0", help_text="Use refractive indices or named media such as water."),
|
|
42
|
+
),
|
|
43
|
+
"InfiniteCylinderSet": (
|
|
44
|
+
FieldSpec("diameter", "Diameter", "quantity", "400:1400:3", ureg.nanometer),
|
|
45
|
+
FieldSpec("material", "Material", "material", "1.4"),
|
|
46
|
+
FieldSpec("medium", "Medium", "medium", "1.0"),
|
|
47
|
+
),
|
|
48
|
+
"CoreShellSet": (
|
|
49
|
+
FieldSpec("core_diameter", "Core Diameter", "quantity", "800:1000:3", ureg.nanometer),
|
|
50
|
+
FieldSpec("shell_thickness", "Shell Thickness", "quantity", "300", ureg.nanometer),
|
|
51
|
+
FieldSpec("core_material", "Core Material", "material", "1.4"),
|
|
52
|
+
FieldSpec("shell_material", "Shell Material", "material", "1.5"),
|
|
53
|
+
FieldSpec("medium", "Medium", "medium", "1.0"),
|
|
54
|
+
),
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
DETECTOR_FIELDS = {
|
|
58
|
+
"None": (),
|
|
59
|
+
"PhotodiodeSet": (
|
|
60
|
+
FieldSpec("numerical_aperture", "Numerical Aperture", "numeric", "0.2"),
|
|
61
|
+
FieldSpec("gamma_offset", "Gamma Offset", "quantity", "0", ureg.degree),
|
|
62
|
+
FieldSpec("phi_offset", "Phi Offset", "quantity", "0", ureg.degree),
|
|
63
|
+
FieldSpec("sampling", "Sampling", "integer", "200"),
|
|
64
|
+
FieldSpec("polarization_filter", "Polarization Filter", "quantity", "", ureg.degree, optional=True, placeholder="None"),
|
|
65
|
+
FieldSpec("medium", "Detector Medium", "medium", "1.0", optional=True, placeholder="1.0 (default)"),
|
|
66
|
+
),
|
|
67
|
+
"CoherentModeSet": (
|
|
68
|
+
FieldSpec("mode_number", "Mode Number", "mode", "LP01", help_text="Use a single mode label or comma-separated labels such as LP01,HG11."),
|
|
69
|
+
FieldSpec("numerical_aperture", "Numerical Aperture", "numeric", "0.1"),
|
|
70
|
+
FieldSpec("gamma_offset", "Gamma Offset", "quantity", "0", ureg.degree),
|
|
71
|
+
FieldSpec("phi_offset", "Phi Offset", "quantity", "0", ureg.degree),
|
|
72
|
+
FieldSpec("rotation", "Rotation", "quantity", "0", ureg.degree),
|
|
73
|
+
FieldSpec("sampling", "Sampling", "integer", "200"),
|
|
74
|
+
FieldSpec("polarization_filter", "Polarization Filter", "quantity", "", ureg.degree, optional=True, placeholder="None"),
|
|
75
|
+
FieldSpec("medium", "Detector Medium", "medium", "1.0", optional=True, placeholder="1.0 (default)"),
|
|
76
|
+
),
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
SECTION_FIELDS = {
|
|
80
|
+
"source": SOURCE_FIELDS,
|
|
81
|
+
"scatterer": SCATTERER_FIELDS,
|
|
82
|
+
"detector": DETECTOR_FIELDS,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
SINGLE_SOURCE_FIELDS = {
|
|
87
|
+
"Gaussian": (
|
|
88
|
+
FieldSpec("wavelength", "Wavelength", "quantity", "632.8", ureg.nanometer),
|
|
89
|
+
FieldSpec("polarization", "Polarization", "quantity", "0", ureg.degree),
|
|
90
|
+
FieldSpec("optical_power", "Optical Power", "quantity", "1e-3", ureg.watt),
|
|
91
|
+
FieldSpec("numerical_aperture", "Numerical Aperture", "numeric", "0.2"),
|
|
92
|
+
),
|
|
93
|
+
"PlaneWave": (
|
|
94
|
+
FieldSpec("wavelength", "Wavelength", "quantity", "632.8", ureg.nanometer),
|
|
95
|
+
FieldSpec("polarization", "Polarization", "quantity", "0", ureg.degree),
|
|
96
|
+
FieldSpec("amplitude", "Amplitude", "quantity", "1", ureg.volt / ureg.meter),
|
|
97
|
+
),
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
SINGLE_SCATTERER_FIELDS = {
|
|
101
|
+
"Sphere": (
|
|
102
|
+
FieldSpec("diameter", "Diameter", "quantity", "200", ureg.nanometer),
|
|
103
|
+
FieldSpec("material", "Material", "material", "1.4"),
|
|
104
|
+
FieldSpec("medium", "Medium", "medium", "1.0"),
|
|
105
|
+
),
|
|
106
|
+
"InfiniteCylinder": (
|
|
107
|
+
FieldSpec("diameter", "Diameter", "quantity", "200", ureg.nanometer),
|
|
108
|
+
FieldSpec("material", "Material", "material", "1.4"),
|
|
109
|
+
FieldSpec("medium", "Medium", "medium", "1.0"),
|
|
110
|
+
),
|
|
111
|
+
"CoreShell": (
|
|
112
|
+
FieldSpec("core_diameter", "Core Diameter", "quantity", "120", ureg.nanometer),
|
|
113
|
+
FieldSpec("shell_thickness", "Shell Thickness", "quantity", "40", ureg.nanometer),
|
|
114
|
+
FieldSpec("core_material", "Core Material", "material", "1.4"),
|
|
115
|
+
FieldSpec("shell_material", "Shell Material", "material", "1.5"),
|
|
116
|
+
FieldSpec("medium", "Medium", "medium", "1.0"),
|
|
117
|
+
),
|
|
118
|
+
}
|