Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/pyglet-lt-3
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab authored Oct 31, 2024
2 parents 36a9ba1 + 49cc8d3 commit b7c12b7
Show file tree
Hide file tree
Showing 165 changed files with 116 additions and 1,059 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM joamatab/gdsfactory:7.27.0
FROM joamatab/gdsfactory:7.27.1
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ jobs:
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/gdsfactory:latest,${{ secrets.DOCKERHUB_USERNAME }}/gdsfactory:7.27.0
tags: ${{ secrets.DOCKERHUB_USERNAME }}/gdsfactory:latest,${{ secrets.DOCKERHUB_USERNAME }}/gdsfactory:7.27.1
file: .devcontainer/Dockerfile.dev
- name: Build and push minimal
id: docker_build_minimal
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/gdsfactory_minimal:latest,${{ secrets.DOCKERHUB_USERNAME }}/gdsfactory_minimal:7.27.0
tags: ${{ secrets.DOCKERHUB_USERNAME }}/gdsfactory_minimal:latest,${{ secrets.DOCKERHUB_USERNAME }}/gdsfactory_minimal:7.27.1
file: .devcontainer/Dockerfile.dev_minimal

release_environment:
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/test_pdks.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

<!-- towncrier release notes start -->

## [7.27.1](https://github.com/gdsfactory/gdsfactory/releases/tag/v7.27.1) - 2024-05-29

No significant changes.


## [7.27.0](https://github.com/gdsfactory/gdsfactory/releases/tag/v7.27.0) - 2024-05-20

- Improve get route astar [#2752](https://github.com/gdsfactory/gdsfactory/pull/2752)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gdsfactory 7.27.0
# gdsfactory 7.27.2

[![docs](https://github.com/gdsfactory/gdsfactory/actions/workflows/pages.yml/badge.svg)](https://gdsfactory.github.io/gdsfactory/)
[![PyPI](https://img.shields.io/pypi/v/gdsfactory)](https://pypi.org/project/gdsfactory/)
Expand All @@ -11,7 +11,7 @@

![logo](https://i.imgur.com/cN1ZWq8.png)

> **⚠️ Deprecation Warning:**
> **⚠️ Deprecation Warning:**
> This version of gdsfactory will only have bug fixes and minor updates. Please see [https://github.com/gdsfactory/gdsfactory](https://github.com/gdsfactory/gdsfactory) for the latest version.
gdsfactory: An open source platform for end to-end chip design and validation.
Expand Down
6 changes: 6 additions & 0 deletions docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ pip install -e .[dev]
pre-commit install
```

**Note**:
- If you need to run the notebooks and you are not using VSCode or Anaconda, then you need to install [jupyter lab](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html)
```
pip install jupyterlab
```

## Style

- Follow [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) and existing code.
Expand Down
2 changes: 1 addition & 1 deletion gdsfactory/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
if TYPE_CHECKING:
from loguru import Logger

__version__ = "7.27.0"
__version__ = "7.27.1"
PathType = str | pathlib.Path

home = pathlib.Path.home()
Expand Down
2 changes: 1 addition & 1 deletion gdsfactory/generic_tech/klayout/grain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>gdsfactory</name>
<token/>
<hidden>false</hidden>
<version>7.27.0</version>
<version>7.27.1</version>
<api-version/>
<title>gdsfactory</title>
<doc>EDA tool to layout integrated circuits</doc>
Expand Down
2 changes: 1 addition & 1 deletion gdsfactory/generic_tech/klayout/pymacros/set_menus.lym
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<text>
import pya

__version__ = "7.27.0"
__version__ = "7.27.1"


def set_menu():
Expand Down
106 changes: 59 additions & 47 deletions gdsfactory/get_netlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def get_netlist(
get_instance_name: Callable[..., str] = get_instance_name_from_alias,
allow_multiple: bool = False,
merge_info: bool = False,
extend_recursive_port_names: bool = False,
) -> dict[str, Any]:
"""Returns instances, connections and placements from :class:`Component` as a dict.
Expand Down Expand Up @@ -144,6 +145,7 @@ def get_netlist(
allow_multiple: False to raise an error if more than two ports share the same connection. \
if True, will return key: [value] pairs with [value] a list of all connected instances.
merge_info: True to merge info and settings into the same dict.
extend_recursive_port_names: Compatibility with recursive get_netlist port name identifiers.
Returns:
Dictionary containing the following:
Expand Down Expand Up @@ -197,12 +199,11 @@ def get_netlist(

# Prefer name from settings over c.name
if c.settings:
settings = dict(c.settings)
settings = c.settings.model_dump(exclude_none=True)

if merge_info:
settings.update(
{k: v for k, v in dict(c.info).items() if k in settings}
)
info = c.info.model_dump(exclude_none=True)
settings.update({k: v for k, v in info.items() if k in settings})

settings = clean_value_json(settings)
instance.update(
Expand Down Expand Up @@ -237,7 +238,12 @@ def get_netlist(
# a bit of a hack... get the top-level port for the
# ComponentArray, by our known naming convention. I hope no one
# renames these ports!
parent_port = component[top_name]
if extend_recursive_port_names:
parent_port = component[
parent_port_name
] # otherwise links to non existent component ports
else:
parent_port = component[top_name]
name2port[lower_name] = parent_port
top_ports_list.add(top_name)
ports_by_type[parent_port.port_type].append(lower_name)
Expand Down Expand Up @@ -598,9 +604,11 @@ def get_netlist_recursive(
inst_name = get_instance_name(component, ref)
netlist_dict = {"component": f"{rcell.name}{component_suffix}"}
if rcell.settings:
netlist_dict.update(settings=rcell.settings)
netlist_dict.update(
settings=rcell.settings.model_dump(exclude_none=True)
)
if rcell.info:
netlist_dict.update(info=rcell.info)
netlist_dict.update(info=rcell.info.model_dump(exclude_none=True))
netlist["instances"][inst_name] = netlist_dict

return all_netlists
Expand Down Expand Up @@ -638,43 +646,47 @@ def _demo_mzi_lattice() -> None:

if __name__ == "__main__":
import gdsfactory as gf
from gdsfactory.decorators import flatten_offgrid_references

rotation_value = 35
cname = "test_get_netlist_transformed"
c = gf.Component(cname)
i1 = c.add_ref(gf.components.straight(), "i1")
i2 = c.add_ref(gf.components.straight(), "i2")
i1.rotate(rotation_value)
i2.connect("o2", i1.ports["o1"])

# flatten the oddly rotated refs
c = flatten_offgrid_references(c)
print(c.get_dependencies())
c.show()

# perform the initial sanity checks on the netlist
netlist = c.get_netlist()
connections = netlist["connections"]
assert len(connections) == 1, len(connections)
cpairs = list(connections.items())
extracted_port_pair = set(cpairs[0])
expected_port_pair = {"i2,o2", "i1,o1"}
assert extracted_port_pair == expected_port_pair

recursive_netlist = get_netlist_recursive(c)
top_netlist = recursive_netlist[cname]
# the recursive netlist should have 3 entries, for the top level and two
# rotated straights
assert len(recursive_netlist) == 1, len(recursive_netlist)
# confirm that the child netlists have reference attributes properly set

i1_cell_name = top_netlist["instances"]["i1"]["component"]
i1_netlist = recursive_netlist[i1_cell_name]
# currently for transformed netlists, the instance name of the inner cell is None
assert i1_netlist["placements"][None]["rotation"] == rotation_value

i2_cell_name = top_netlist["instances"]["i2"]["component"]
i2_netlist = recursive_netlist[i2_cell_name]
# currently for transformed netlists, the instance name of the inner cell is None
assert i2_netlist["placements"][None]["rotation"] == rotation_value

c = gf.c.mzi()
n = c.get_netlist()

# from gdsfactory.decorators import flatten_offgrid_references

# rotation_value = 35
# cname = "test_get_netlist_transformed"
# c = gf.Component(cname)
# i1 = c.add_ref(gf.components.straight(), "i1")
# i2 = c.add_ref(gf.components.straight(), "i2")
# i1.rotate(rotation_value)
# i2.connect("o2", i1.ports["o1"])

# # flatten the oddly rotated refs
# c = flatten_offgrid_references(c)
# print(c.get_dependencies())
# c.show()

# # perform the initial sanity checks on the netlist
# netlist = c.get_netlist()
# connections = netlist["connections"]
# assert len(connections) == 1, len(connections)
# cpairs = list(connections.items())
# extracted_port_pair = set(cpairs[0])
# expected_port_pair = {"i2,o2", "i1,o1"}
# assert extracted_port_pair == expected_port_pair

# recursive_netlist = get_netlist_recursive(c)
# top_netlist = recursive_netlist[cname]
# # the recursive netlist should have 3 entries, for the top level and two
# # rotated straights
# assert len(recursive_netlist) == 1, len(recursive_netlist)
# # confirm that the child netlists have reference attributes properly set

# i1_cell_name = top_netlist["instances"]["i1"]["component"]
# i1_netlist = recursive_netlist[i1_cell_name]
# # currently for transformed netlists, the instance name of the inner cell is None
# assert i1_netlist["placements"][None]["rotation"] == rotation_value

# i2_cell_name = top_netlist["instances"]["i2"]["component"]
# i2_netlist = recursive_netlist[i2_cell_name]
# # currently for transformed netlists, the instance name of the inner cell is None
# assert i2_netlist["placements"][None]["rotation"] == rotation_value
7 changes: 5 additions & 2 deletions gdsfactory/routing/get_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,14 @@ def get_route_from_waypoints(
ptop = c << gf.components.pad(port_orientation=270)
pbot = c << gf.components.pad(port_orientation=90)

ptop.movex(3)
ptop.movex(300)
ptop.movey(300)
route = get_route_electrical(
route = get_route(
ptop.ports["pad"],
pbot.ports["pad"],
cross_section="xs_sc",
bend=gf.c.wire_corner45,
width=5,
)
c.add(route.references)
c.show()
Expand Down
13 changes: 1 addition & 12 deletions gdsfactory/samples/pdk/test_fab_c/test_settings_mzi_nc_.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
function: mzi
info: {}
module: gdsfactory.components.mzi
name: mzi_01020fcd
name: mzi_b485ef26
settings:
add_electrical_ports_bot: true
add_optical_ports_arms: false
bend:
function: bend_euler_nc
combiner: null
cross_section:
bbox_layers:
- - 36
Expand All @@ -19,26 +18,19 @@ settings:
radius_min: 5.0
sections:
- hidden: false
insets: null
layer:
- 34
- 0
name: _default
offset: 0.0
offset_function: null
port_names:
- o1
- o2
port_types:
- optical
- optical
simplify: null
width: 1.0
width_function: null
cross_section_x_bot: null
cross_section_x_top: null
delta_length: 10.0
extend_ports_straight_x: null
length_x: 0.1
length_y: 2.0
min_length: 0.01
Expand All @@ -52,7 +44,4 @@ settings:
function: mmi1x2_nc
straight:
function: straight_nc
straight_x_bot: null
straight_x_top: null
straight_y: null
with_splitter: true
13 changes: 1 addition & 12 deletions gdsfactory/samples/pdk/test_fab_c/test_settings_mzi_no_.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
function: mzi
info: {}
module: gdsfactory.components.mzi
name: mzi_4d4fe19b
name: mzi_e2c06608
settings:
add_electrical_ports_bot: true
add_optical_ports_arms: false
bend:
function: bend_euler_no
combiner: null
cross_section:
bbox_layers:
- - 36
Expand All @@ -19,26 +18,19 @@ settings:
radius_min: 5.0
sections:
- hidden: false
insets: null
layer:
- 34
- 0
name: _default
offset: 0.0
offset_function: null
port_names:
- o1
- o2
port_types:
- optical
- optical
simplify: null
width: 0.9
width_function: null
cross_section_x_bot: null
cross_section_x_top: null
delta_length: 10.0
extend_ports_straight_x: null
length_x: 0.1
length_y: 2.0
min_length: 0.01
Expand All @@ -52,7 +44,4 @@ settings:
function: mmi1x2_no
straight:
function: straight_no
straight_x_bot: null
straight_x_top: null
straight_y: null
with_splitter: true
Loading

0 comments on commit b7c12b7

Please sign in to comment.