prefab 1.1.2__tar.gz → 1.1.4__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.
Files changed (124) hide show
  1. {prefab-1.1.2 → prefab-1.1.4}/.github/workflows/docs-deploy.yml +5 -4
  2. {prefab-1.1.2 → prefab-1.1.4}/PKG-INFO +1 -1
  3. {prefab-1.1.2 → prefab-1.1.4/docs}/CHANGELOG.md +16 -36
  4. prefab-1.1.4/docs/assets/logo-white.png +0 -0
  5. prefab-1.1.4/docs/blog/.authors.yml +6 -0
  6. prefab-1.1.4/docs/blog/index.md +2 -0
  7. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0.md +273 -0
  8. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_11_1.png +0 -0
  9. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_11_2.png +0 -0
  10. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_13_2.png +0 -0
  11. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_13_3.png +0 -0
  12. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_13_4.png +0 -0
  13. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_3_1.png +0 -0
  14. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_3_2.png +0 -0
  15. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_3_3.png +0 -0
  16. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_7_2.png +0 -0
  17. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_7_3.png +0 -0
  18. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_7_4.png +0 -0
  19. prefab-1.1.4/docs/blog/posts/prefab-v1.1.0_files/prefab-v1.1.0_9_2.png +0 -0
  20. {prefab-1.1.2/docs/blog → prefab-1.1.4/docs/blog/posts}/python-for-photonics.md +8 -1
  21. prefab-1.1.2/docs/blog/PreFab-v1.1.0.ipynb → prefab-1.1.4/docs/blog/prefab-v1.1.0.ipynb +1 -1
  22. {prefab-1.1.2 → prefab-1.1.4}/docs/index.md +1 -1
  23. prefab-1.1.4/docs/overrides/main.html +19 -0
  24. prefab-1.1.4/docs/reference/predict.md +3 -0
  25. {prefab-1.1.2 → prefab-1.1.4}/mkdocs.yml +24 -14
  26. {prefab-1.1.2 → prefab-1.1.4}/prefab/__init__.py +3 -2
  27. {prefab-1.1.2 → prefab-1.1.4}/prefab/device.py +34 -166
  28. {prefab-1.1.2 → prefab-1.1.4}/prefab/models.py +1 -1
  29. prefab-1.1.4/prefab/predict.py +307 -0
  30. {prefab-1.1.2 → prefab-1.1.4}/pyproject.toml +1 -1
  31. {prefab-1.1.2 → prefab-1.1.4}/.gitattributes +0 -0
  32. {prefab-1.1.2 → prefab-1.1.4}/.github/workflows/python-publish.yml +0 -0
  33. {prefab-1.1.2 → prefab-1.1.4}/.gitignore +0 -0
  34. {prefab-1.1.2 → prefab-1.1.4}/LICENSE +0 -0
  35. {prefab-1.1.2 → prefab-1.1.4}/README.md +0 -0
  36. {prefab-1.1.2 → prefab-1.1.4}/docs/CNAME +0 -0
  37. {prefab-1.1.2 → prefab-1.1.4}/docs/assets/blog-cards/python-for-photonics.png +0 -0
  38. {prefab-1.1.2 → prefab-1.1.4}/docs/assets/favicon.ico +0 -0
  39. {prefab-1.1.2 → prefab-1.1.4}/docs/assets/logo.png +0 -0
  40. {prefab-1.1.2 → prefab-1.1.4}/docs/assets/prefab_logo_white.svg +0 -0
  41. {prefab-1.1.2 → prefab-1.1.4}/docs/assets/promo_c.png +0 -0
  42. {prefab-1.1.2 → prefab-1.1.4}/docs/assets/promo_p.png +0 -0
  43. {prefab-1.1.2 → prefab-1.1.4}/docs/examples/1_prediction.ipynb +0 -0
  44. {prefab-1.1.2 → prefab-1.1.4}/docs/examples/2_correction.ipynb +0 -0
  45. {prefab-1.1.2 → prefab-1.1.4}/docs/examples/3_sidewall_angle.ipynb +0 -0
  46. {prefab-1.1.2 → prefab-1.1.4}/docs/examples/4_SEM_generation.ipynb +0 -0
  47. {prefab-1.1.2 → prefab-1.1.4}/docs/models.md +0 -0
  48. {prefab-1.1.2 → prefab-1.1.4}/docs/reference/compare.md +0 -0
  49. {prefab-1.1.2 → prefab-1.1.4}/docs/reference/device.md +0 -0
  50. {prefab-1.1.2 → prefab-1.1.4}/docs/reference/geometry.md +0 -0
  51. {prefab-1.1.2 → prefab-1.1.4}/docs/reference/models.md +0 -0
  52. {prefab-1.1.2 → prefab-1.1.4}/docs/reference/read.md +0 -0
  53. {prefab-1.1.2 → prefab-1.1.4}/docs/reference/shapes.md +0 -0
  54. {prefab-1.1.2 → prefab-1.1.4}/prefab/__main__.py +0 -0
  55. {prefab-1.1.2 → prefab-1.1.4}/prefab/compare.py +0 -0
  56. {prefab-1.1.2 → prefab-1.1.4}/prefab/geometry.py +0 -0
  57. {prefab-1.1.2 → prefab-1.1.4}/prefab/read.py +0 -0
  58. {prefab-1.1.2 → prefab-1.1.4}/prefab/shapes.py +0 -0
  59. {prefab-1.1.2 → prefab-1.1.4}/site/404.html +0 -0
  60. {prefab-1.1.2 → prefab-1.1.4}/site/assets/_mkdocstrings.css +0 -0
  61. {prefab-1.1.2 → prefab-1.1.4}/site/assets/favicon.ico +0 -0
  62. {prefab-1.1.2 → prefab-1.1.4}/site/assets/images/favicon.png +0 -0
  63. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/bundle.a7c05c9e.min.js +0 -0
  64. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/bundle.a7c05c9e.min.js.map +0 -0
  65. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.ar.min.js +0 -0
  66. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.da.min.js +0 -0
  67. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.de.min.js +0 -0
  68. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.du.min.js +0 -0
  69. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.el.min.js +0 -0
  70. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.es.min.js +0 -0
  71. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.fi.min.js +0 -0
  72. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.fr.min.js +0 -0
  73. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.he.min.js +0 -0
  74. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.hi.min.js +0 -0
  75. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.hu.min.js +0 -0
  76. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.hy.min.js +0 -0
  77. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.it.min.js +0 -0
  78. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.ja.min.js +0 -0
  79. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.jp.min.js +0 -0
  80. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.kn.min.js +0 -0
  81. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.ko.min.js +0 -0
  82. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.multi.min.js +0 -0
  83. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.nl.min.js +0 -0
  84. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.no.min.js +0 -0
  85. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.pt.min.js +0 -0
  86. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.ro.min.js +0 -0
  87. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.ru.min.js +0 -0
  88. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.sa.min.js +0 -0
  89. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +0 -0
  90. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.sv.min.js +0 -0
  91. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.ta.min.js +0 -0
  92. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.te.min.js +0 -0
  93. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.th.min.js +0 -0
  94. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.tr.min.js +0 -0
  95. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.vi.min.js +0 -0
  96. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/min/lunr.zh.min.js +0 -0
  97. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/tinyseg.js +0 -0
  98. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/lunr/wordcut.js +0 -0
  99. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/workers/search.b8dbb3d2.min.js +0 -0
  100. {prefab-1.1.2 → prefab-1.1.4}/site/assets/javascripts/workers/search.b8dbb3d2.min.js.map +0 -0
  101. {prefab-1.1.2 → prefab-1.1.4}/site/assets/logo.png +0 -0
  102. {prefab-1.1.2 → prefab-1.1.4}/site/assets/logo_neue.svg +0 -0
  103. {prefab-1.1.2 → prefab-1.1.4}/site/assets/promo_c.png +0 -0
  104. {prefab-1.1.2 → prefab-1.1.4}/site/assets/promo_p.png +0 -0
  105. {prefab-1.1.2 → prefab-1.1.4}/site/assets/stylesheets/main.66ac8b77.min.css +0 -0
  106. {prefab-1.1.2 → prefab-1.1.4}/site/assets/stylesheets/main.66ac8b77.min.css.map +0 -0
  107. {prefab-1.1.2 → prefab-1.1.4}/site/assets/stylesheets/palette.06af60db.min.css +0 -0
  108. {prefab-1.1.2 → prefab-1.1.4}/site/assets/stylesheets/palette.06af60db.min.css.map +0 -0
  109. {prefab-1.1.2 → prefab-1.1.4}/site/css/ansi-colours.css +0 -0
  110. {prefab-1.1.2 → prefab-1.1.4}/site/css/jupyter-cells.css +0 -0
  111. {prefab-1.1.2 → prefab-1.1.4}/site/css/pandas-dataframe.css +0 -0
  112. {prefab-1.1.2 → prefab-1.1.4}/site/examples/1_prediction/index.html +0 -0
  113. {prefab-1.1.2 → prefab-1.1.4}/site/examples/2_correction/index.html +0 -0
  114. {prefab-1.1.2 → prefab-1.1.4}/site/index.html +0 -0
  115. {prefab-1.1.2 → prefab-1.1.4}/site/models/index.html +0 -0
  116. {prefab-1.1.2 → prefab-1.1.4}/site/objects.inv +0 -0
  117. {prefab-1.1.2 → prefab-1.1.4}/site/reference/compare/index.html +0 -0
  118. {prefab-1.1.2 → prefab-1.1.4}/site/reference/device/index.html +0 -0
  119. {prefab-1.1.2 → prefab-1.1.4}/site/reference/geometry/index.html +0 -0
  120. {prefab-1.1.2 → prefab-1.1.4}/site/reference/models/index.html +0 -0
  121. {prefab-1.1.2 → prefab-1.1.4}/site/reference/read/index.html +0 -0
  122. {prefab-1.1.2 → prefab-1.1.4}/site/search/search_index.json +0 -0
  123. {prefab-1.1.2 → prefab-1.1.4}/site/sitemap.xml +0 -0
  124. {prefab-1.1.2 → prefab-1.1.4}/site/sitemap.xml.gz +0 -0
@@ -18,17 +18,18 @@ jobs:
18
18
  - uses: actions/setup-python@v5
19
19
  with:
20
20
  python-version: 3.x
21
- - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
21
+ - id: get_cache_id
22
+ run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_OUTPUT
22
23
  - uses: actions/cache@v4
23
24
  with:
24
- key: mkdocs-material-${{ env.cache_id }}
25
+ key: mkdocs-material-${{ steps.get_cache_id.outputs.cache_id }}
25
26
  path: .cache
26
27
  restore-keys: |
27
28
  mkdocs-material-
28
29
  - run: pip install mkdocs
29
- - run: pip install mkdocs-material[imaging]
30
+ - run: pip install mkdocs-material
30
31
  - run: pip install mkdocstrings[python]
31
- - run: pip install mknotebooks
32
+ - run: pip install mkdocs-jupyter
32
33
  - name: Create CNAME file
33
34
  run: echo "docs.prefabphotonics.com" > docs/CNAME
34
35
  - run: mkdocs gh-deploy --force
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: prefab
3
- Version: 1.1.2
3
+ Version: 1.1.4
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,62 +1,48 @@
1
1
  # Changelog
2
2
 
3
- ## 1.1.2 - 2024-10-10
3
+ ## [1.1.4](https://github.com/PreFab-Photonics/PreFab/releases/tag/v1.1.4) - 2024-11-01
4
4
 
5
- ### Added
5
+ - Added custom vector-Jacobian product (VJP) for the `predict.predict_array_with_grad` function.
6
+ - Changed some of the docstrings in `prefab.predict` to be more consistent and clear.
6
7
 
7
- - User warning if `compare.intersection_over_union`, `compare.hamming_distance`, or `compare.dice_coefficient` are called with non-binarized devices.
8
- - Added `height` parameter to many shape constructors in `prefab.shapes` to give more flexibility.
8
+ ## [1.1.3](https://github.com/PreFab-Photonics/PreFab/releases/tag/v1.1.3) - 2024-10-26
9
+
10
+ - Moved prediction logic to `prefab.predict` module.
11
+ - First version of `predict.predict_array_with_grad`, which returns both the predicted array and its gradient. This is useful to fabrication-aware inverse design (FAID). More to come.
12
+ - Added `origin` parameter to GDS-related export methods.
13
+ - Small docstring fixes.
9
14
 
10
- ### Changed
15
+ ## [1.1.2](https://github.com/PreFab-Photonics/PreFab/releases/tag/v1.1.2) - 2024-10-10
11
16
 
17
+ - User warning if `compare.intersection_over_union`, `compare.hamming_distance`, or `compare.dice_coefficient` are called with non-binarized devices.
18
+ - Added `height` parameter to many shape constructors in `prefab.shapes` to give more flexibility.
12
19
  - Updates to the `README.md` to keep current.
13
20
  - `Device.is_binary` is now a property.
14
21
  - Moved `Device.enforce_feature_size` logic to `prefab.geometry` module.
15
-
16
- ### Fixed
17
-
18
22
  - Added required version of `gdstk` to `pyproject.toml`.
19
23
  - Removed leftover return statement in `geometry.rotate`.
20
24
 
21
- ## 1.1.1 - 2024-09-24
22
-
23
- ### Changed
25
+ ## [1.1.1](https://github.com/PreFab-Photonics/PreFab/releases/tag/v1.1.1) - 2024-09-24
24
26
 
25
- - Manually adding small random noise to the semulated images to better match the real data. This is ideally included in the model training, but for now this is a quick fix.
27
+ - Manually adding small random noise to the "SEMulated" images to better match the real data. This is ideally included in the model training, but for now this is a quick fix.
26
28
  - Added z-padding to the device array before exporting to STL with `Device.to_stl` to ensure that the exported device is closed.
27
-
28
- ### Fixed
29
-
30
29
  - Removed buffer from `Device.device_array` before exporting to with `Device.to_gdsfactory`.
31
-
32
- ### Added
33
-
34
30
  - The additions from `1.0.3` and `1.0.4` releases, which should be considered part of this release. Release planning a work in progress.
35
31
  - Import and export from/to Tidy3D simulations with `Device.to_tidy3d` and `read.from_tidy3d`.
36
32
  - Import and export from/to gdsfactory components with `Device.to_gdsfactory` and `read.from_gdsfactory`.
37
33
  - Convert 2D device structures into 3D arrays or STL files with `Device.to_3d` and `Device.to_stl`. This is useful for simulating processes with angled sidewalls.
38
34
  - Check and visualize the effect of enforcing a minimum feature size on the device geometry with `Device.check_feature_size` and `Device.enforce_feature_size`.
39
35
 
40
- ## 1.0.4 - 2024-09-19
41
-
42
- ### Added
36
+ ## [1.0.4](https://github.com/PreFab-Photonics/PreFab/releases/tag/v1.0.4) - 2024-09-19
43
37
 
44
38
  - Option to specify GPU or CPU in `predict`, `correct`, and `semulate` functions. GPU option has more overhead and will take longer for small devices, but will be faster for larger devices.
45
-
46
- ### Changed
47
-
48
39
  - Improve clarity of messaging for authentication errors.
49
40
 
50
- ## 1.0.3 - 2024-09-14
51
-
52
- ### Added
41
+ ## [1.0.3](https://github.com/PreFab-Photonics/PreFab/releases/tag/v1.0.3) - 2024-09-14
53
42
 
54
43
  - Added this `CHANGELOG.md` file.
55
44
  - Added `prefab.shapes` module to replace the now removed `devices` directory. This module contains helpful device constructors for testing PreFab models on.
56
45
  - Added `__version__` class attribute to `prefab` package.
57
-
58
- ### Changed
59
-
60
46
  - Added `ANT_NanoSOI_ANF1-d8` and `ANT_NanoSOI_ANF1-d10` models (see `prefab.models` and `docs/models.md`).
61
47
  - Updated notebook examples to use `prefab.shapes` module and newest models.
62
48
  - Updated dependencies in `pyproject.toml`.
@@ -64,13 +50,7 @@
64
50
  - Docstring improvements to `prefab.compare` module.
65
51
  - Ability to specify thickness to all four sides of buffer thickness in `prefab.device.BufferSpec`.
66
52
  - Changed some of the array resizing logic in `prefab.read` module to be more robust.
67
-
68
- ### Fixed
69
-
70
53
  - Minor fixes to `prefab.device` module.
71
54
  - Minor fixes to `prefab.geometry` module.
72
-
73
- ### Removed
74
-
75
55
  - Removed `devices` directory from the repository. Effectively replaced with `prefab.shapes` module.
76
56
  - Remove `requirements.txt` file as `pyproject.toml` contains all dependencies.
Binary file
@@ -0,0 +1,6 @@
1
+ authors:
2
+ dusan:
3
+ name: Dusan Gostimirovic
4
+ description: Founder
5
+ avatar: https://media.licdn.com/dms/image/v2/C4E03AQGWxb8cTGgvjg/profile-displayphoto-shrink_400_400/profile-displayphoto-shrink_400_400/0/1516680366321?e=1734566400&v=beta&t=h0PjBVxodvAKFt-MpKUNZOkXG6t-Tvn4HAdHwNoAWQY
6
+ url: https://www.linkedin.com/in/dusangostimirovic/
@@ -0,0 +1,2 @@
1
+ # Blog
2
+
@@ -0,0 +1,273 @@
1
+ ---
2
+ date: 2024-09-23
3
+ authors: [dusan]
4
+ ---
5
+
6
+ # PreFab v1.1.0
7
+
8
+ [PreFab v1.1.0](https://github.com/PreFab-Photonics/PreFab) is now available! Install it via [PyPI](https://pypi.org/project/prefab/) with the following command:
9
+
10
+ ```bash
11
+ pip install --upgrade prefab
12
+ ```
13
+
14
+ **PreFab is a Python library designed to predict and correct nanofabrication variations in integrated photonic devices using advanced computer vision models.** It helps enhance fabrication awareness and boosts efficiency in the design, fabrication, and testing of photonic circuits.
15
+
16
+ <!-- more -->
17
+
18
+ ## What's new with us
19
+
20
+ PreFab is a new startup originating from [McGill University](https://www.mcgill.ca/) in Montreal, Canada. As we continue to grow, we are eager to learn about your needs and how we can enhance our platform. Our team is small, so we appreciate your patience as we work on these improvements. Reach out to us at [hi@prefabphotonics.com](mailto:hi@prefabphotonics.com) to work together.
21
+
22
+ - **We have launched a new LinkedIn page** [here](https://www.linkedin.com/company/prefab-photonics/) where we will announce new features and updates. Follow us to stay informed.
23
+
24
+ - **We've updated our logo** to be less busy while retaining its original charm and essence. We hope you like the new design!
25
+
26
+ ![New PreFab Logo](https://github.com/PreFab-Photonics/PreFab/blob/main/docs/assets/logo.png?raw=true)
27
+
28
+ ## Features
29
+
30
+ This release brings a host of new features and enhancements to elevate your experience with PreFab. While our core functionality of predicting and correcting nanofabrication variations remains unchanged, we've added several valuable tools for working with nanostructure geometries.
31
+
32
+ ### Shapes
33
+
34
+ While `read.from_gds` is used to import your GDS cells, the new `shapes` module allows you to create basic nanostructure devices directly. This feature is not only beneficial for our internal testing but also provides a convenient way for you to test PreFab models on simple geometries. Below are some examples.
35
+
36
+ ```python
37
+ import prefab as pf
38
+
39
+ target = pf.shapes.target(width=500, arm_width=60)
40
+ target.plot()
41
+
42
+ grating = pf.shapes.grating(height=500, pitch=120, duty_cycle=0.5, num_gratings=10)
43
+ grating.plot()
44
+
45
+ radial_grating = pf.shapes.radial_grating(width=500, num_gratings=10)
46
+ radial_grating.plot()
47
+ ```
48
+
49
+ <Axes: xlabel='x (nm)', ylabel='y (nm)'>
50
+
51
+
52
+
53
+
54
+
55
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_3_1.png)
56
+
57
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_3_2.png)
58
+
59
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_3_3.png)
60
+
61
+ ### GPU acceleration
62
+
63
+ We've introduced GPU acceleration to the backend of PreFab by specifying `gpu=True` in `Device.predict` and `Device.correct`. This enhancement should speed up predictions for larger devices. As PreFab is a free service, CPU inference remains the default to keep the service readily available ("hot") for users. For now, the GPU will be in a "cold" state, requiring additional time to start up. Consequently, the first GPU prediction will be slower due to this overhead. We kindly ask that you use the GPU feature modestly (scouts' honor).
64
+
65
+ ```python
66
+ import time
67
+
68
+ import prefab as pf
69
+
70
+ grating = pf.shapes.grating(height=500, pitch=120, duty_cycle=0.5, num_gratings=200)
71
+
72
+ # Timing the CPU correction
73
+ start_time = time.time()
74
+ grating_c_cpu = grating.correct(model=pf.models["ANT_NanoSOI_ANF1_d10"], gpu=False)
75
+ cpu_duration = time.time() - start_time
76
+ print(f"CPU correction time: {cpu_duration:.2f} seconds")
77
+
78
+ # Timing the first GPU correction (cold start)
79
+ start_time = time.time()
80
+ grating_c_gpu = grating.correct(model=pf.models["ANT_NanoSOI_ANF1_d10"], gpu=True)
81
+ gpu_duration = time.time() - start_time
82
+ print(f"Cold GPU correction time: {gpu_duration:.2f} seconds")
83
+
84
+ # Timing the second GPU correction (hot start)
85
+ start_time = time.time()
86
+ grating_c_gpu2 = grating.correct(model=pf.models["ANT_NanoSOI_ANF1_d10"], gpu=True)
87
+ gpu_duration2 = time.time() - start_time
88
+ print(f"Hot GPU correction time: {gpu_duration2:.2f} seconds")
89
+ ```
90
+
91
+ Correction: 100%|██████████████████████████████| 100/100 [00:17<00:00, 5.75%/s]
92
+
93
+
94
+ CPU correction time: 17.68 seconds
95
+
96
+
97
+ Correction: 100%|██████████████████████████████| 100/100 [00:08<00:00, 12.39%/s]
98
+
99
+
100
+ Cold GPU correction time: 27.42 seconds
101
+
102
+
103
+ Correction: 100%|██████████████████████████████| 100/100 [00:02<00:00, 44.18%/s]
104
+
105
+ Hot GPU correction time: 2.47 seconds
106
+
107
+
108
+
109
+
110
+ ### Minimum feature size
111
+
112
+ We've added tools to check and enforce minimum feature sizes of devices you are working with. The `Device.check_feature_size` and `Device.enforce_feature_size` methods help ensure your designs meet sizing requirements. While these tools are not full design rule checking (DRC) solutions, we believe they can be useful early in the design process.
113
+
114
+ ```python
115
+ import prefab as pf
116
+
117
+ star = pf.shapes.star(width=500, num_points=4)
118
+ star.plot()
119
+
120
+ star.check_feature_size(min_feature_size=30, strel="disk")
121
+ star_e = star.enforce_feature_size(min_feature_size=30, strel="disk")
122
+ star_e.plot()
123
+ ```
124
+
125
+ Feature size check with minimum size 30 using 'disk' structuring element resulted in a Hamming distance of: 702
126
+
127
+
128
+
129
+
130
+
131
+ <Axes: xlabel='x (nm)', ylabel='y (nm)'>
132
+
133
+
134
+
135
+
136
+
137
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_7_2.png)
138
+
139
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_7_3.png)
140
+
141
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_7_4.png)
142
+
143
+ ### 3D structures
144
+
145
+ We have introduced the `Device.to_3d` and `Device.to_stl` methods to convert your 2D device structures into 3D arrays or STL files. These features are particularly useful for simulating processes with angled sidewalls. For more details on working with angled sidewalls, refer to this [notebook](../../examples/3_sidewall_angle.ipynb).
146
+
147
+ The `Device.plot` method displays the upper and lower edges of the sidewall-angled device structure. These two new methods use the edges as boundaries for the 3D extrusion.
148
+
149
+ ```python
150
+ import prefab as pf
151
+
152
+ target = pf.shapes.target(width=1000, arm_width=200)
153
+ target_p = target.predict(model=pf.models["ANT_SiN_ANF1_d1"], binarize=True)
154
+ target_p.plot()
155
+
156
+ target_p_3d = target_p.to_3d(thickness_nm=400) # visualizer to come soon
157
+ target_p.to_stl(thickness_nm=400) # this will create a 3D STL file you can inspect
158
+ ```
159
+
160
+ Prediction: 100%|██████████████████████████████| 100/100 [00:04<00:00, 22.84%/s]
161
+
162
+
163
+ Saved Device to 'prefab_device.stl'
164
+
165
+
166
+
167
+
168
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_9_2.png)
169
+
170
+ ### 3rd-party libraries
171
+
172
+ PreFab should seamlessly fit into your existing design flow. As such, we're adding tools to read and write from/to common libraries such as [Tidy3D](https://www.flexcompute.com/tidy3d/) and [gdsfactory](https://gdsfactory.github.io/gdsfactory/).
173
+
174
+ This first example shows how to read a gdsfactory component, correct it using PreFab, and then convert it back to a gdsfactory component.
175
+
176
+ ```python
177
+ import gdsfactory as gf
178
+ import prefab as pf
179
+
180
+ component = gf.components.triangle(x=1, xtop=0, y=2, ybot=0, layer="WG")
181
+ component.plot()
182
+ device = pf.read.from_gdsfactory(component)
183
+
184
+ device_c = device.correct(model=pf.models["ANT_NanoSOI_ANF1_d10"], binarize=True)
185
+ component_c = device_c.to_gdsfactory()
186
+ component_c.plot()
187
+ ```
188
+
189
+ Correction: 100%|██████████████████████████████| 100/100 [00:02<00:00, 46.44%/s]
190
+
191
+
192
+
193
+
194
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_11_1.png)
195
+
196
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_11_2.png)
197
+
198
+ This second example shows how to read a Tidy3D simulation, correct the structure using PreFab, and then send it back to a Tidy3D simulation.
199
+
200
+ ```python
201
+ import prefab as pf
202
+ import tidy3d as td
203
+
204
+ freq0 = td.C_0 / 0.75
205
+ arm1 = td.Structure(
206
+ geometry=td.Box(center=(0, 0, 0), size=(0.1, 0.75, 0.22)),
207
+ medium=td.Medium(permittivity=2.0),
208
+ )
209
+ arm2 = td.Structure(
210
+ geometry=td.Box(center=(0, 0, 0), size=(0.75, 0.1, 0.22)),
211
+ medium=td.Medium(permittivity=2.0),
212
+ )
213
+ source = td.PointDipole(
214
+ center=(-0.75, 0, 0),
215
+ source_time=td.GaussianPulse(freq0=freq0, fwidth=freq0 / 10.0),
216
+ polarization="Ey",
217
+ )
218
+ monitor = td.FieldMonitor(
219
+ size=(td.inf, td.inf, 0),
220
+ freqs=[freq0],
221
+ name="fields",
222
+ colocate=True,
223
+ )
224
+ sim = td.Simulation(
225
+ size=(2, 2, 3),
226
+ grid_spec=td.GridSpec.auto(min_steps_per_wvl=100),
227
+ structures=[arm1, arm2],
228
+ sources=[source],
229
+ monitors=[monitor],
230
+ run_time=120 / freq0,
231
+ )
232
+
233
+ sim.plot_eps(z=0)
234
+
235
+ device = pf.read.from_tidy3d(tidy3d_sim=sim, eps_threshold=1.5, z=0)
236
+ device.plot()
237
+
238
+ device_p = device.predict(model=pf.models["ANT_NanoSOI_ANF1_d10"], binarize=True)
239
+ structure_p = device_p.to_tidy3d(eps0=2.0, thickness=1.5)
240
+
241
+ sim_p = sim.updated_copy(structures=[structure_p])
242
+ sim_p.plot_eps(z=0)
243
+ ```
244
+
245
+ Prediction: 100%|██████████████████████████████| 100/100 [00:10<00:00, 9.26%/s]
246
+
247
+
248
+
249
+
250
+
251
+ <Axes: title={'center': 'cross section at z=0.00'}, xlabel='x', ylabel='y'>
252
+
253
+
254
+
255
+
256
+
257
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_13_2.png)
258
+
259
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_13_3.png)
260
+
261
+ ![png](prefab-v1.1.0_files/prefab-v1.1.0_13_4.png)
262
+
263
+ ## What's next
264
+
265
+ We're excited about the future of PreFab and how we can help you gain more control over your nanofabrication process. Here are our key focus areas for the upcoming months:
266
+
267
+ - **Performance Enhancements**: We are implementing several improvements to accelerate predictions, particularly for larger devices.
268
+ - **Expanding Model Library**: We are adding more models to our platform. If you have a specific nanofabrication process in mind, please reach out to us!
269
+ - **Innovative Usage Methods**: We have exciting ideas to make PreFab even more powerful, particularly within the design optimization process. Look out for more updates on this front.
270
+ - **Code Quality**: We are working on improving the code quality of PreFab to make it more robust and easier to maintain. This will lay the foundation for future development and collaboration.
271
+ - **Community Engagement**: We value your input and are eager to hear your ideas and suggestions. Please reach out to us at [support@prefabphotonics.com](mailto:hi@prefabphotonics.com) with your feedback.
272
+
273
+ Thank you for your support, and happy designing!
@@ -1,9 +1,16 @@
1
+ ---
2
+ date: 2024-10-10
3
+ authors: [dusan]
4
+ ---
5
+
1
6
  # Python for Photonics Development
2
7
 
3
8
  [Python](https://www.python.org/) has become an indispensable tool in many technical fields, including ours. It gives researchers and engineers a versatile platform for simulating, modeling, and analyzing photonic systems, effectively streamlining the **entire development workflow.** With its extensive ecosystem of libraries and tools, Python enables efficient and innovative solutions in photonics that we think are worth exploring.
4
9
 
5
10
  In this guide, we'll walk you through setting up your Python development environment, introduce essential libraries, explore cloud and remote tools to leverage computational resources, share valuable settings for an enhanced coding experience, and provide additional tips to elevate your photonics projects using Python.
6
11
 
12
+ <!-- more -->
13
+
7
14
  !!! note "Note"
8
15
 
9
16
  PreFab is developed using Python, and we leverage many Python packages to enhance our development process. This guide is a compilation of resources and insights that have been beneficial in *our* work. While it's not exhaustive, we hope it proves useful to you in your photonics development endeavors.
@@ -323,4 +330,4 @@ To further advance your photonics development journey with Python:
323
330
 
324
331
  3. **Develop Your Own Tools!**: We can't wait to see what you build.
325
332
 
326
- And of course, you can run our [notebook examples](../examples/1_prediction.ipynb) on using virtual nanofabrication models to add fabrication-awareness to your photonics simulations and designs.
333
+ And of course, you can run our [notebook examples](../../examples/1_prediction.ipynb) on using virtual nanofabrication models to add fabrication-awareness to your photonics simulations and designs.
@@ -22,7 +22,7 @@
22
22
  "\n",
23
23
  "- **We've updated our logo** to be less busy while retaining its original charm and essence. We hope you like the new design!\n",
24
24
  "\n",
25
- "![New PreFab Logo](../assets/logo.png)\n"
25
+ "![New PreFab Logo](https://github.com/PreFab-Photonics/PreFab/blob/main/docs/assets/logo.png?raw=true)\n"
26
26
  ]
27
27
  },
28
28
  {
@@ -49,7 +49,7 @@ See the following guides to get started with making your first predictions and c
49
49
  1. [Making a prediction](examples/1_prediction.ipynb)
50
50
  2. [Making a correction](examples/2_correction.ipynb)
51
51
 
52
- If you are new to Python, we recommend starting with the [Python for Photonics](blog/python-for-photonics.md) blog post.
52
+ If you are new to Python, we recommend starting with the [Python for Photonics](blog/posts/python-for-photonics.md) blog post.
53
53
 
54
54
  !!! tip "Performance and usage"
55
55
 
@@ -0,0 +1,19 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block announce %}
4
+ <span style="color: #b0b0b0;">For updates follow</span> <strong>PreFab Photonics</strong> <span
5
+ style="color: #b0b0b0;">on</span> <a rel="me"
6
+ href="https://www.linkedin.com/company/102847109/"><strong>LinkedIn</strong>
7
+ </a>
8
+ {% endblock %}
9
+
10
+ {% block content %}
11
+ {% if page.nb_url %}
12
+ <a href="{{ page.nb_url }}" title="Download Notebook" class="md-content__button md-icon"
13
+ style="display: inline; color: #b0b0b0;">
14
+ {% include ".icons/material/download.svg" %}
15
+ </a>
16
+ {% endif %}
17
+
18
+ {{ super() }}
19
+ {% endblock content %}
@@ -0,0 +1,3 @@
1
+ # Predict
2
+
3
+ ::: prefab.predict
@@ -1,44 +1,50 @@
1
- site_name: "Docs"
1
+ site_name: "PreFab Docs"
2
2
 
