prefab 1.4.1__py3-none-any.whl → 1.4.2__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/predict.py +7 -2
- {prefab-1.4.1.dist-info → prefab-1.4.2.dist-info}/METADATA +1 -1
- {prefab-1.4.1.dist-info → prefab-1.4.2.dist-info}/RECORD +7 -7
- {prefab-1.4.1.dist-info → prefab-1.4.2.dist-info}/WHEEL +0 -0
- {prefab-1.4.1.dist-info → prefab-1.4.2.dist-info}/entry_points.txt +0 -0
- {prefab-1.4.1.dist-info → prefab-1.4.2.dist-info}/licenses/LICENSE +0 -0
prefab/__init__.py
CHANGED
prefab/predict.py
CHANGED
|
@@ -517,6 +517,12 @@ def _decode_array(encoded_png: str) -> npt.NDArray[Any]:
|
|
|
517
517
|
|
|
518
518
|
def _prepare_headers() -> dict[str, str]:
|
|
519
519
|
"""Prepare HTTP headers for a server request."""
|
|
520
|
+
# Check for API key first (for headless/server environments)
|
|
521
|
+
api_key = os.environ.get("PREFAB_API_KEY")
|
|
522
|
+
if api_key:
|
|
523
|
+
return {"X-API-Key": api_key}
|
|
524
|
+
|
|
525
|
+
# Fall back to token file (browser OAuth flow)
|
|
520
526
|
token_file_path = os.path.expanduser("~/.prefab.toml")
|
|
521
527
|
try:
|
|
522
528
|
with open(token_file_path) as file:
|
|
@@ -532,7 +538,6 @@ def _prepare_headers() -> dict[str, str]:
|
|
|
532
538
|
except FileNotFoundError:
|
|
533
539
|
raise FileNotFoundError(
|
|
534
540
|
"Could not validate user.\n"
|
|
535
|
-
+ "
|
|
536
|
-
+ "Signup/login and generate a new token.\n"
|
|
541
|
+
+ "Set PREFAB_API_KEY environment variable, or run 'prefab setup'.\n"
|
|
537
542
|
+ "See https://docs.prefabphotonics.com/."
|
|
538
543
|
) from None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: prefab
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.2
|
|
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,17 +1,17 @@
|
|
|
1
|
-
prefab/__init__.py,sha256=
|
|
1
|
+
prefab/__init__.py,sha256=XffqgQ1AexVSwGAgt7Wbfo-4raEefrzmXwE2EEG3WUI,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/predict.py,sha256=
|
|
6
|
+
prefab/predict.py,sha256=LSOf-lo7l8JRzRSXTDWosGfr2baE-D5zZjinkObeJV4,19182
|
|
7
7
|
prefab/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
prefab/read.py,sha256=5BmvFemobA72urxs4j2VZRVvanZZGu1mDB1Uh-epyvI,8635
|
|
9
9
|
prefab/shapes.py,sha256=mRGwsPS-A9XsW3jgvUuMCEeNv9BLXsEnJkytlIHUAKE,28802
|
|
10
10
|
prefab/models/__init__.py,sha256=rRrjcOcHPcob98Coksc0tbvYcXbm6SoLEb-Md233Jvo,1391
|
|
11
11
|
prefab/models/base.py,sha256=t4VNMsOztPedj3kN5fZ1-4tk0SRHWrMuqnIVHztsCs4,1514
|
|
12
12
|
prefab/models/evaluation.py,sha256=2_Klui6tY8xPvOSVD8VpZCVAnT1RX15FONqWG-_x-J8,484
|
|
13
|
-
prefab-1.4.
|
|
14
|
-
prefab-1.4.
|
|
15
|
-
prefab-1.4.
|
|
16
|
-
prefab-1.4.
|
|
17
|
-
prefab-1.4.
|
|
13
|
+
prefab-1.4.2.dist-info/METADATA,sha256=JFb3uFdmPuf8thzsPnOim8F47qqSjVajVG9plmBuonQ,33880
|
|
14
|
+
prefab-1.4.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
15
|
+
prefab-1.4.2.dist-info/entry_points.txt,sha256=h1_A9O9F3NAIoKXD1RPb3Eo-WCSiHhMB_AnagBi6XTQ,48
|
|
16
|
+
prefab-1.4.2.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
|
|
17
|
+
prefab-1.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|