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

simplify routing #22

Merged
merged 3 commits into from
Apr 19, 2024
Merged

simplify routing #22

merged 3 commits into from
Apr 19, 2024

Conversation

joamatab
Copy link
Contributor

@joamatab joamatab commented Apr 17, 2024

  • simpler routing strategies
  • add array to cspdk.cells

@flaport

Copy link

@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.

Hey @joamatab - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +185 to +200
_settings_sc = dict(
straight="straight_sc", cross_section=xs_sc, bend="bend_sc", taper="taper_sc"
)
_settings_so = dict(
straight="straight_so", cross_section=xs_so, bend="bend_so", taper="taper_so"
)
_settings_rc = dict(
straight="straight_rc", cross_section=xs_rc, bend="bend_rc", taper="taper_rc"
)
_settings_ro = dict(
straight="straight_ro", cross_section=xs_ro, bend="bend_ro", taper="taper_ro"
)
_settings_nc = dict(
straight="straight_nc", cross_section=xs_nc, bend="bend_nc", taper="taper_nc"
)
_settings_no = dict(
Copy link

Choose a reason for hiding this comment

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

suggestion (code_refinement): Consider using a loop or a more dynamic structure for settings initialization.

The repetitive structure for initializing settings for different routing configurations could be simplified using a loop or a dictionary comprehension, enhancing maintainability and reducing code duplication.

Suggested change
_settings_sc = dict(
straight="straight_sc", cross_section=xs_sc, bend="bend_sc", taper="taper_sc"
)
_settings_so = dict(
straight="straight_so", cross_section=xs_so, bend="bend_so", taper="taper_so"
)
_settings_rc = dict(
straight="straight_rc", cross_section=xs_rc, bend="bend_rc", taper="taper_rc"
)
_settings_ro = dict(
straight="straight_ro", cross_section=xs_ro, bend="bend_ro", taper="taper_ro"
)
_settings_nc = dict(
straight="straight_nc", cross_section=xs_nc, bend="bend_nc", taper="taper_nc"
)
_settings_no = dict(
settings_prefixes = ["sc", "so", "rc", "ro", "nc", "no"]
settings = {
f"settings_{suffix}": {
"straight": f"straight_{suffix}",
"cross_section": f"xs_{suffix}",
"bend": f"bend_{suffix}",
"taper": f"taper_{suffix}"
} for suffix in settings_prefixes
}

@joamatab joamatab merged commit 8e911a0 into main Apr 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant