Skip to content

Commit

Permalink
Revert "Keyword only arguments. Update simphony/libraries/sipann.py. …
Browse files Browse the repository at this point in the history
…Clarify description in docs/tutorials/intro.ipynb and add link to PEP 3102."

This reverts commit 50187ac.
  • Loading branch information
Christian Carver committed Oct 28, 2024
1 parent 52cc12d commit d3300d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
5 changes: 2 additions & 3 deletions docs/tutorials/intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"import sax\n",
"from jax.typing import ArrayLike\n",
"\n",
"def custom_model(*, param: float = 0.5) -> sax.SDict:\n",
"def custom_model(param: float = 0.5) -> sax.SDict:\n",
" \"\"\"This model will have one parameter, param, which defaults to 0.5.\n",
" \n",
" Args:\n",
Expand Down Expand Up @@ -164,11 +164,10 @@
"\n",
"* [Python 3 guide for scientists](https://python-3-for-scientists.readthedocs.io/en/latest/python3_advanced.html)\n",
"* [Luke Plant's Blog](https://lukeplant.me.uk/blog/posts/keyword-only-arguments-in-python/)\n",
"* [PEP 3102: Keyword-Only Arguments](https://peps.python.org/pep-3102/)\n",
"```\n",
"\n",
"```{important}\n",
"Model function parameters **are required to be keyword-only**. Syntactically, this means the first argument in the function definition must be `*`.\n",
"Model function parameters **are required to be keyword-only**.\n",
"```\n",
"\n",
"* In the backend, SAX inspects the model signature and passes in only the requested variables to the model function. \n",
Expand Down
10 changes: 0 additions & 10 deletions simphony/libraries/sipann.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def _create_sdict_from_model(model, wl: Union[float, ArrayLike]) -> sax.SDict:


def gap_func_symmetric(
*,
wl: Union[float, ArrayLike] = 1.55,
width: float = 500.0,
thickness: float = 220.0,
Expand Down Expand Up @@ -111,7 +110,6 @@ def gap_func_symmetric(


def gap_func_antisymmetric(
*,
wl: Union[float, ArrayLike] = 1.55,
width: float = 500.0,
thickness: float = 220.0,
Expand Down Expand Up @@ -180,7 +178,6 @@ def gap_func_antisymmetric(


def half_ring(
*,
wl: Union[float, ArrayLike] = 1.55,
width: float = 500.0,
thickness: float = 220.0,
Expand Down Expand Up @@ -233,7 +230,6 @@ def half_ring(


def straight_coupler(
*,
wl: Union[float, ArrayLike] = 1.55,
width: float = 500.0,
thickness: float = 220.0,
Expand Down Expand Up @@ -284,7 +280,6 @@ def straight_coupler(


def standard_coupler(
*,
wl: Union[float, ArrayLike] = 1.55,
width: float = 500.0,
thickness: float = 220.0,
Expand Down Expand Up @@ -344,7 +339,6 @@ def standard_coupler(


def double_half_ring(
*,
wl: Union[float, ArrayLike] = 1.55,
width: float = 500.0,
thickness: float = 220.0,
Expand Down Expand Up @@ -399,7 +393,6 @@ def double_half_ring(


def angled_half_ring(
*,
wl: Union[float, ArrayLike] = 1.55,
width: float = 500.0,
thickness: float = 220.0,
Expand Down Expand Up @@ -464,7 +457,6 @@ def angled_half_ring(


def waveguide(
*,
wl: Union[float, ArrayLike] = 1.55,
width: float = 500.0,
thickness: float = 220.0,
Expand Down Expand Up @@ -504,7 +496,6 @@ def waveguide(


def racetrack(
*,
wl: Union[float, ArrayLike] = 1.55,
width: float = 500.0,
thickness: float = 220.0,
Expand Down Expand Up @@ -563,7 +554,6 @@ def racetrack(


def premade_coupler(
*,
wl: Union[float, ArrayLike] = 1.55,
split: int = 50,
) -> sax.SDict:
Expand Down

0 comments on commit d3300d1

Please sign in to comment.