Skip to content

Commit d3300d1

Browse files
author
Christian Carver
committed
Revert "Keyword only arguments. Update simphony/libraries/sipann.py. Clarify description in docs/tutorials/intro.ipynb and add link to PEP 3102."
This reverts commit 50187ac.
1 parent 52cc12d commit d3300d1

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

docs/tutorials/intro.ipynb

+2-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"import sax\n",
136136
"from jax.typing import ArrayLike\n",
137137
"\n",
138-
"def custom_model(*, param: float = 0.5) -> sax.SDict:\n",
138+
"def custom_model(param: float = 0.5) -> sax.SDict:\n",
139139
" \"\"\"This model will have one parameter, param, which defaults to 0.5.\n",
140140
" \n",
141141
" Args:\n",
@@ -164,11 +164,10 @@
164164
"\n",
165165
"* [Python 3 guide for scientists](https://python-3-for-scientists.readthedocs.io/en/latest/python3_advanced.html)\n",
166166
"* [Luke Plant's Blog](https://lukeplant.me.uk/blog/posts/keyword-only-arguments-in-python/)\n",
167-
"* [PEP 3102: Keyword-Only Arguments](https://peps.python.org/pep-3102/)\n",
168167
"```\n",
169168
"\n",
170169
"```{important}\n",
171-
"Model function parameters **are required to be keyword-only**. Syntactically, this means the first argument in the function definition must be `*`.\n",
170+
"Model function parameters **are required to be keyword-only**.\n",
172171
"```\n",
173172
"\n",
174173
"* In the backend, SAX inspects the model signature and passes in only the requested variables to the model function. \n",

simphony/libraries/sipann.py

-10
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def _create_sdict_from_model(model, wl: Union[float, ArrayLike]) -> sax.SDict:
5454

5555

5656
def gap_func_symmetric(
57-
*,
5857
wl: Union[float, ArrayLike] = 1.55,
5958
width: float = 500.0,
6059
thickness: float = 220.0,
@@ -111,7 +110,6 @@ def gap_func_symmetric(
111110

112111

113112
def gap_func_antisymmetric(
114-
*,
115113
wl: Union[float, ArrayLike] = 1.55,
116114
width: float = 500.0,
117115
thickness: float = 220.0,
@@ -180,7 +178,6 @@ def gap_func_antisymmetric(
180178

181179

182180
def half_ring(
183-
*,
184181
wl: Union[float, ArrayLike] = 1.55,
185182
width: float = 500.0,
186183
thickness: float = 220.0,
@@ -233,7 +230,6 @@ def half_ring(
233230

234231

235232
def straight_coupler(
236-
*,
237233
wl: Union[float, ArrayLike] = 1.55,
238234
width: float = 500.0,
239235
thickness: float = 220.0,
@@ -284,7 +280,6 @@ def straight_coupler(
284280

285281

286282
def standard_coupler(
287-
*,
288283
wl: Union[float, ArrayLike] = 1.55,
289284
width: float = 500.0,
290285
thickness: float = 220.0,
@@ -344,7 +339,6 @@ def standard_coupler(
344339

345340

346341
def double_half_ring(
347-
*,
348342
wl: Union[float, ArrayLike] = 1.55,
349343
width: float = 500.0,
350344
thickness: float = 220.0,
@@ -399,7 +393,6 @@ def double_half_ring(
399393

400394

401395
def angled_half_ring(
402-
*,
403396
wl: Union[float, ArrayLike] = 1.55,
404397
width: float = 500.0,
405398
thickness: float = 220.0,
@@ -464,7 +457,6 @@ def angled_half_ring(
464457

465458

466459
def waveguide(
467-
*,
468460
wl: Union[float, ArrayLike] = 1.55,
469461
width: float = 500.0,
470462
thickness: float = 220.0,
@@ -504,7 +496,6 @@ def waveguide(
504496

505497

506498
def racetrack(
507-
*,
508499
wl: Union[float, ArrayLike] = 1.55,
509500
width: float = 500.0,
510501
thickness: float = 220.0,
@@ -563,7 +554,6 @@ def racetrack(
563554

564555

565556
def premade_coupler(
566-
*,
567557
wl: Union[float, ArrayLike] = 1.55,
568558
split: int = 50,
569559
) -> sax.SDict:

0 commit comments

Comments
 (0)