-
Notifications
You must be signed in to change notification settings - Fork 35
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
Gdsfactory8 #413
Conversation
Label error. Requires at least 1 of: breaking, bug, github_actions, documentation, dependencies, enhancement, feature, maintenance, security. Found: major |
There was a problem hiding this 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( |
There was a problem hiding this comment.
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
)
Explanation
The 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.
Note that the fix from #421 is not complete! It just always puts ports on the (also I only tested the core classes, i.e. |
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 See 347683e Unless you already call fuse_polygons @yaugenst-flex :) Then we just need to think about the port layer fix |
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 ;) |
@yaugenst-flex
@nikosavola
@simbilod