Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into port-checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-goeldi committed Sep 25, 2023
2 parents 23b83ac + 0f05fd5 commit 5156fa6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ nav:
- KCell & Instance: notebooks/01_references.py
- DRC utils: notebooks/02_DRC.py
- Enclosures: notebooks/03_Enclosures.py
- Multiple KCLs: notebooks/04_KCL.py
- Config Class: config.md
- API: reference/
- Changelog: changelog.md
Expand Down
3 changes: 2 additions & 1 deletion docs/source/dosdonts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

## Don'ts

* Do not use "function_name" as a function parameter when using `@kf.cell` decorator,
* "function_name" as a function parameter when using `@kf.cell` decorator,
it will be overwritten by the function name used to create the cell
* "self", "cls" in `@cell` functions, they will be dropped.
4 changes: 3 additions & 1 deletion docs/source/notebooks/04_KCL.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
# name: python3
# ---

# # KCLayout / PDK: Using multiple KCLayout objects as PDKs or Libraries of KCells and parametric KCell-Functions
# # Multi - KCLayout / PDK

# Using multiple KCLayout objects as PDKs or Libraries of KCells and parametric KCell-Functions

# ## Use multiple KCLayout objects as PDKs/Libraries
#
Expand Down
8 changes: 6 additions & 2 deletions src/kfactory/kcell.py
Original file line number Diff line number Diff line change
Expand Up @@ -3944,9 +3944,13 @@ def wrapped_cell(
cell.name = name
if set_settings:
settings = cell.settings.model_dump()
if "self" in params:
settings["function_name"] = params["self"].__class__.__name__
else:
settings["function_name"] = f.__name__
params.pop("self", None)
params.pop("cls", None)
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 5156fa6

Please sign in to comment.