Skip to content

Commit

Permalink
Merge pull request #20 from gdsfactory/142
Browse files Browse the repository at this point in the history
142
  • Loading branch information
joamatab committed Apr 14, 2022
2 parents da55aba + 840c79a commit 4f132c6
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.4.2

- rename component_factory to cells and cross_section_factory to cross_sections


## [1.4.1](https://github.com/gdsfactory/ubc/pull/19)

- update layer_stack to be compatible with latest gdsfactory 4.7.1
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-e .
lygadgets
gdsfactory[full]==4.7.1
gdsfactory[full]==4.7.3
modes
19 changes: 12 additions & 7 deletions ubcpdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""UBC Siepic Ebeam PDK from edx course"""
import gdsfactory as gf
from gdsfactory.config import logger
from gdsfactory.get_factories import get_component_factories
from gdsfactory.get_factories import get_cells
from gdsfactory.pdk import Pdk


from ubcpdk.config import CONFIG, PATH, module
Expand All @@ -10,10 +11,10 @@
from ubcpdk import tech
from ubcpdk import data

from ubcpdk.tech import cross_section_factory
from ubcpdk.tech import cross_sections


gf.asserts.version(">=4.6.1")
gf.asserts.version(">=4.7.3")
lys = gf.layers.load_lyp(PATH.lyp)
__version__ = "1.4.1"

Expand All @@ -26,15 +27,19 @@
"strip",
"LAYER",
"__version__",
"component_factory",
"cross_section_factory",
"cells",
"cross_sections",
"PDK",
]


logger.info(f"Found UBCpdk {__version__!r} installed at {module!r}")
component_factory = get_component_factories(components)
cells = get_cells(components)

PDK = Pdk(cells=cells, cross_sections=cross_sections)
PDK.activate()


if __name__ == "__main__":
f = component_factory
f = cells
print(f.keys())
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ instances:
component: pack_doe
settings:
component: ring_single
radius: [30, 50, 20]
radius: [30, 50, 20, 40]
length_x: [1, 2, 3]
pack:
do_permutations: True
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion ubcpdk/components/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,6 @@ def ebeam_dc_halfring_straight(
# wg = c << straight()
# wg.connect("o1", sp.ports["opt1"])

c = ebeam_dc_halfring_straight()
# c = ebeam_dc_halfring_straight()
c = ring_with_crossing()
c.show(show_ports=False)
9 changes: 8 additions & 1 deletion ubcpdk/components/dbr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import gdsfactory as gf
from ubcpdk.tech import strip
from ubcpdk.components.add_fiber_array import add_fiber_array


L = 1.55 / 4 / 2 / 2.44
Expand All @@ -24,6 +25,12 @@ def dbr_cavity(**kwargs) -> gf.Component:
return gf.components.cavity(component=dbr(**kwargs))


def dbr_cavity_te(component="dbr_cavity", **kwargs) -> gf.Component:
component = gf.get_component(component, **kwargs)
return add_fiber_array(component)


if __name__ == "__main__":
c = dbr_cavity()
# c = dbr_cavity(n=10)
c = dbr_cavity_te(n=10)
c.show()
1 change: 1 addition & 0 deletions ubcpdk/pdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: ubcpdk
6 changes: 3 additions & 3 deletions ubcpdk/samples/test_ubc1.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_mask1():
for dw in [50e-3, 100e-3, 150e-3, 200e-3]
]
e += [add_gc(ubcpdk.components.ring_with_crossing())]
e += [add_gc(ubcpdk.components.ring_with_crossing(with_component=False))]
# e += [add_gc(ubcpdk.components.ring_with_crossing(with_component=False))]

c = gf.pack(e, max_size=floorplan_size)
m = c[0]
Expand All @@ -106,6 +106,6 @@ def test_mask3():

if __name__ == "__main__":
m, tm = test_mask1()
m, tm = test_mask2()
m, tm = test_mask3()
# m, tm = test_mask2()
# m, tm = test_mask3()
m.show()
2 changes: 1 addition & 1 deletion ubcpdk/tech.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ def get_layer_stack_ubc(thickness: float = 220 * nm) -> LayerStack:
decorator=add_pins_siepic,
)

cross_section_factory = dict(strip=strip)
cross_sections = dict(strip=strip)
8 changes: 4 additions & 4 deletions ubcpdk/tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
from gdsfactory.component import Component
from gdsfactory.difftest import difftest
from pytest_regressions.data_regression import DataRegressionFixture
from ubcpdk import component_factory
from ubcpdk import cells


component_names = component_factory.keys()
cell_names = cells.keys()
dirpath = pathlib.Path(__file__).absolute().with_suffix(".gds")


@pytest.fixture(params=component_names, scope="function")
@pytest.fixture(params=cell_names, scope="function")
def component(request) -> Component:
return component_factory[request.param]()
return cells[request.param]()


def test_pdk_gds(component: Component) -> None:
Expand Down

0 comments on commit 4f132c6

Please sign in to comment.