Skip to content

Commit

Permalink
Merge pull request #181 from gdsfactory/180-save-name-of-python-funct…
Browse files Browse the repository at this point in the history
…ion-in-kcell-metadata

180 save name of python function in kcell metadata
  • Loading branch information
sebastian-goeldi authored Sep 18, 2023
2 parents 957cbe3 + 7cb5026 commit 9bf86ce
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/180.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added to be set by decorator
Binary file added demo.gds
Binary file not shown.
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ nav:
- Home:
- Intro: index.md
- gdsfactory.md
- dosdonts.md
- First Steps:
- Prerequisites: pre.md
- 5min Intro to KFactory: intro.md
Expand Down
9 changes: 9 additions & 0 deletions docs/source/dosdonts.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/kfactory/kcell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9bf86ce

Please sign in to comment.