gsim 0.0.0__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gsim-0.0.0 → gsim-0.0.3}/PKG-INFO +9 -6
- {gsim-0.0.0 → gsim-0.0.3}/README.md +1 -1
- {gsim-0.0.0 → gsim-0.0.3}/pyproject.toml +18 -5
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim/__init__.py +1 -1
- gsim-0.0.3/src/gsim/common/__init__.py +57 -0
- gsim-0.0.3/src/gsim/common/geometry.py +76 -0
- {gsim-0.0.0/src/gsim/palace → gsim-0.0.3/src/gsim/common}/stack/__init__.py +8 -5
- {gsim-0.0.0/src/gsim/palace → gsim-0.0.3/src/gsim/common}/stack/extractor.py +33 -107
- {gsim-0.0.0/src/gsim/palace → gsim-0.0.3/src/gsim/common}/stack/materials.py +27 -11
- {gsim-0.0.0/src/gsim/palace → gsim-0.0.3/src/gsim/common}/stack/visualization.py +3 -3
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim/gcloud.py +78 -25
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim/palace/__init__.py +85 -45
- gsim-0.0.3/src/gsim/palace/base.py +373 -0
- gsim-0.0.3/src/gsim/palace/driven.py +728 -0
- gsim-0.0.3/src/gsim/palace/eigenmode.py +557 -0
- gsim-0.0.3/src/gsim/palace/electrostatic.py +398 -0
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim/palace/mesh/__init__.py +13 -1
- gsim-0.0.3/src/gsim/palace/mesh/config_generator.py +367 -0
- gsim-0.0.3/src/gsim/palace/mesh/generator.py +278 -0
- gsim-0.0.3/src/gsim/palace/mesh/geometry.py +472 -0
- gsim-0.0.3/src/gsim/palace/mesh/groups.py +170 -0
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim/palace/mesh/pipeline.py +22 -1
- gsim-0.0.3/src/gsim/palace/models/__init__.py +53 -0
- gsim-0.0.3/src/gsim/palace/models/geometry.py +34 -0
- gsim-0.0.3/src/gsim/palace/models/mesh.py +95 -0
- gsim-0.0.3/src/gsim/palace/models/numerical.py +66 -0
- gsim-0.0.3/src/gsim/palace/models/ports.py +137 -0
- gsim-0.0.3/src/gsim/palace/models/problems.py +195 -0
- gsim-0.0.3/src/gsim/palace/models/results.py +160 -0
- gsim-0.0.3/src/gsim/palace/models/stack.py +59 -0
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim/palace/ports/config.py +1 -1
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim/viz.py +9 -6
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim.egg-info/PKG-INFO +9 -6
- gsim-0.0.3/src/gsim.egg-info/SOURCES.txt +39 -0
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim.egg-info/requires.txt +5 -2
- {gsim-0.0.0 → gsim-0.0.3}/tests/test_gsim.py +2 -2
- gsim-0.0.0/src/gsim/palace/mesh/generator.py +0 -956
- gsim-0.0.0/src/gsim.egg-info/SOURCES.txt +0 -22
- {gsim-0.0.0 → gsim-0.0.3}/setup.cfg +0 -0
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim/palace/mesh/gmsh_utils.py +0 -0
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim/palace/ports/__init__.py +0 -0
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim.egg-info/dependency_links.txt +0 -0
- {gsim-0.0.0 → gsim-0.0.3}/src/gsim.egg-info/top_level.txt +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gsim
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Author-email:
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Author-email: GDSFactory <contact@gdsfactory.com>
|
|
5
5
|
Classifier: Programming Language :: Python :: 3.12
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.13
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
7
8
|
Classifier: Operating System :: OS Independent
|
|
8
|
-
Requires-Python:
|
|
9
|
+
Requires-Python: >=3.12
|
|
9
10
|
Description-Content-Type: text/markdown
|
|
10
|
-
Requires-Dist: gdsfactory>=
|
|
11
|
-
Requires-Dist: gdsfactoryplus>=1.3.
|
|
11
|
+
Requires-Dist: gdsfactory>=9.32.0
|
|
12
|
+
Requires-Dist: gdsfactoryplus>=1.3.12
|
|
12
13
|
Requires-Dist: gmsh
|
|
13
14
|
Requires-Dist: meshio>=5.0.0
|
|
14
15
|
Requires-Dist: plotly
|
|
@@ -43,8 +44,10 @@ Requires-Dist: towncrier>=24.0.0; extra == "dev"
|
|
|
43
44
|
Requires-Dist: vega-datasets>=0.9.0; extra == "dev"
|
|
44
45
|
Requires-Dist: nbstripout>=0.8.1; extra == "dev"
|
|
45
46
|
Requires-Dist: ty>=0.0.13; extra == "dev"
|
|
47
|
+
Provides-Extra: docs
|
|
48
|
+
Requires-Dist: ihp-gdsfactory>=0.1.4; extra == "docs"
|
|
46
49
|
|
|
47
|
-
# Gsim 0.0.
|
|
50
|
+
# Gsim 0.0.3
|
|
48
51
|
|
|
49
52
|
> a GDSFactory Simulation Plugin
|
|
50
53
|
|
|
@@ -3,15 +3,16 @@ build-backend = "setuptools.build_meta"
|
|
|
3
3
|
requires = ["setuptools>=61", "uv", "build", "wheel"]
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
|
-
authors = [{name = "
|
|
6
|
+
authors = [{name = "GDSFactory", email = "contact@gdsfactory.com"}]
|
|
7
7
|
classifiers = [
|
|
8
8
|
"Programming Language :: Python :: 3.12",
|
|
9
9
|
"Programming Language :: Python :: 3.13",
|
|
10
|
+
"Programming Language :: Python :: 3.14",
|
|
10
11
|
"Operating System :: OS Independent"
|
|
11
12
|
]
|
|
12
13
|
dependencies = [
|
|
13
|
-
"gdsfactory>=
|
|
14
|
-
"gdsfactoryplus>=1.3.
|
|
14
|
+
"gdsfactory>=9.32.0",
|
|
15
|
+
"gdsfactoryplus>=1.3.12",
|
|
15
16
|
"gmsh",
|
|
16
17
|
"meshio>=5.0.0",
|
|
17
18
|
"plotly",
|
|
@@ -21,8 +22,8 @@ dependencies = [
|
|
|
21
22
|
description = ""
|
|
22
23
|
name = "gsim"
|
|
23
24
|
readme = "README.md"
|
|
24
|
-
requires-python = ">=3.12
|
|
25
|
-
version = "0.0.
|
|
25
|
+
requires-python = ">=3.12"
|
|
26
|
+
version = "0.0.3"
|
|
26
27
|
|
|
27
28
|
[project.optional-dependencies]
|
|
28
29
|
dev = [
|
|
@@ -55,6 +56,9 @@ dev = [
|
|
|
55
56
|
"nbstripout>=0.8.1",
|
|
56
57
|
"ty>=0.0.13"
|
|
57
58
|
]
|
|
59
|
+
docs = [
|
|
60
|
+
"ihp-gdsfactory>=0.1.4"
|
|
61
|
+
]
|
|
58
62
|
|
|
59
63
|
[[tool.bver.file]]
|
|
60
64
|
src = "README.md"
|
|
@@ -65,6 +69,9 @@ src = "pyproject.toml"
|
|
|
65
69
|
[[tool.bver.file]]
|
|
66
70
|
src = "src/gsim/__init__.py"
|
|
67
71
|
|
|
72
|
+
[tool.bver.git]
|
|
73
|
+
commit-template = "Release {new-version}"
|
|
74
|
+
|
|
68
75
|
[tool.mypy]
|
|
69
76
|
mypy_path = ["src"]
|
|
70
77
|
python_version = "3.12"
|
|
@@ -160,6 +167,7 @@ ignore = [
|
|
|
160
167
|
"TC001", # typing-only-first-party-import
|
|
161
168
|
"TC002", # typing-only-third-party-import
|
|
162
169
|
"TC003", # typing-only-standard-library-import
|
|
170
|
+
"PLC0415", # import-outside-top-level (needed for lazy imports to avoid circular deps)
|
|
163
171
|
"TC006", # runtime-cast-value
|
|
164
172
|
"TD001", # invalid-todo-tag
|
|
165
173
|
"TD002", # missing-todo-author
|
|
@@ -185,6 +193,11 @@ select = ["ALL"]
|
|
|
185
193
|
"SLF001", # private-member-access
|
|
186
194
|
"T201" # print
|
|
187
195
|
]
|
|
196
|
+
"docs/hooks.py" = [
|
|
197
|
+
"ARG001", # unused-function-argument (MkDocs hooks require specific signatures)
|
|
198
|
+
"INP001", # implicit-namespace-package
|
|
199
|
+
"PERF401" # use-list-extend (keeping for readability)
|
|
200
|
+
]
|
|
188
201
|
"scripts/*.py" = [
|
|
189
202
|
"ANN", # flake8-annotations
|
|
190
203
|
"ARG001", # unused-function-argument
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Common components shared between Palace and FDTD solvers.
|
|
2
|
+
|
|
3
|
+
This module provides shared data models and utilities that can be used
|
|
4
|
+
across different electromagnetic solvers (Palace, FDTD, etc.).
|
|
5
|
+
|
|
6
|
+
Classes:
|
|
7
|
+
Geometry: Wrapper for gdsfactory Component with computed properties
|
|
8
|
+
LayerStack: Layer stack data model with extraction from PDK
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from gsim.common.geometry import Geometry
|
|
14
|
+
from gsim.common.stack import (
|
|
15
|
+
MATERIALS_DB,
|
|
16
|
+
Layer,
|
|
17
|
+
LayerStack,
|
|
18
|
+
MaterialProperties,
|
|
19
|
+
StackLayer,
|
|
20
|
+
ValidationResult,
|
|
21
|
+
extract_from_pdk,
|
|
22
|
+
extract_layer_stack,
|
|
23
|
+
get_material_properties,
|
|
24
|
+
get_stack,
|
|
25
|
+
load_stack_yaml,
|
|
26
|
+
material_is_conductor,
|
|
27
|
+
material_is_dielectric,
|
|
28
|
+
parse_layer_stack,
|
|
29
|
+
plot_stack,
|
|
30
|
+
print_stack,
|
|
31
|
+
print_stack_table,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
# Alias for backward compatibility
|
|
35
|
+
Stack = LayerStack
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"MATERIALS_DB",
|
|
39
|
+
"Geometry",
|
|
40
|
+
"Layer",
|
|
41
|
+
"LayerStack",
|
|
42
|
+
"MaterialProperties",
|
|
43
|
+
"Stack",
|
|
44
|
+
"StackLayer",
|
|
45
|
+
"ValidationResult",
|
|
46
|
+
"extract_from_pdk",
|
|
47
|
+
"extract_layer_stack",
|
|
48
|
+
"get_material_properties",
|
|
49
|
+
"get_stack",
|
|
50
|
+
"load_stack_yaml",
|
|
51
|
+
"material_is_conductor",
|
|
52
|
+
"material_is_dielectric",
|
|
53
|
+
"parse_layer_stack",
|
|
54
|
+
"plot_stack",
|
|
55
|
+
"print_stack",
|
|
56
|
+
"print_stack_table",
|
|
57
|
+
]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""Geometry wrapper for gdsfactory components.
|
|
2
|
+
|
|
3
|
+
This module provides a Geometry class that wraps gdsfactory Components
|
|
4
|
+
with computed properties useful for simulation setup.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from functools import cached_property
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
from pydantic import BaseModel, ConfigDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Geometry(BaseModel):
|
|
16
|
+
"""Shared geometry wrapper for gdsfactory Component.
|
|
17
|
+
|
|
18
|
+
This class wraps a gdsfactory Component and provides computed properties
|
|
19
|
+
that are useful for simulation setup (bounds, ports, etc.).
|
|
20
|
+
|
|
21
|
+
Attributes:
|
|
22
|
+
component: The wrapped gdsfactory Component
|
|
23
|
+
|
|
24
|
+
Example:
|
|
25
|
+
>>> from gdsfactory.components import straight
|
|
26
|
+
>>> c = straight(length=100)
|
|
27
|
+
>>> geom = Geometry(component=c)
|
|
28
|
+
>>> print(geom.bounds)
|
|
29
|
+
(0.0, -0.25, 100.0, 0.25)
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
33
|
+
|
|
34
|
+
component: Any # gdsfactory Component (Any to avoid import issues)
|
|
35
|
+
|
|
36
|
+
@cached_property
|
|
37
|
+
def bounds(self) -> tuple[float, float, float, float]:
|
|
38
|
+
"""Get bounding box (xmin, ymin, xmax, ymax) in um."""
|
|
39
|
+
bbox = self.component.dbbox()
|
|
40
|
+
return (bbox.left, bbox.bottom, bbox.right, bbox.top)
|
|
41
|
+
|
|
42
|
+
@cached_property
|
|
43
|
+
def ports(self) -> list:
|
|
44
|
+
"""Get list of ports on the component."""
|
|
45
|
+
return list(self.component.ports)
|
|
46
|
+
|
|
47
|
+
@cached_property
|
|
48
|
+
def port_names(self) -> list[str]:
|
|
49
|
+
"""Get list of port names."""
|
|
50
|
+
return [p.name for p in self.component.ports]
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def width(self) -> float:
|
|
54
|
+
"""Get width (x-extent) of geometry in um."""
|
|
55
|
+
xmin, _, xmax, _ = self.bounds
|
|
56
|
+
return xmax - xmin
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def height(self) -> float:
|
|
60
|
+
"""Get height (y-extent) of geometry in um."""
|
|
61
|
+
_, ymin, _, ymax = self.bounds
|
|
62
|
+
return ymax - ymin
|
|
63
|
+
|
|
64
|
+
def get_port(self, name: str) -> Any:
|
|
65
|
+
"""Get a port by name.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
name: Port name to find
|
|
69
|
+
|
|
70
|
+
Returns:
|
|
71
|
+
Port object if found, None otherwise
|
|
72
|
+
"""
|
|
73
|
+
for port in self.component.ports:
|
|
74
|
+
if port.name == name:
|
|
75
|
+
return port
|
|
76
|
+
return None
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
"""Layer stack extraction and parsing for
|
|
1
|
+
"""Layer stack extraction and parsing for EM simulation.
|
|
2
|
+
|
|
3
|
+
This module provides stack extraction functionality that can be shared
|
|
4
|
+
between different solvers (Palace, FDTD, etc.).
|
|
2
5
|
|
|
3
6
|
Usage:
|
|
4
7
|
# From PDK module (preferred, no file needed)
|
|
5
|
-
from gsim.
|
|
8
|
+
from gsim.common.stack import get_stack
|
|
6
9
|
stack = get_stack(pdk=ihp)
|
|
7
10
|
|
|
8
11
|
# From YAML file (for custom/tweaked stacks)
|
|
@@ -19,21 +22,21 @@ from pathlib import Path
|
|
|
19
22
|
import gdsfactory as gf
|
|
20
23
|
import yaml
|
|
21
24
|
|
|
22
|
-
from gsim.
|
|
25
|
+
from gsim.common.stack.extractor import (
|
|
23
26
|
Layer,
|
|
24
27
|
LayerStack,
|
|
25
28
|
ValidationResult,
|
|
26
29
|
extract_from_pdk,
|
|
27
30
|
extract_layer_stack,
|
|
28
31
|
)
|
|
29
|
-
from gsim.
|
|
32
|
+
from gsim.common.stack.materials import (
|
|
30
33
|
MATERIALS_DB,
|
|
31
34
|
MaterialProperties,
|
|
32
35
|
get_material_properties,
|
|
33
36
|
material_is_conductor,
|
|
34
37
|
material_is_dielectric,
|
|
35
38
|
)
|
|
36
|
-
from gsim.
|
|
39
|
+
from gsim.common.stack.visualization import (
|
|
37
40
|
StackLayer,
|
|
38
41
|
parse_layer_stack,
|
|
39
42
|
plot_stack,
|