3
3
  site_url: https://docs.prefabphotonics.com/
4
4
  repo_url: https://github.com/PreFab-Photonics/PreFab
5
5
  repo_name: PreFab-Photonics/PreFab
6
6
 
7
7
  nav:
8
- - Getting started: index.md
9
- - Model library: models.md
8
+ - Home:
9
+ - Getting started: index.md
10
+ - Model library: models.md
11
+ - Changelog: CHANGELOG.md
10
12
  - Examples:
11
13
  - Making a prediction: examples/1_prediction.ipynb
12
14
  - Making a correction: examples/2_correction.ipynb
13
15
  - Working with sidewall angles: examples/3_sidewall_angle.ipynb
14
16
  - SEM generation: examples/4_SEM_generation.ipynb
15
17
  - Blog:
16
- - Python for Photonics: blog/python-for-photonics.md
17
- - PreFab v1.1.0: blog/PreFab-v1.1.0.ipynb
18
+ - blog/index.md
18
19
  - Reference:
19
- - Compare: reference/compare.md
20
- - Device: reference/device.md
21
- - Geometry: reference/geometry.md
22
- - Models: reference/models.md
23
- - Read: reference/read.md
24
- - Shapes: reference/shapes.md
20
+ - Compare: reference/compare.md
21
+ - Device: reference/device.md
22
+ - Geometry: reference/geometry.md
23
+ - Models: reference/models.md
24
+ - Predict: reference/predict.md
25
+ - Read: reference/read.md
26
+ - Shapes: reference/shapes.md
25
27
 
26
28
  theme:
27
29
  name: "material"
30
+ custom_dir: docs/overrides
28
31
  palette:
29
32
  scheme: slate
30
33
  primary: black
31
- accent: green
34
+ accent: yellow
32
35
  font:
33
36
  text: Roboto
34
37
  code: Roboto Mono
35
38
  language: en
36
- logo: assets/prefab_logo_white.svg
39
+ logo: assets/logo-white.png
37
40
  favicon: assets/favicon.ico
38
41
  # icon:
39
42
  # repo: fontawesome/brands/github
40
43
  features:
44
+ - announce.dismiss
41
45
  - navigation.instant
46
+ - navigation.instant.progress
47
+ - navigation.tabs
42
48
  - navigation.sections
43
49
  - navigation.footer
44
50
  - content.code.copy
@@ -87,6 +93,8 @@ markdown_extensions:
87
93
 
88
94
  plugins:
89
95
  - search
96
+ - blog:
97
+ authors: true
90
98
  - mkdocstrings:
91
99
  handlers:
92
100
  python:
@@ -95,4 +103,6 @@ plugins:
95
103
  options:
96
104
  docstring_style: numpy
97
105
  show_docstring_examples: true
98
- - mknotebooks
106
+ - mkdocs-jupyter:
107
+ include_source: true
108
+ theme: dark
@@ -5,9 +5,9 @@ Usage:
5
5
  import prefab as pf
6
6
  """
7
7
 
8
- __version__ = "1.1.2"
8
+ __version__ = "1.1.4"
9
9
 
10
- from . import compare, geometry, read, shapes
10
+ from . import compare, geometry, predict, read, shapes
11
11
  from .device import BufferSpec, Device
12
12
  from .models import models
13
13
 
@@ -15,6 +15,7 @@ __all__ = [
15
15
  "Device",
16
16
  "BufferSpec",
17
17
  "geometry",
18
+ "predict",
18
19
  "read",
19
20
  "shapes",
20
21
  "compare",