5
5
6
6
class TestBidirectional_coupler :
7
7
def test_invalid_parameters (self ):
8
- with pytest .raises (ValueError ):
8
+ with pytest .raises (TypeError ):
9
9
siepic .bidirectional_coupler (pol = "tem" )
10
- with pytest .raises (ValueError ):
10
+ with pytest .raises (TypeError ):
11
11
siepic .bidirectional_coupler (pol = "te" , thickness = 200 )
12
12
13
13
def test_instantiable (self ):
14
14
siepic .bidirectional_coupler (thickness = 220 , width = 500 )
15
15
16
16
def test_s_params (self , std_wl_um ):
17
- bdc = siepic .bidirectional_coupler ()
18
- bdc (std_wl_um )
17
+ s = siepic .bidirectional_coupler (wl = std_wl_um )
19
18
20
19
21
20
class Testdirectional_coupler :
22
21
def test_invalid_parameters (self ):
23
- with pytest .raises (ValueError ):
22
+ with pytest .raises (FileNotFoundError ):
24
23
siepic .directional_coupler (gap = 300 )
25
24
26
25
def test_instantiable (self ):
27
26
siepic .directional_coupler (gap = 200 , coupling_length = 45 )
28
27
29
28
def test_s_params (self , std_wl_um ):
30
- dc = siepic .directional_coupler (gap = 200 , coupling_length = 45 )
31
- dc (std_wl_um )
29
+ s = siepic .directional_coupler (wl = std_wl_um , gap = 200 , coupling_length = 45 )
32
30
33
31
34
32
class Testgrating_coupler :
@@ -42,15 +40,14 @@ def test_instantiable(self):
42
40
siepic .grating_coupler (pol = "te" , thickness = 220 , dwidth = 0 )
43
41
44
42
def test_s_params (self , std_wl_um ):
45
- gc = siepic .grating_coupler (pol = "te" )
46
- gc (std_wl_um )
43
+ s = siepic .grating_coupler (wl = std_wl_um , pol = "te" )
47
44
48
45
49
46
class Testhalf_ring :
50
47
def test_invalid_parameters (self ):
51
48
with pytest .raises (ValueError ):
52
49
siepic .half_ring (pol = "tem" )
53
- with pytest .raises (ValueError ):
50
+ with pytest .raises (FileNotFoundError ):
54
51
siepic .half_ring (pol = "te" , gap = 30 , radius = 10 )
55
52
56
53
def test_instantiable (self ):
@@ -59,25 +56,29 @@ def test_instantiable(self):
59
56
)
60
57
61
58
def test_s_params (self , std_wl_um ):
62
- ring = siepic .half_ring (
63
- pol = "te" , gap = 50 , radius = 5 , width = 500 , thickness = 220 , coupling_length = 0
59
+ s = siepic .half_ring (
60
+ wl = std_wl_um ,
61
+ pol = "te" ,
62
+ gap = 50 ,
63
+ radius = 5 ,
64
+ width = 500 ,
65
+ thickness = 220 ,
66
+ coupling_length = 0 ,
64
67
)
65
- ring (std_wl_um )
66
68
67
69
68
70
class Testtaper :
69
71
def test_invalid_parameters (self ):
70
- with pytest .raises (ValueError ):
72
+ with pytest .raises (FileNotFoundError ):
71
73
siepic .taper (w1 = 0.3 )
72
- with pytest .raises (ValueError ):
74
+ with pytest .raises (FileNotFoundError ):
73
75
siepic .taper (w2 = 0.5 )
74
76
75
77
def test_instantiable (self ):
76
78
siepic .taper (w1 = 0.5 , w2 = 1.0 , length = 10.0 )
77
79
78
80
def test_s_params (self , std_wl_um ):
79
- taper = siepic .taper (w1 = 0.5 , w2 = 1.0 , length = 10.0 )
80
- taper (std_wl_um )
81
+ s = siepic .taper (wl = std_wl_um , w1 = 0.5 , w2 = 1.0 , length = 10.0 )
81
82
82
83
83
84
class Testterminator :
@@ -90,25 +91,24 @@ def test_instantiable(self):
90
91
siepic .terminator (pol = "tm" )
91
92
92
93
def test_s_params (self , std_wl_um ):
93
- term = siepic .terminator (pol = "te" )
94
- term (std_wl_um )
95
- term = siepic .terminator (pol = "tm" )
96
- term (std_wl_um )
94
+ s = siepic .terminator (wl = std_wl_um , pol = "te" )
95
+ s = siepic .terminator (wl = std_wl_um , pol = "tm" )
97
96
98
97
99
98
class Testwaveguide :
100
99
def test_invalid_parameters (self ):
101
100
with pytest .raises (ValueError ):
102
101
siepic .waveguide (pol = "tem" )
103
- with pytest .raises (ValueError ):
102
+ with pytest .raises (FileNotFoundError ):
104
103
siepic .waveguide (height = 200 )
105
104
106
105
def test_instantiable (self ):
107
106
siepic .waveguide (pol = "te" , length = 100 , width = 500 , height = 220 , loss = 2 )
108
107
109
108
def test_s_params (self , std_wl_um ):
110
- wg = siepic .waveguide (pol = "te" , length = 100 , width = 500 , height = 220 , loss = 2 )
111
- wg (std_wl_um )
109
+ s = siepic .waveguide (
110
+ wl = std_wl_um , pol = "te" , length = 100 , width = 500 , height = 220 , loss = 2
111
+ )
112
112
113
113
114
114
class Testy_branch :
@@ -120,5 +120,4 @@ def test_instantiable(self):
120
120
siepic .y_branch (pol = "te" , thickness = 220 , width = 500 )
121
121
122
122
def test_s_params (self , std_wl_um ):
123
- yb = siepic .y_branch (pol = "te" )
124
- yb (std_wl_um )
123
+ s = siepic .y_branch (wl = std_wl_um , pol = "te" )
0 commit comments