prefab 1.4.0__py3-none-any.whl → 1.4.1__py3-none-any.whl
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.
- prefab/__init__.py +1 -1
- prefab/models/__init__.py +57 -0
- prefab/{models.py → models/base.py} +3 -25
- prefab/models/evaluation.py +29 -0
- {prefab-1.4.0.dist-info → prefab-1.4.1.dist-info}/METADATA +1 -1
- {prefab-1.4.0.dist-info → prefab-1.4.1.dist-info}/RECORD +9 -7
- {prefab-1.4.0.dist-info → prefab-1.4.1.dist-info}/WHEEL +1 -1
- {prefab-1.4.0.dist-info → prefab-1.4.1.dist-info}/entry_points.txt +0 -0
- {prefab-1.4.0.dist-info → prefab-1.4.1.dist-info}/licenses/LICENSE +0 -0
prefab/__init__.py
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Fabrication process model definitions and configurations.
|
|
3
|
+
|
|
4
|
+
This module automatically discovers and loads all model definitions from
|
|
5
|
+
Python files in the models/ directory.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import importlib
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
from .base import Fab, Model
|
|
12
|
+
|
|
13
|
+
models = {}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _load_models_from_module(module):
|
|
17
|
+
"""
|
|
18
|
+
Load all Model instances from a module into the models dict.
|
|
19
|
+
|
|
20
|
+
If the module defines a __models__ dict, use that for registration.
|
|
21
|
+
Otherwise, auto-register all Model instances using their variable names.
|
|
22
|
+
|
|
23
|
+
Parameters
|
|
24
|
+
----------
|
|
25
|
+
module : module
|
|
26
|
+
Python module containing Model instances to register.
|
|
27
|
+
"""
|
|
28
|
+
if hasattr(module, "__models__"):
|
|
29
|
+
models_dict = getattr(module, "__models__")
|
|
30
|
+
for name, obj in models_dict.items():
|
|
31
|
+
if isinstance(obj, Model):
|
|
32
|
+
models[name] = obj
|
|
33
|
+
else:
|
|
34
|
+
for name, obj in vars(module).items():
|
|
35
|
+
if isinstance(obj, Model):
|
|
36
|
+
models[name] = obj
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
models_dir = Path(__file__).parent
|
|
40
|
+
|
|
41
|
+
for model_file in models_dir.glob("*.py"):
|
|
42
|
+
if model_file.stem in ("__init__", "base"):
|
|
43
|
+
continue
|
|
44
|
+
|
|
45
|
+
module_name = f".{model_file.stem}"
|
|
46
|
+
try:
|
|
47
|
+
module = importlib.import_module(module_name, package=__package__)
|
|
48
|
+
_load_models_from_module(module)
|
|
49
|
+
except Exception:
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
__all__ = [
|
|
54
|
+
"Fab",
|
|
55
|
+
"Model",
|
|
56
|
+
"models",
|
|
57
|
+
]
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
Base model definitions for fabrication processes.
|
|
3
3
|
|
|
4
|
-
This module defines the data structures for representing nanofabrication
|
|
5
|
-
and their associated
|
|
6
|
-
fabrication specifications (foundry, process) and versioned model configurations
|
|
7
|
-
(dataset, version, release dates). Pre-configured model instances are provided
|
|
8
|
-
for common fabrication processes.
|
|
4
|
+
This module defines the core data structures for representing nanofabrication
|
|
5
|
+
processes and their associated models.
|
|
9
6
|
"""
|
|
10
7
|
|
|
11
8
|
import json
|
|
@@ -64,22 +61,3 @@ class Model(BaseModel):
|
|
|
64
61
|
|
|
65
62
|
def to_json(self):
|
|
66
63
|
return json.dumps(self.model_dump(), default=str)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Generic = Fab(
|
|
70
|
-
foundry="Generic",
|
|
71
|
-
process="SOI",
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
Generic_SOI_ANF1_d0 = Model(
|
|
75
|
-
fab=Generic,
|
|
76
|
-
version="ANF1",
|
|
77
|
-
version_date=date(2025, 11, 7),
|
|
78
|
-
dataset="d0",
|
|
79
|
-
dataset_date=date(2025, 11, 7),
|
|
80
|
-
tag="",
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
models = dict(
|
|
84
|
-
Generic_SOI=Generic_SOI_ANF1_d0,
|
|
85
|
-
)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Base evaluation models.
|
|
3
|
+
|
|
4
|
+
Pre-configured model instances for common fabrication processes.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from datetime import date
|
|
8
|
+
|
|
9
|
+
from .base import Fab, Model
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Generic = Fab(
|
|
13
|
+
foundry="Generic",
|
|
14
|
+
process="SOI",
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
Generic_SOI_ANF1_d0 = Model(
|
|
18
|
+
fab=Generic,
|
|
19
|
+
version="ANF1",
|
|
20
|
+
version_date=date(2025, 11, 7),
|
|
21
|
+
dataset="d0",
|
|
22
|
+
dataset_date=date(2025, 11, 7),
|
|
23
|
+
tag="",
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
# Export models with user-facing names
|
|
27
|
+
__models__ = {
|
|
28
|
+
"Generic_SOI": Generic_SOI_ANF1_d0,
|
|
29
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: prefab
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Summary: Artificial nanofabrication of integrated photonic circuits using deep learning
|
|
5
5
|
Project-URL: Homepage, https://prefabphotonics.com
|
|
6
6
|
Project-URL: Repository, https://github.com/PreFab-Photonics/PreFab
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
prefab/__init__.py,sha256=
|
|
1
|
+
prefab/__init__.py,sha256=f9FN73XE4ufrKEDyy5rGQW2sWWH-8Y4C_7FYwO946Rs,425
|
|
2
2
|
prefab/__main__.py,sha256=M5ulRfgSMdPjeHPoMGQ3P86zFMJDII5I18NGrpFUcsM,3458
|
|
3
3
|
prefab/compare.py,sha256=aX7nr9tznSebYeeztvqIPz57npnJ4-iUeKEedrZdksE,3676
|
|
4
4
|
prefab/device.py,sha256=1O6vTOq4wQRGVYvFWLH0uj1XhhYCfnDnIapDEYnBKHw,47996
|
|
5
5
|
prefab/geometry.py,sha256=-nTaGjdw3KN1SVoyvqdcrE2GJP7OqPF6ivUhrO78rUk,11244
|
|
6
|
-
prefab/models.py,sha256=YORoAPYC0r60yDShmrZdWOEh9jEBcBMizx4aj8ik27U,2047
|
|
7
6
|
prefab/predict.py,sha256=066X_SnSIHPqaPMbk0Yn_yX_KBfUc9yxrsmP_k56FU0,19015
|
|
8
7
|
prefab/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
8
|
prefab/read.py,sha256=5BmvFemobA72urxs4j2VZRVvanZZGu1mDB1Uh-epyvI,8635
|
|
10
9
|
prefab/shapes.py,sha256=mRGwsPS-A9XsW3jgvUuMCEeNv9BLXsEnJkytlIHUAKE,28802
|
|
11
|
-
prefab
|
|
12
|
-
prefab
|
|
13
|
-
prefab
|
|
14
|
-
prefab-1.4.
|
|
15
|
-
prefab-1.4.
|
|
10
|
+
prefab/models/__init__.py,sha256=rRrjcOcHPcob98Coksc0tbvYcXbm6SoLEb-Md233Jvo,1391
|
|
11
|
+
prefab/models/base.py,sha256=t4VNMsOztPedj3kN5fZ1-4tk0SRHWrMuqnIVHztsCs4,1514
|
|
12
|
+
prefab/models/evaluation.py,sha256=2_Klui6tY8xPvOSVD8VpZCVAnT1RX15FONqWG-_x-J8,484
|
|
13
|
+
prefab-1.4.1.dist-info/METADATA,sha256=miTQTlHxSgZn57wzltpGpAZ4PgUBW-hVSWmxmSDGqCA,33880
|
|
14
|
+
prefab-1.4.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
15
|
+
prefab-1.4.1.dist-info/entry_points.txt,sha256=h1_A9O9F3NAIoKXD1RPb3Eo-WCSiHhMB_AnagBi6XTQ,48
|
|
16
|
+
prefab-1.4.1.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
|
|
17
|
+
prefab-1.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|