ElectroMagneticPython 2.2.1__tar.gz → 2.2.3__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 (68) hide show
  1. electromagneticpython-2.2.3/.bumpversion.cfg +6 -0
  2. electromagneticpython-2.2.3/.flake8 +3 -0
  3. electromagneticpython-2.2.3/.github/dependabot.yml +13 -0
  4. electromagneticpython-2.2.3/.github/workflows/codeql-analysis.yml +70 -0
  5. electromagneticpython-2.2.3/.github/workflows/publish.yml +36 -0
  6. electromagneticpython-2.2.3/.github/workflows/python-app.yml +40 -0
  7. electromagneticpython-2.2.3/.gitignore +8 -0
  8. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/RCWA.py +32 -12
  9. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/__init__.py +10 -2
  10. electromagneticpython-2.2.3/EMpy/_version.py +34 -0
  11. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/devices.py +4 -27
  12. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/materials.py +1 -6
  13. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/modesolvers/FD.py +34 -72
  14. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/modesolvers/FMM.py +24 -23
  15. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/modesolvers/__init__.py +1 -0
  16. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/modesolvers/geometries.py +8 -9
  17. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/utils.py +12 -24
  18. electromagneticpython-2.2.3/ElectroMagneticPython.egg-info/PKG-INFO +99 -0
  19. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/ElectroMagneticPython.egg-info/SOURCES.txt +17 -6
  20. electromagneticpython-2.2.3/ElectroMagneticPython.egg-info/top_level.txt +5 -0
  21. electromagneticpython-2.2.3/Makefile +45 -0
  22. electromagneticpython-2.2.3/PKG-INFO +99 -0
  23. electromagneticpython-2.2.3/README.md +76 -0
  24. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_APRR.py +8 -7
  25. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_NRR.py +11 -9
  26. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_RCWA.py +8 -9
  27. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_RCWA_2.py +8 -9
  28. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_RCWA_3.py +9 -9
  29. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_SRR.py +11 -9
  30. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_laser_etch_monitor.py +5 -9
  31. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_modesolver.py +16 -15
  32. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_modesolver_2.py +11 -10
  33. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_modesolver_3.py +10 -9
  34. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_modesolver_4.py +8 -7
  35. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_transfer_matrix.py +9 -8
  36. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_transfer_matrix_2.py +12 -11
  37. electromagneticpython-2.2.3/examples/ex_transfer_matrix_2.py.png +0 -0
  38. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_transfer_matrix_3.py +10 -9
  39. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/nk.py +2 -8
  40. electromagneticpython-2.2.3/mypy.ini +5 -0
  41. electromagneticpython-2.2.3/pyproject.toml +55 -0
  42. electromagneticpython-2.2.3/scripts/FDTD.py +741 -0
  43. electromagneticpython-2.2.3/setup.cfg +4 -0
  44. electromagneticpython-2.2.3/tests/devices_test.py +31 -0
  45. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/tests/materials_test.py +1 -1
  46. electromagneticpython-2.2.3/tests/modesolvers_test.py +36 -0
  47. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/tests/utils_test.py +9 -5
  48. electromagneticpython-2.2.3/uv.lock +1312 -0
  49. electromagneticpython-2.2.1/EMpy/version.py +0 -1
  50. electromagneticpython-2.2.1/ElectroMagneticPython.egg-info/PKG-INFO +0 -109
  51. electromagneticpython-2.2.1/ElectroMagneticPython.egg-info/top_level.txt +0 -2
  52. electromagneticpython-2.2.1/MANIFEST.in +0 -3
  53. electromagneticpython-2.2.1/PKG-INFO +0 -109
  54. electromagneticpython-2.2.1/README.rst +0 -83
  55. electromagneticpython-2.2.1/requirements.txt +0 -34
  56. electromagneticpython-2.2.1/setup.cfg +0 -11
  57. electromagneticpython-2.2.1/setup.py +0 -42
  58. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/constants.py +0 -0
  59. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/modesolvers/interface.py +0 -0
  60. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/scattering.py +0 -0
  61. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/EMpy/transfer_matrix.py +1 -1
  62. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/ElectroMagneticPython.egg-info/dependency_links.txt +0 -0
  63. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/ElectroMagneticPython.egg-info/requires.txt +0 -0
  64. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/LICENSE +0 -0
  65. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_modesolver_dch.py +0 -0
  66. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/ex_modesolver_dch_anis.py +0 -0
  67. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/examples/lc_data.dat +0 -0
  68. {electromagneticpython-2.2.1 → electromagneticpython-2.2.3}/tests/__init__.py +0 -0
@@ -0,0 +1,6 @@
1
+ [bumpversion]
2
+ commit = True
3
+ sign_tags = True
4
+ tag = True
5
+ tag_name = {new_version}
6
+ current_version = 2.2.3
@@ -0,0 +1,3 @@
1
+ [flake8]
2
+ max-line-length = 130
3
+ ignore = E203,E741,E501,W503,W292
@@ -0,0 +1,13 @@
1
+ # Keep GitHub Actions up to date with GitHub's Dependabot...
2
+ # https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
3
+ # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
4
+ # Working with uv
5
+ # https://docs.astral.sh/uv/guides/integration/dependency-bots/#dependabot
6
+
7
+ version: 2
8
+
9
+ updates:
10
+ - package-ecosystem: uv
11
+ directory: /
12
+ schedule:
13
+ interval: weekly
@@ -0,0 +1,70 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ master ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ master ]
20
+ schedule:
21
+ - cron: '43 12 * * 4'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'python' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v6
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v4
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
+
53
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
+ # If this step fails, then you should remove it and run the build manually (see below)
55
+ - name: Autobuild
56
+ uses: github/codeql-action/autobuild@v4
57
+
58
+ # ℹ️ Command-line programs to run using the OS shell.
59
+ # 📚 https://git.io/JvXDl
60
+
61
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62
+ # and modify them (or add more) to build your code if your project
63
+ # uses a compiled language
64
+
65
+ #- run: |
66
+ # make bootstrap
67
+ # make release
68
+
69
+ - name: Perform CodeQL Analysis
70
+ uses: github/codeql-action/analyze@v4
@@ -0,0 +1,36 @@
1
+ name: Release and Publish
2
+
3
+
4
+ on:
5
+ push:
6
+ tags:
7
+ - '[0-9]+.[0-9]+.[0-9]+'
8
+
9
+ jobs:
10
+ release:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v6
15
+ - name: Release on GitHub
16
+ uses: softprops/action-gh-release@v2
17
+ publish:
18
+ runs-on: ubuntu-latest
19
+ environment:
20
+ name: pypi
21
+ permissions:
22
+ id-token: write
23
+ contents: read
24
+ steps:
25
+ - uses: actions/checkout@v6
26
+
27
+ - name: Install uv and set the Python version
28
+ uses: astral-sh/setup-uv@v7
29
+ with:
30
+ python-version: '3.12'
31
+
32
+ - name: Build
33
+ run: uv build
34
+
35
+ - name: Publish
36
+ run: uv publish
@@ -0,0 +1,40 @@
1
+ name: Python application
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
18
+
19
+ steps:
20
+ - uses: actions/checkout@v6
21
+
22
+ - name: Install uv and set the Python version
23
+ uses: astral-sh/setup-uv@v7
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Install the project
28
+ run: uv sync --locked --all-extras --dev
29
+
30
+ - name: Lint with flake8
31
+ run: uv run flake8 EMpy tests examples scripts
32
+
33
+ - name: Lint with pyflakes
34
+ run: uv run pyflakes EMpy tests examples scripts
35
+
36
+ - name: Lint with mypy
37
+ run: uv run mypy EMpy tests examples scripts
38
+
39
+ - name: Run tests
40
+ run: uv run pytest
@@ -0,0 +1,8 @@
1
+ *.egg-info
2
+ .mypy_cache
3
+ .venv
4
+ .vscode
5
+ build
6
+ dist
7
+ __pycache__
8
+ EMpy/_version.py
@@ -12,6 +12,7 @@ for every diffraction order and layer thickness, and an anisotropic
12
12
  one, only stable for low diffraction orders and thin layers.
13
13
 
14
14
  """
15
+
15
16
  __author__ = "Lorenzo Bolla"
16
17
 
17
18
  import numpy as np
@@ -95,7 +96,6 @@ def dispersion_relation_extraordinary(kx, ky, k, nO, nE, c):
95
96
 
96
97
 
97
98
  class RCWA:
98
-
99
99
  """Class to handle the RCWA solvers.
100
100
 
101
101
  NOTE
@@ -168,7 +168,6 @@ class RCWA:
168
168
 
169
169
 
170
170
  class IsotropicRCWA(RCWA):
171
-
172
171
  """Isotropic RCWA solver."""
173
172
 
174
173
  def solve(self, wls):
@@ -215,7 +214,11 @@ class IsotropicRCWA(RCWA):
215
214
  DE3 = np.zeros_like(DE1)
216
215
 
217
216
  dirk1 = np.array(
218
- [np.sin(alpha) * np.cos(delta), np.sin(alpha) * np.sin(delta), np.cos(alpha)]
217
+ [
218
+ np.sin(alpha) * np.cos(delta),
219
+ np.sin(alpha) * np.sin(delta),
220
+ np.cos(alpha),
221
+ ]
219
222
  )
220
223
 
221
224
  # usefull matrices
@@ -323,7 +326,9 @@ class IsotropicRCWA(RCWA):
323
326
  # H_S_reduced = np.dot(Ky, Ky) + np.dot(Kx, linsolve(E, np.dot(Kx, E11))) - E11
324
327
  H_S_reduced = (
325
328
  (ky / k) ** 2 * I
326
- + kx[:, np.newaxis] / k * linsolve(E, kx[:, np.newaxis] / k * E11)
329
+ + kx[:, np.newaxis]
330
+ / k
331
+ * linsolve(E, kx[:, np.newaxis] / k * E11)
327
332
  - E11
328
333
  )
329
334
 
@@ -448,7 +453,6 @@ class IsotropicRCWA(RCWA):
448
453
 
449
454
 
450
455
  class AnisotropicRCWA(RCWA):
451
-
452
456
  """Anisotropic RCWA solver."""
453
457
 
454
458
  def solve(self, wls):
@@ -487,14 +491,20 @@ class AnisotropicRCWA(RCWA):
487
491
  # grating on the xy plane
488
492
  K = 2 * pi / LAMBDA * np.array([np.sin(phi), 0.0, np.cos(phi)], dtype=complex)
489
493
  dirk1 = np.array(
490
- [np.sin(alpha) * np.cos(delta), np.sin(alpha) * np.sin(delta), np.cos(alpha)]
494
+ [
495
+ np.sin(alpha) * np.cos(delta),
496
+ np.sin(alpha) * np.sin(delta),
497
+ np.cos(alpha),
498
+ ]
491
499
  )
492
500
 
493
501
  # D polarization vector
494
502
  u = np.array(
495
503
  [
496
- np.cos(psi) * np.cos(alpha) * np.cos(delta) - np.sin(psi) * np.sin(delta),
497
- np.cos(psi) * np.cos(alpha) * np.sin(delta) + np.sin(psi) * np.cos(delta),
504
+ np.cos(psi) * np.cos(alpha) * np.cos(delta)
505
+ - np.sin(psi) * np.sin(delta),
506
+ np.cos(psi) * np.cos(alpha) * np.sin(delta)
507
+ + np.sin(psi) * np.cos(delta),
498
508
  -np.cos(psi) * np.sin(alpha),
499
509
  ]
500
510
  )
@@ -814,7 +824,11 @@ class AnisotropicRCWA(RCWA):
814
824
  denom = (k1[2] - np.dot(u, k1) * u[2]).real
