Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gdsfactory8 #413

Merged
merged 38 commits into from
Jun 19, 2024
Merged

Gdsfactory8 #413

merged 38 commits into from
Jun 19, 2024

Conversation

joamatab
Copy link
Contributor

@joamatab joamatab commented Jun 2, 2024

  • fix plugins for gdsfactory8

@yaugenst-flex
@nikosavola
@simbilod

@joamatab joamatab requested a review from simbilod June 2, 2024 00:00
Copy link

github-actions bot commented Jun 2, 2024

Label error. Requires at least 1 of: breaking, bug, github_actions, documentation, dependencies, enhancement, feature, maintenance, security. Found: major

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

in_ports = [p for p in ref.ports if p.startswith("in")]
out_ports = [p for p in ref.ports if p.startswith("out")]
for in_port in in_ports:
for out_port in out_ports:
inst_in = f"{inst_name},{in_port}"
inst_out = f"{inst_name},{out_port}"
g.add_edge(inst_in, inst_out, weight=0.0001, component=ref.parent.name)
g.add_edge(inst_in, inst_out, weight=0.0001, component=ref.parent_cell.name)


def _get_edge_based_route_attr_graph(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): Low code quality found in _get_edge_based_route_attr_graph - 10% (low-code-quality)


ExplanationThe quality score for this function is below the quality threshold of 25%.
This score is a combination of the method length, cognitive complexity and working memory.

How can you solve this?

It might be worth refactoring this function to make it shorter and more readable.

  • Reduce the function length by extracting pieces of functionality out into
    their own functions. This is the most important thing you can do - ideally a
    function should be less than 10 lines.
  • Reduce nesting, perhaps by introducing guard clauses to return early.
  • Ensure that variables are tightly scoped, so that code using related concepts
    sits together within the function rather than being scattered.

@joamatab joamatab added the major label Jun 4, 2024
@joamatab joamatab mentioned this pull request Jun 5, 2024
7 tasks
@yaugenst-flex
Copy link

yaugenst-flex commented Jun 11, 2024

Note that the fix from #421 is not complete! It just always puts ports on the core layer. This still needs fixing!

(also I only tested the core classes, i.e. LayeredComponentBase and the Tidy3DComponent.

@joamatab
Copy link
Contributor Author

Sounds good Yannick, the tests and docs are still failing

@simbilod
Copy link
Collaborator

simbilod commented Jun 11, 2024

Sounds good Yannick, the tests and docs are still failing

The plugin will probably require a similar fix to the meshing, i.e. with the new layerstack now the polygons are returned from the AbstractLayer via a get_shapes method that returns a KLayout region.

See 347683e

Unless you already call fuse_polygons @yaugenst-flex :)

Then we just need to think about the port layer fix

@yaugenst
Copy link
Collaborator

Oops. probably should be using this one 😅

Anyways, yeah thanks @simbilod for the insight, I'll have another look tomorrow. It seemed ok on the simple components that I was running with.. let's see. I do rely on you for the meshing though so I assumed that part already worked ;)

@joamatab joamatab merged commit f67d80d into main Jun 19, 2024
7 of 14 checks passed
@joamatab joamatab deleted the gdsfactory8 branch June 19, 2024 08:26
@joamatab joamatab restored the gdsfactory8 branch June 20, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants