prefab 1.1.5__py3-none-any.whl → 1.1.6__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/shapes.py CHANGED
@@ -1,21 +1,23 @@
1
1
  """Contains functions for creating various shapes as Device objects."""
2
2
 
3
+ from typing import Optional
4
+
3
5
  import numpy as np
4
6
  from skimage.draw import polygon
5
7
 
6
8
  from .device import Device
7
9
 
8
10
 
9
- def rectangle(width: int = 200, height: int = None, **kwargs) -> Device:
11
+ def rectangle(width: int = 200, height: Optional[int] = None, **kwargs) -> Device:
10
12
  """
11
13
  Create a Device object with a rectangular shape.
12
14
 
13
15
  Parameters
14
16
  ----------
15
- width : int, optional
17
+ width : int
16
18
  The width of the rectangle. Defaults to 200.
17
- height : int, optional
18
- The height of the rectangle. Defaults to the value of width.
19
+ height : Optional[int]
20
+ The height of the rectangle. Defaults to the value of width if None.
19
21
  **kwargs : dict
20
22
  Additional keyword arguments to be passed to the Device constructor.
21
23
 
@@ -26,24 +28,23 @@ def rectangle(width: int = 200, height: int = None, **kwargs) -> Device:
26
28
  """
27
29
  if height is None:
28
30
  height = width
29
- rectangle = np.zeros((height, width))
30
- rectangle[:, :] = 1
31
+ rectangle = np.ones((height, width))
31
32
  return Device(device_array=rectangle, **kwargs)
32
33
 
33
34
 
34
35
  def window(
35
- width: int = 200, height: int = None, border_width: int = 60, **kwargs
36
+ width: int = 200, height: Optional[int] = None, border_width: int = 60, **kwargs
36
37
  ) -> Device:
37
38
  """
38
- Create a Device object with a window shape (hollow square).
39
+ Create a Device object with a window shape (hollow rectangle).
39
40
 
40
41
  Parameters
41
42
  ----------
42
- width : int, optional
43
+ width : int
43
44
  The overall width of the window. Defaults to 200.
44
- height : int, optional
45
+ height : Optional[int]
45
46
  The overall height of the window. Defaults to the value of width.
46
- border_width : int, optional
47
+ border_width : int
47
48
  The width of the window border. Defaults to 60.
48
49
  **kwargs : dict
49
50
  Additional keyword arguments to be passed to the Device constructor.
@@ -64,18 +65,18 @@ def window(
64
65
 
65
66
 
66
67
  def cross(
67
- width: int = 200, height: int = None, arm_width: int = 60, **kwargs
68
+ width: int = 200, height: Optional[int] = None, arm_width: int = 60, **kwargs
68
69
  ) -> Device:
69
70
  """
70
71
  Create a Device object with a cross shape.
71
72
 
72
73
  Parameters
73
74
  ----------
74
- width : int, optional
75
+ width : int
75
76
  The overall width of the cross. Defaults to 200.
76
- height : int, optional
77
+ height : Optional[int]
77
78
  The overall height of the cross. Defaults to the value of width.
78
- arm_width : int, optional
79
+ arm_width : int
79
80
  The width of the cross arms. Defaults to 60.
80
81
  **kwargs : dict
81
82
  Additional keyword arguments to be passed to the Device constructor.
@@ -97,18 +98,18 @@ def cross(
97
98
 
98
99
 
99
100
  def target(
100
- width: int = 200, height: int = None, arm_width: int = 60, **kwargs
101
+ width: int = 200, height: Optional[int] = None, arm_width: int = 60, **kwargs
101
102
  ) -> Device:
102
103
  """
103
104
  Create a Device object with a target shape (cross with center removed).
104
105
 
105
106
  Parameters
106
107
  ----------
107
- width : int, optional
108
+ width : int
108
109
  The overall width of the target. Defaults to 200.
109
- height : int, optional
110
+ height : Optional[int]
110
111
  The overall height of the target. Defaults to the value of width.
111
- arm_width : int, optional
112
+ arm_width : int
112
113
  The width of the target arms. Defaults to 60.
113
114
  **kwargs : dict
114
115
  Additional keyword arguments to be passed to the Device constructor.
@@ -133,15 +134,15 @@ def target(
133
134
  return Device(device_array=target, **kwargs)
134
135
 
135
136
 
136
- def disk(width: int = 200, height: int = None, **kwargs) -> Device:
137
+ def disk(width: int = 200, height: Optional[int] = None, **kwargs) -> Device:
137
138
  """
138
139
  Create a Device object with an elliptical shape.
139
140
 
140
141
  Parameters
141
142
  ----------
142
- width : int, optional
143
+ width : int
143
144
  The width of the ellipse. Defaults to 200.
144
- height : int, optional
145
+ height : Optional[int]
145
146
  The height of the ellipse. Defaults to the value of width.
146
147
  **kwargs : dict
147
148
  Additional keyword arguments to be passed to the Device constructor.
@@ -163,18 +164,18 @@ def disk(width: int = 200, height: int = None, **kwargs) -> Device:
163
164
 
164
165
 
165
166
  def ring(
166
- width: int = 200, height: int = None, border_width: int = 60, **kwargs
167
+ width: int = 200, height: Optional[int] = None, border_width: int = 60, **kwargs
167
168
  ) -> Device:
168
169
  """
169
- Create a Device object with a ring shape.
170
+ Create a Device object with a ring shape (hollow ellipse).
170
171
 
171
172
  Parameters
172
173
  ----------
173
- width : int, optional
174
+ width : int
174
175
  The overall width of the ring. Defaults to 200.
175
- height : int, optional
176
+ height : Optional[int]
176
177
  The overall height of the ring. Defaults to the value of width.
177
- border_width : int, optional
178
+ border_width : int
178
179
  The width of the ring border. Defaults to 60.
179
180
  **kwargs : dict
180
181
  Additional keyword arguments to be passed to the Device constructor.
@@ -206,11 +207,11 @@ def disk_wavy(
206
207
 
207
208
  Parameters
208
209
  ----------
209
- width : int, optional
210
+ width : int
210
211
  The overall width and height of the wavy circle. Defaults to 200.
211
- wave_amplitude : float, optional
212
+ wave_amplitude : float
212
213
  The amplitude of the waves. Defaults to 10.
213
- wave_frequency : float, optional
214
+ wave_frequency : float
214
215
  The frequency of the waves. Defaults to 10.
215
216
  **kwargs : dict
216
217
  Additional keyword arguments to be passed to the Device constructor.
@@ -233,18 +234,18 @@ def disk_wavy(
233
234
 
234
235
 
235
236
  def pie(
236
- width: int = 200, height: int = None, arc_angle: float = 270, **kwargs
237
+ width: int = 200, height: Optional[int] = None, arc_angle: float = 270, **kwargs
237
238
  ) -> Device:
238
239
  """
239
240
  Create a Device object with a pie shape.
240
241
 
241
242
  Parameters
242
243
  ----------
243
- width : int, optional
244
+ width : int
244
245
  The width of the pie. Defaults to 200.
245
- height : int, optional
246
+ height : Optional[int]
246
247
  The height of the pie. Defaults to the value of width.
247
- arc_angle : float, optional
248
+ arc_angle : float
248
249
  The angle of the pie slice in degrees. Defaults to 270.
249
250
  **kwargs : dict
250
251
  Additional keyword arguments to be passed to the Device constructor.
@@ -279,13 +280,13 @@ def grating(
279
280
 
280
281
  Parameters
281
282
  ----------
282
- height : int, optional
283
+ height : int
283
284
  The height of the grating. Defaults to 200.
284
- pitch : int, optional
285
+ pitch : int
285
286
  The pitch (period) of the grating. Defaults to 120.
286
- duty_cycle : float, optional
287
+ duty_cycle : float
287
288
  The duty cycle of the grating. Defaults to 0.5.
288
- num_gratings : int, optional
289
+ num_gratings : int
289
290
  The number of grating periods. Defaults to 3.
290
291
  **kwargs : dict
291
292
  Additional keyword arguments to be passed to the Device constructor.
@@ -310,9 +311,9 @@ def star(width: int = 200, num_points: int = 5, **kwargs) -> Device:
310
311
 
311
312
  Parameters
312
313
  ----------
313
- width : int, optional
314
+ width : int
314
315
  The overall width and height of the star. Defaults to 200.
315
- num_points : int, optional
316
+ num_points : int
316
317
  The number of points on the star. Defaults to 5.
317
318
  **kwargs : dict
318
319
  Additional keyword arguments to be passed to the Device constructor.
@@ -350,9 +351,9 @@ def poly(width: int = 200, num_points: int = 5, **kwargs) -> Device:
350
351
 
351
352
  Parameters
352
353
  ----------
353
- width : int, optional
354
+ width : int
354
355
  The overall width and height of the polygon. Defaults to 200.
355
- num_points : int, optional
356
+ num_points : int
356
357
  The number of sides of the polygon. Defaults to 5.
357
358
  **kwargs : dict
358
359
  Additional keyword arguments to be passed to the Device constructor.
@@ -382,11 +383,11 @@ def radial_grating(
382
383
 
383
384
  Parameters
384
385
  ----------
385
- width : int, optional
386
+ width : int
386
387
  The overall width and height of the radial grating. Defaults to 200.
387
- grating_skew : int, optional
388
+ grating_skew : int
388
389
  The skew angle of the grating arms. Defaults to 0.
389
- num_gratings : int, optional
390
+ num_gratings : int
390
391
  The number of grating arms. Defaults to 6.
391
392
  **kwargs : dict
392
393
  Additional keyword arguments to be passed to the Device constructor.
@@ -429,13 +430,13 @@ def offset_grating(
429
430
 
430
431
  Parameters
431
432
  ----------
432
- height : int, optional
433
+ height : int
433
434
  The height of the grating. Defaults to 200.
434
- pitch : int, optional
435
+ pitch : int
435
436
  The pitch (period) of the grating. Defaults to 120.
436
- duty_cycle : float, optional
437
+ duty_cycle : float
437
438
  The duty cycle of the grating. Defaults to 0.5.
438
- num_gratings : int, optional
439
+ num_gratings : int
439
440
  The number of grating periods. Defaults to 3.
440
441
  **kwargs : dict
441
442
  Additional keyword arguments to be passed to the Device constructor.
@@ -458,9 +459,9 @@ def offset_grating(
458
459
  return Device(device_array=grating, **kwargs)
459
460
 
460
461
 
461
- def L_grating(
462
+ def l_grating(
462
463
  width: int = 200,
463
- height: int = None,
464
+ height: Optional[int] = None,
464
465
  pitch: int = 100,
465
466
  duty_cycle: float = 0.5,
466
467
  **kwargs,
@@ -470,13 +471,13 @@ def L_grating(
470
471
 
471
472
  Parameters
472
473
  ----------
473
- width : int, optional
474
+ width : int
474
475
  The width of the L-grating. Defaults to 200.
475
- height : int, optional
476
+ height : Optional[int]
476
477
  The height of the L-grating. Defaults to the value of width.
477
- pitch : int, optional
478
+ pitch : int
478
479
  The pitch (period) of the L-shapes. Defaults to 100.
479
- duty_cycle : float, optional
480
+ duty_cycle : float
480
481
  The duty cycle of the L-shapes. Defaults to 0.5.
481
482
  **kwargs : dict
482
483
  Additional keyword arguments to be passed to the Device constructor.
@@ -506,13 +507,13 @@ def disks(
506
507
 
507
508
  Parameters
508
509
  ----------
509
- rows : int, optional
510
+ rows : int
510
511
  The number of rows in the grid. Defaults to 5.
511
- cols : int, optional
512
+ cols : int
512
513
  The number of columns in the grid. Defaults to 5.
513
- disk_radius : int, optional
514
+ disk_radius : int
514
515
  The radius of each disk. Defaults to 30.
515
- spacing : int, optional
516
+ spacing : int
516
517
  The spacing between disk centers. Defaults to 60.
517
518
  **kwargs : dict
518
519
  Additional keyword arguments to be passed to the Device constructor.
@@ -546,13 +547,13 @@ def disks_offset(
546
547
 
547
548
  Parameters
548
549
  ----------
549
- rows : int, optional
550
+ rows : int
550
551
  The number of rows in the grid. Defaults to 5.
551
- cols : int, optional
552
+ cols : int
552
553
  The number of columns in the grid. Defaults to 5.
553
- disk_radius : int, optional
554
+ disk_radius : int
554
555
  The radius of each disk. Defaults to 30.
555
- spacing : int, optional
556
+ spacing : int
556
557
  The spacing between disk centers. Defaults to 30.
557
558
  **kwargs : dict
558
559
  Additional keyword arguments to be passed to the Device constructor.
@@ -597,15 +598,15 @@ def disks_varying(
597
598
 
598
599
  Parameters
599
600
  ----------
600
- rows : int, optional
601
+ rows : int
601
602
  The number of rows in the grid. Defaults to 5.
602
- cols : int, optional
603
+ cols : int
603
604
  The number of columns in the grid. Defaults to 5.
604
- min_disk_radius : int, optional
605
+ min_disk_radius : int
605
606
  The minimum radius of the disks. Defaults to 10.
606
- max_disk_radius : int, optional
607
+ max_disk_radius : int
607
608
  The maximum radius of the disks. Defaults to 30.
608
- spacing : int, optional
609
+ spacing : int
609
610
  The spacing between disk centers. Defaults to 30.
610
611
  **kwargs : dict
611
612
  Additional keyword arguments to be passed to the Device constructor.
@@ -643,13 +644,13 @@ def holes(
643
644
 
644
645
  Parameters
645
646
  ----------
646
- rows : int, optional
647
+ rows : int
647
648
  The number of rows in the grid. Defaults to 5.
648
- cols : int, optional
649
+ cols : int
649
650
  The number of columns in the grid. Defaults to 5.
650
- hole_radius : int, optional
651
+ hole_radius : int
651
652
  The radius of each hole. Defaults to 30.
652
- spacing : int, optional
653
+ spacing : int
653
654
  The spacing between hole centers. Defaults to 30.
654
655
  **kwargs : dict
655
656
  Additional keyword arguments to be passed to the Device constructor.
@@ -683,13 +684,13 @@ def holes_offset(
683
684
 
684
685
  Parameters
685
686
  ----------
686
- rows : int, optional
687
+ rows : int
687
688
  The number of rows in the grid. Defaults to 5.
688
- cols : int, optional
689
+ cols : int
689
690
  The number of columns in the grid. Defaults to 5.
690
- hole_radius : int, optional
691
+ hole_radius : int
691
692
  The radius of each hole. Defaults to 30.
692
- spacing : int, optional
693
+ spacing : int
693
694
  The spacing between hole centers. Defaults to 30.
694
695
  **kwargs : dict
695
696
  Additional keyword arguments to be passed to the Device constructor.
@@ -734,15 +735,15 @@ def holes_varying(
734
735
 
735
736
  Parameters
736
737
  ----------
737
- rows : int, optional
738
+ rows : int
738
739
  The number of rows in the grid. Defaults to 5.
739
- cols : int, optional
740
+ cols : int
740
741
  The number of columns in the grid. Defaults to 5.
741
- min_hole_radius : int, optional
742
+ min_hole_radius : int
742
743
  The minimum radius of the holes. Defaults to 10.
743
- max_hole_radius : int, optional
744
+ max_hole_radius : int
744
745
  The maximum radius of the holes. Defaults to 30.
745
- spacing : int, optional
746
+ spacing : int
746
747
  The spacing between hole centers. Defaults to 30.
747
748
  **kwargs : dict
748
749
  Additional keyword arguments to be passed to the Device constructor.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: prefab
3
- Version: 1.1.5
3
+ Version: 1.1.6
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
@@ -535,6 +535,8 @@ Description-Content-Type: text/markdown
535
535
 
536
536
  PreFab is a _virtual nanofabrication environment_ that leverages **deep learning** and **computer vision** to predict and correct for structural variations in integrated photonic devices during nanofabrication.
537
537
 
538
+ > **Try Rosette**: Want a more visual experience? Try [Rosette](https://rosette.dev) - our new layout tool with PreFab models built in, designed for rapid chip design.
539
+
538
540
  ## Prediction
539
541
 
540
542
  PreFab predicts process-induced structural variations, including corner rounding, loss of small lines and islands, filling of narrow holes and channels, sidewall angle deviations, and stochastic effects. This allows designers to rapidly prototype and evaluate expected performance pre-fabrication.
@@ -0,0 +1,13 @@
1
+ prefab/__init__.py,sha256=gFae7gbaHFCprllsaX1Cb3JR-nXhZbwvnmgrYnU8XLo,425
2
+ prefab/__main__.py,sha256=CGb63UhUkN_4_GpS3twqT1613OBeuli-qBiLMHORZU4,2987
3
+ prefab/compare.py,sha256=Witv9jm3MnIwVTJe8goOP9JZw3RUTqxyIF6PhQtcaPY,3532
4
+ prefab/device.py,sha256=1rqs_VQ7am6W473C-EZTsPFDlqNIMMd26VZAUV1tNS0,54885
5
+ prefab/geometry.py,sha256=4fekWMlkdS_qlPNTdPXPhwKuQ5qdQ1Zjf8m9JKd1dA8,12049
6
+ prefab/models.py,sha256=JpBqNFIqbo1ymKEl0NWWF4ZkhvK23rEVVBEFl05TXCI,3671
7
+ prefab/predict.py,sha256=1yQgujZe-QtjZtOQWKcmEFKDt_EH35A83UyTUQO3p14,11731
8
+ prefab/read.py,sha256=WNqC3xENlndzFwXeCF2E7H3Iq2dO_6rPEPZ58DuloqY,16259
9
+ prefab/shapes.py,sha256=58cyXFNh1kEErq2jEbGd3dWSediU1OSmor_FWwc1V8A,25098
10
+ prefab-1.1.6.dist-info/METADATA,sha256=_g2pPvFjqXfVL0P9O6z8jXPf8zAIdRVUoSaN3hbW3aY,34993
11
+ prefab-1.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
+ prefab-1.1.6.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
13
+ prefab-1.1.6.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.25.0
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,13 +0,0 @@
1
- prefab/__init__.py,sha256=0QHTuxxeHo3xJIUq20iQCLiC2nk-rgf2C374l-Aby-g,425
2
- prefab/__main__.py,sha256=aAgt1WXa44k1nJqsiSD3uAfNeGpwtjWqMUYCHN5_Qrw,2759
3
- prefab/compare.py,sha256=iz0H5EvZFZ5O-N2QOQ6wFe-Hftkfyd6oMYpjfjnrMIw,3251
4
- prefab/device.py,sha256=kKmud8QxfSBvadeZw56W_MNXqjRIyTA16jNTQ8v69U0,53048
5
- prefab/geometry.py,sha256=0sa6ietUWZGkxOnUPUzD3q2QpFuOpWkSANoopGpPd6s,11035
6
- prefab/models.py,sha256=JpBqNFIqbo1ymKEl0NWWF4ZkhvK23rEVVBEFl05TXCI,3671
7
- prefab/predict.py,sha256=upGTeNC6vY9Tdko6JEM0gKQH1PGUVYXACpep1OT8EVs,10593
8
- prefab/read.py,sha256=MuF-cugFQ7MWBJ8DOvQuwktIk0fJ8PXBeLye0ydrB8o,14734
9
- prefab/shapes.py,sha256=2qaqyNzu5WG3wVdk4oQzeNXmhwXRHcPnRZlgRrM4MoA,25576
10
- prefab-1.1.5.dist-info/METADATA,sha256=tk_MMU6lQcjqt4FBDgjx87ziII0ulouu2zCj2Ayr-g8,34824
11
- prefab-1.1.5.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
12
- prefab-1.1.5.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
13
- prefab-1.1.5.dist-info/RECORD,,