diff --git a/changelog.d/180.added.md b/changelog.d/180.added.md new file mode 100644 index 00000000..c798eaaa --- /dev/null +++ b/changelog.d/180.added.md @@ -0,0 +1 @@ +Added to be set by decorator \ No newline at end of file diff --git a/demo.gds b/demo.gds new file mode 100644 index 00000000..85006bad Binary files /dev/null and b/demo.gds differ diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 481bba71..a535c2cd 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -7,6 +7,7 @@ nav: - Home: - Intro: index.md - gdsfactory.md + - dosdonts.md - First Steps: - Prerequisites: pre.md - 5min Intro to KFactory: intro.md diff --git a/docs/source/dosdonts.md b/docs/source/dosdonts.md new file mode 100644 index 00000000..e19989ff --- /dev/null +++ b/docs/source/dosdonts.md @@ -0,0 +1,9 @@ +# Dos and Don'ts + + +## Dos + +## Don'ts + +* Do not use "function_name" as a function parameter when using `@kf.cell` decorator, + it will be overwritten by the function name used to create the cell diff --git a/src/kfactory/kcell.py b/src/kfactory/kcell.py index 1e08542a..fedf380d 100644 --- a/src/kfactory/kcell.py +++ b/src/kfactory/kcell.py @@ -3520,6 +3520,8 @@ def wrapped_cell( if set_settings: settings = cell.settings.model_dump() settings.update(params) + if set_name: + settings["function_name"] = name cell._settings = KCellSettings(**settings) info = cell.info.model_dump() for name, value in cell.info: