gdsfactoryplus
¶GDSFactory+ python library.
Modules:
Name | Description |
---|---|
bbox |
Generate cell bbox. |
cli |
GDSFactory+ CLI. |
cli_test |
Test Component Builds. |
core |
GDSFactory+ core utilities. |
explore |
PDK exploration utilities. |
export_spice |
Uses VLSIRTools to convert from Klayout's DB Netlist to common spice formats. |
freeze |
Freeze a python cell as schematic netlist. |
generate_svg |
Generate SVG from cell. |
lazy |
Lazy module imports. |
logger |
GDSFactory+ Logger. |
models |
GDSFactory+ Pydantic models. |
parse_oc_spice |
Parse OC Spice. |
project |
Find the GDSFactory+ project folder. |
serve |
GDSFactory+ Server. |
settings |
Parse the GDSFactory+ settings. |
show |
Show a python object in a vscode panel. |
version |
Simply the GDSFactory+ version. |
Classes:
Name | Description |
---|---|
DoItForMe |
DoItForMe Data. |
ErrorMessage |
A message to vscode to trigger an error popup. |
RefreshTreesMessage |
A message to vscode to trigger a pics tree reload. |
ReloadLayoutMessage |
A message to vscode to trigger a gds viewer reload. |
ReloadSchematicMessage |
A message to vscode to trigger a schematic reload. |
RestartServerMessage |
A message to vscode to trigger a server restart. |
Result |
Result class containing logs and errors to be returned. |
ShowGdsMessage |
A message to vscode to show a GDS. |
ShowMessage |
A message to vscode to show an object. |
SimulationConfig |
Data model for simulation configuration. |
SimulationData |
Data model for simulation. |
UpdateProgressMessage |
A message to vscode to update progress status. |
User |
User class containing user information from GDSFactory+. |
Functions:
Name | Description |
---|---|
activate_pdk_by_name |
Activate a PDK by name and return the pdk. |
build_cell |
Build a cell given the path where it's defined and the cell name. |
build_component_with_inserted_defaults |
Build a component with inserted defaults. |
check_conn |
Run connectivity check on the given GDS file. |
check_drc |
Run DRC check on the given GDS file. |
classify_cells |
Classify cells. |
clear_cells_from_cache |
Clear cells from cache by factory names. |
cli_environment |
Get a CLI environment. |
ensure_recursive_netlist |
Ensure that a given object is a recursive netlist. |
find_docode_project_dir |
Find the GDSFactory+ project folder, return None if not found. |
fix_log_line_numbers |
Patches a different format for file + line nr combination into logs. |
generate_multipolygon |
Generate a MultiPolygon from a component. |
get_base_schema |
Get base netlist schema. |
get_cell_path |
Get the path of the file to which a cell belongs. |
get_cells |
Returns PCells (component functions) from a module or list of modules. |
get_custom_cell_names |
Get the project components of a pdk. |
get_logger |
Get the GDSFactory+ logger. |
get_module |
Get the module to which a cell belongs. |
get_netlist_schema |
Get the schema for a specific netlist. |
get_pdk_cell_names |
Get all the cell names of the foundry PDK. |
get_pdk_graph |
Get a graph of all cells and their dependencies in the PDK. |
get_ports |
Get the ports from a component. |
get_python_cells |
Get all python cells within a folder. |
get_settings |
Get the gdsfactoryplus settings. |
get_svg |
Get the (possible cached) svg for a cell. |
get_top_level_cells |
Get top level cells in th epdk graph with possibility to filer out some. |
get_yaml_cell_name |
Get the cell name of a yaml cell. |
get_yaml_cell_path |
Get the path of the file to which a yaml cell belongs. |
get_yaml_cells |
Get all yaml cells within a folder. |
get_yaml_paths |
Get all yaml pic paths within a folder. |
guess_default_pcell_argument |
Guess the default argument of a pcell. |
ignore_prints |
Ignore any output to stdout or stderr. |
import_module_from_path |
Import a python module given its name and path. |
import_pdk |
Import a pdk by name without activating. |
import_pdk_from_path |
Import a pdk by path to the pdk and give it a name. |
import_python_modules |
Import all python modules within a folder. |
is_cell |
Returns True if a function is a cell (component function). |
is_from_module |
Check if a member is part of a module. |
is_shadowing_pdk_component |
Check if a component name shadows a PDK component. |
lazy_import |
Lazily import a module. |
lazy_setattr |
Lazily set an attribute on a LazyModule. |
list_cells_from_regex |
Find all cells in a python file decorated with @cell using a regex. |
load_kcl |
Load KCL file. |
maybe |
Maybe execute a function, if it failes return None. |
maybe_find_docode_project_dir |
Find the GDSFactory+ project folder, raise FileNotFoundErorr if not found. |
maybe_open |
Maybe open a file, if opening fails use sys.stderr as file. |
merge_rdb_strings |
Merge RDB Strings. |
optical_lvs |
Perform optical lvs on a cell. |
plot_pdk_relations |
Plot PDK releationships with matplotlib. |
print_to_file |
Print content to a file. |
register_cells |
Register all cells in a given folder. |
save_kcl |
Save KCL file. |
send_error |
Show an error message in vscode. |
send_message |
Send a message to vscode. |
show_cell |
Show a cell in vscode. |
try_get_ports |
Maybe get the ports from a component, but return an empty dict otherwise. |
validate_access |
Validates the API key and returns the license information. |
DoItForMe
¶
Bases: BaseModel
DoItForMe Data.
ErrorMessage
¶
Bases: BaseModel
A message to vscode to trigger an error popup.
RefreshTreesMessage
¶
Bases: BaseModel
A message to vscode to trigger a pics tree reload.
ReloadLayoutMessage
¶
Bases: BaseModel
A message to vscode to trigger a gds viewer reload.
ReloadSchematicMessage
¶
Bases: BaseModel
A message to vscode to trigger a schematic reload.
RestartServerMessage
¶
Bases: BaseModel
A message to vscode to trigger a server restart.
Result
¶
Bases: BaseModel
Result class containing logs and errors to be returned.
ShowGdsMessage
¶
Bases: BaseModel
A message to vscode to show a GDS.
ShowMessage
¶
Bases: BaseModel
A message to vscode to show an object.
SimulationConfig
¶
Bases: BaseModel
Data model for simulation configuration.
SimulationData
¶
Bases: BaseModel
Data model for simulation.
UpdateProgressMessage
¶
Bases: BaseModel
A message to vscode to update progress status.
User
¶
Bases: BaseModel
User class containing user information from GDSFactory+.
activate_pdk_by_name
¶Activate a PDK by name and return the pdk.
build_cell
¶Build a cell given the path where it's defined and the cell name.
build_component_with_inserted_defaults
¶build_component_with_inserted_defaults(pcell_name: str) -> Component
Build a component with inserted defaults.
check_conn
¶
check_drc
¶check_drc(
path: str | Path,
pdk: str = pdk or name,
process: str = process,
timeout: int = timeout,
host: str = host,
api_key: str = key,
*,
verbose: bool = True,
) -> str
Run DRC check on the given GDS file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
path to the GDS file to run the check on. |
required |
pdk
|
str
|
PDK to use for the check. |
pdk or name
|
process
|
str
|
the drc rules might be slightly different depending on the process |
process
|
timeout
|
int
|
timeout in seconds for the check (DRC only). |
timeout
|
host
|
str
|
api host (DRC only). |
host
|
api_key
|
str
|
the api key (DRC only). |
key
|
verbose
|
bool
|
if True, print status messages to stderr. |
True
|
the connectivity check runs locally, so for this check the api
parameters timeout
, host
, api_key
will be ignored.
clear_cells_from_cache
¶Clear cells from cache by factory names.
cli_environment
¶cli_environment(
ignore_stdout: bool, ignore_stderr: bool, pdk_name: str | None = None
) -> Generator[None, None, None]
Get a CLI environment.
ensure_recursive_netlist
¶Ensure that a given object is a recursive netlist.
find_docode_project_dir
¶find_docode_project_dir() -> Path
Find the GDSFactory+ project folder, return None if not found.
fix_log_line_numbers
¶Patches a different format for file + line nr combination into logs.
generate_multipolygon
¶Generate a MultiPolygon from a component.
get_cell_path
¶Get the path of the file to which a cell belongs.
get_cells
¶get_cells(
modules: Iterable[ModuleType],
*,
ignore_not_from_module: bool = True,
ignore_non_decorated: bool = True,
ignore_underscored: bool = False,
ignore_partials: bool = False,
) -> dict[str, Callable[..., Component]]
Returns PCells (component functions) from a module or list of modules.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
modules
|
Iterable[ModuleType]
|
A module or an iterable of modules. |
required |
ignore_not_from_module
|
bool
|
only include functions that are from the module. |
True
|
ignore_non_decorated
|
bool
|
only include functions that are decorated with gf.cell |
True
|
ignore_underscored
|
bool
|
only include functions that do not start with '_' |
False
|
ignore_partials
|
bool
|
only include functions, not partials. |
False
|
get_custom_cell_names
¶Get the project components of a pdk.
get_netlist_schema
¶get_netlist_schema(netlist: dict) -> Schema
Get the schema for a specific netlist.
get_pdk_cell_names
¶Get all the cell names of the foundry PDK.
get_pdk_graph
¶Get a graph of all cells and their dependencies in the PDK.
get_python_cells
¶get_python_cells(
folder: str, paths: list[str] | None = None, logger: Logger | None = None
) -> dict[str, Callable[..., Component]]
Get all python cells within a folder.
get_svg
cached
¶Get the (possible cached) svg for a cell.
get_top_level_cells
¶Get top level cells in th epdk graph with possibility to filer out some.
get_yaml_cell_path
¶Get the path of the file to which a yaml cell belongs.
get_yaml_cells
¶get_yaml_cells(
folder: str, paths: list[str] | None = None
) -> dict[str, Callable[..., Component]]
Get all yaml cells within a folder.
get_yaml_paths
¶Get all yaml pic paths within a folder.
guess_default_pcell_argument
¶Guess the default argument of a pcell.
ignore_prints
¶Ignore any output to stdout or stderr.
import_module_from_path
¶import_module_from_path(module_name: str, file_path: str) -> ModuleType
Import a python module given its name and path.
import_pdk_from_path
¶Import a pdk by path to the pdk and give it a name.
This is useful if the pdk is not installed in the current environment.
import_python_modules
¶import_python_modules(folder: str, logger: Logger | None = None) -> list[ModuleType]
Import all python modules within a folder.
is_cell
¶is_cell(
func: Any,
*,
ignore_non_decorated: bool = False,
ignore_underscored: bool = True,
ignore_partials: bool = False,
name: str = "",
) -> bool
Returns True if a function is a cell (component function).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func
|
Any
|
A function or partial function. |
required |
ignore_non_decorated
|
bool
|
only include functions that are decorated with gf.cell |
False
|
ignore_underscored
|
bool
|
only include functions that do not start with '_' |
True
|
ignore_partials
|
bool
|
only include functions, not partials |
False
|
name
|
str
|
The name of the function. |
''
|
is_from_module
¶is_from_module(member: Any, module: ModuleType, *, ignore_partials: bool) -> bool
Check if a member is part of a module.
is_shadowing_pdk_component
¶Check if a component name shadows a PDK component.
lazy_setattr
¶Lazily set an attribute on a LazyModule.
maybe
¶Maybe execute a function, if it failes return None.
maybe_find_docode_project_dir
¶maybe_find_docode_project_dir() -> Path | None
Find the GDSFactory+ project folder, raise FileNotFoundErorr if not found.
maybe_open
¶maybe_open(path: str, mode: str) -> Generator[TextIOWrapper, None, None]
Maybe open a file, if opening fails use sys.stderr as file.
optical_lvs
¶optical_lvs(
cell: DKCell, ref: str, equivalent_ports: dict[str, list[list[str]]] | None = None
) -> ReportDatabase
Perform optical lvs on a cell.
register_cells
¶register_cells(
folder: str | None = None,
yaml_cells: dict[str, Callable[..., Component]] | None = None,
python_cells: dict[str, Callable[..., Component]] | None = None,
logger: Logger | None = None,
) -> None
Register all cells in a given folder.
send_error
¶Show an error message in vscode.
show_cell
¶show_cell(
cell: ProtoTKCell | Path | str,
lyrdb: ReportDatabase | Path | str | None = None,
l2n: LayoutToNetlist | Path | str | None = None,
keep_position: bool = True,
save_options: SaveLayoutOptions | None = None,
use_libraries: bool = True,
library_save_options: SaveLayoutOptions | None = None,
technology: str | None = None,
**kwargs: Any,
) -> None
Show a cell in vscode.
try_get_ports
¶Maybe get the ports from a component, but return an empty dict otherwise.