815
825
  DEO1[:, iwl] = (
816
826
  -(
817
- (np.absolute(ROx) ** 2 + np.absolute(ROy) ** 2 + np.absolute(ROz) ** 2)
827
+ (
828
+ np.absolute(ROx) ** 2
829
+ + np.absolute(ROy) ** 2
830
+ + np.absolute(ROz) ** 2
831
+ )
818
832
  * np.conj(kO1i[2, :])
819
833
  - (ROx * kO1i[0, :] + ROy * kO1i[1, :] + ROz * kO1i[2, :])
820
834
  * np.conj(ROz)
@@ -823,7 +837,11 @@ class AnisotropicRCWA(RCWA):
823
837
  )
824
838
  DEE1[:, iwl] = (
825
839
  -(
826
- (np.absolute(REx) ** 2 + np.absolute(REy) ** 2 + np.absolute(REz) ** 2)
840
+ (
841
+ np.absolute(REx) ** 2
842
+ + np.absolute(REy) ** 2
843
+ + np.absolute(REz) ** 2
844
+ )
827
845
  * np.conj(kE1i[2, :])
828
846
  - (REx * kE1i[0, :] + REy * kE1i[1, :] + REz * kE1i[2, :])
829
847
  * np.conj(REz)
@@ -833,12 +851,14 @@ class AnisotropicRCWA(RCWA):
833
851
  DEO3[:, iwl] = (
834
852
  (np.absolute(TOx) ** 2 + np.absolute(TOy) ** 2 + np.absolute(TOz) ** 2)
835
853
  * np.conj(kO3i[2, :])
836
- - (TOx * kO3i[0, :] + TOy * kO3i[1, :] + TOz * kO3i[2, :]) * np.conj(TOz)
854
+ - (TOx * kO3i[0, :] + TOy * kO3i[1, :] + TOz * kO3i[2, :])
855
+ * np.conj(TOz)
837
856
  ).real / denom
838
857
  DEE3[:, iwl] = (
839
858
  (np.absolute(TEx) ** 2 + np.absolute(TEy) ** 2 + np.absolute(TEz) ** 2)
840
859
  * np.conj(kE3i[2, :])
841
- - (TEx * kE3i[0, :] + TEy * kE3i[1, :] + TEz * kE3i[2, :]) * np.conj(TEz)
860
+ - (TEx * kE3i[0, :] + TEy * kE3i[1, :] + TEz * kE3i[2, :])
861
+ * np.conj(TEz)
842
862
  ).real / denom
843
863
 
844
864
  # save the results
@@ -10,6 +10,7 @@ The package contains some useful routines to study electromagnetic problems with
10
10
  It is based on U{numpy<http://numpy.scipy.org>} and U{scipy<http://www.scipy.org>}.
11
11
 
12
12
  """
13
+
13
14
  __all__ = [
14
15
  "constants",
15
16
  "devices",
@@ -30,6 +31,13 @@ from . import RCWA
30
31
  from . import scattering
31
32
  from . import transfer_matrix
32
33
  from . import utils
33
- from .version import version
34
34
 
35
- __version__ = version
35
+ try:
36
+ from ._version import version as __version__
37
+ except ImportError:
38
+ # Fallback for development environments or edge cases
39
+ try:
40
+ from importlib.metadata import version, PackageNotFoundError
41
+ __version__ = version("electromagneticpython")
42
+ except PackageNotFoundError:
43
+ __version__ = "0.0.0.dev0"
@@ -0,0 +1,34 @@
1
+ # file generated by setuptools-scm
2
+ # don't change, don't track in version control
3
+
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
12
+
13
+ TYPE_CHECKING = False
14
+ if TYPE_CHECKING:
15
+ from typing import Tuple
16
+ from typing import Union
17
+
18
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
20
+ else:
21
+ VERSION_TUPLE = object
22
+ COMMIT_ID = object
23
+
24
+ version: str
25
+ __version__: str
26
+ __version_tuple__: VERSION_TUPLE
27
+ version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
30
+
31
+ __version__ = version = '2.2.3'
32
+ __version_tuple__ = version_tuple = (2, 2, 3)
33
+
34
+ __commit_id__ = commit_id = 'g346b94fba'
@@ -31,6 +31,7 @@ devices, new ones can be studied.
31
31
  isnumber=8367>}
32
32
 
33
33
  """
34
+
34
35
  __author__ = "Lorenzo Bolla"
35
36
 
36
37
  import numpy
@@ -39,7 +40,6 @@ from functools import reduce
39
40
 
40
41
 
41
42
  class DeviceMatrix:
42
-
43
43
  """Device Matrix.
44
44
 
45
45
  Base class for TransferMatrix and ChainMatrix.
@@ -83,7 +83,6 @@ class DeviceMatrix:
83
83
 
84
84
 
85
85
  class TransferMatrix(DeviceMatrix):
86
-
87
86
  """Transfer Matrix.
88
87
 
89
88
  Notation::
@@ -158,7 +157,6 @@ class TransferMatrix(DeviceMatrix):
158
157
 
159
158
 
160
159
  class ChainMatrix(DeviceMatrix):
161
-
162
160
  """Chain Matrix.
163
161
 
164
162
  Notation::
@@ -289,7 +287,6 @@ def composeCMlist(CMlist):
289
287
 
290
288
 
291
289
  class Device:
292
-
293
290
  """Generic device.
294
291
 
295
292
  Notes
@@ -307,7 +304,6 @@ class Device:
307
304
 
308
305
 
309
306
  class Coupler(Device):
310
-
311
307
  """Coupler.
312
308
 
313
309
  Examples
@@ -436,7 +432,6 @@ class Coupler(Device):
436
432
 
437
433
 
438
434
  class Line(Device):
439
-
440
435
  """Line.
441
436
 
442
437
  Notes
@@ -570,7 +565,6 @@ class Line(Device):
570
565
 
571
566
 
572
567
  class MZ(Device):
573
-
574
568
  """Mach-Zehnder Interferometer (MZI).
575
569
 
576
570
  A MZI is made of two L{Coupler}s connected by a L{Line}.
@@ -679,7 +673,6 @@ class MZ(Device):
679
673
 
680
674
 
681
675
  class APRR(Device):
682
-
683
676
  """All-Pass Ring Resonator.
684
677
 
685
678
  An APRR is made of a L{Coupler} with a feedback line (the ring).
@@ -746,7 +739,6 @@ class APRR(Device):
746
739
 
747
740
 
748
741
  class SRR(Device):
749
-
750
742
  """Single Ring Resonator.
751
743
 
752
744
  A SRR is made of the parallel of a L{Coupler} a feedback line (the
@@ -872,7 +864,6 @@ class SRR(Device):
872
864
 
873
865
 
874
866
  class NRR(Device):
875
-
876
867
  """N-Rings Resonator.
877
868
 
878
869
  A NRR is made of the parallel of two lines connected by N ring resonators.
@@ -996,7 +987,6 @@ class NRR(Device):
996
987
 
997
988
 
998
989
  class T_TCRR(Device):
999
-
1000
990
  """Tunable Triple-Coupled Ring Resonator.
1001
991
 
1002
992
  A T_TCRR is made of a L{MZ}, with a feedback line.
@@ -1056,8 +1046,7 @@ class T_TCRR(Device):
1056
1046
  t4 = numpy.exp(-1j * beta * l[3])
1057
1047
 
1058
1048
  denom = (
1059
- q**3 * Kbar[2] * t3 * t4 * (Kbar[0] * Kbar[1] * t1 - K[0] * K[1] * t2)
1060
- - 1.0
1049
+ q**3 * Kbar[2] * t3 * t4 * (Kbar[0] * Kbar[1] * t1 - K[0] * K[1] * t2) - 1.0
1061
1050
  )
1062
1051
  self.DROP = (
1063
1052
  q**3 * K[2] * t3 * (K[0] * Kbar[1] * t1 + Kbar[0] * K[1] * t2) / denom
@@ -1071,7 +1060,6 @@ class T_TCRR(Device):
1071
1060
 
1072
1061
 
1073
1062
  class T_CRTCRR(Device):
1074
-
1075
1063
  """Tunable Coupled Ring Triple-Coupled Ring Resonator.
1076
1064
 
1077
1065
  NOTE
@@ -1129,16 +1117,7 @@ class T_CRTCRR(Device):
1129
1117
  - q**2 * Kbar[1] * t2**2 * (Kbar[2] - q**3 * t1**2 * N1)
1130
1118
  )
1131
1119
  self.DROP = (
1132
- 1j
1133
- * q**4
1134
- * K[0]
1135
- * K[1]
1136
- * K[2]
1137
- * Kbar[0]
1138
- * t1**1.5
1139
- * t2
1140
- * (1 + t31)
1141
- / denom
1120
+ 1j * q**4 * K[0] * K[1] * K[2] * Kbar[0] * t1**1.5 * t2 * (1 + t31) / denom
1142
1121
  )
1143
1122
  self.THRU = (
1144
1123
  q**2
@@ -1156,7 +1135,6 @@ class T_CRTCRR(Device):
1156
1135
 
1157
1136
 
1158
1137
  class T_CTCRR(Device):
1159
-
1160
1138
  """Tunable Coupled Triple Coupled Ring Resonator.
1161
1139
 
1162
1140
  NOTE
@@ -1363,7 +1341,6 @@ class SWG(Device):
1363
1341
 
1364
1342
 
1365
1343
  class Etalon(Device):
1366
-
1367
1344
  """Etalon.
1368
1345
 
1369
1346
  @ivar R: Reflectivity.
@@ -1402,7 +1379,7 @@ class Etalon(Device):
1402
1379
  self.wl0 = numpy.mean(wls)
1403
1380
  self.FSRwl = self.wl0**2 / (2 * n * l * numpy.cos(self.theta) + self.wl0)
1404
1381
 
1405
- (self.f0, self.FSR) = EMpy.utils.wl2f(self.wl0, self.FSRwl)
1382
+ self.f0, self.FSR = EMpy.utils.wl2f(self.wl0, self.FSRwl)
1406
1383
 
1407
1384
  self.FINESSE = numpy.pi / (2 * numpy.arcsin(1.0 / numpy.sqrt(self.F)))
1408
1385
  # self.FINESSE = numpy.pi * numpy.sqrt(self.F) / 2.
@@ -5,6 +5,7 @@
5
5
  A material is an object with a refractive index function.
6
6
 
7
7
  """
8
+
8
9
  from functools import partial
9
10
 
10
11
  import numpy
@@ -15,7 +16,6 @@ __author__ = "Lorenzo Bolla"
15
16
 
16
17
 
17
18
  class Material:
18
-
19
19
  """Generic class to handle materials.
20
20
 
21
21
  This class is intended to be subclassed to obtain isotropic and
@@ -28,7 +28,6 @@ class Material:
28
28
 
29
29
 
30
30
  class RefractiveIndex:
31
-
32
31
  """Refractive Index.
33
32
 
34
33
  Unaware of temperature.
@@ -146,7 +145,6 @@ class RefractiveIndex:
146
145
 
147
146
 
148
147
  class ThermalOpticCoefficient:
149
-
150
148
  """Thermal Optic Coefficient."""
151
149
 
152
150
  def __init__(self, data=None, T0=300):
@@ -168,7 +166,6 @@ class ThermalOpticCoefficient:
168
166
 
169
167
 
170
168
  class IsotropicMaterial(Material):
171
-
172
169
  """Subclasses Material to describe isotropic materials.
173
170
 
174
171
  Frequency dispersion and thermic aware.
@@ -232,7 +229,6 @@ class EpsilonTensor:
232
229
 
233
230
 
234
231
  class AnisotropicMaterial(Material):
235
-
236
232
  """Subclass Material to describe anisotropic materials.
237
233
 
238
234
  No frequency dispersion nor thermic aware.
@@ -292,7 +288,6 @@ BK7 = IsotropicMaterial(
292
288
 
293
289
 
294
290
  class LiquidCrystal(Material):
295
-
296
291
  """Liquid Crystal.
297
292
 
298
293
  A liquid crystal is determined by it ordinary and extraordinary