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

Small improvements #2641

Merged
merged 2 commits into from Mar 24, 2024
Merged

Small improvements #2641

merged 2 commits into from Mar 24, 2024

Conversation

joamatab
Copy link
Contributor

@joamatab joamatab commented Mar 24, 2024

  • fix bbox for taper #2637
  • fix bbox for mmis

@LuYouxi

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.

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

General suggestions:

  • Verify the consistency of data types for component dimensions across all modifications.
  • Consider the impact of removing float conversion on the system's type consistency.
  • Review the necessity of commented-out code and remove if it's no longer relevant.
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.

@@ -107,9 +104,10 @@ def taper(
port_type=port_order_types[1],
)

c.info["length"] = float(length)
c.info["length"] = length
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Ensure type consistency for 'length' in 'c.info'.

The removal of float conversion might introduce type inconsistency if 'length' is not guaranteed to be a float elsewhere.

@@ -82,7 +82,7 @@ def grating_coupler_elliptical_trenches(
c = gf.Component()

# Make each grating line
for p in range(p_start, p_start + n_periods + 1):
for p in range(int(p_start), int(p_start + n_periods + 1)):
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (code-quality): Remove unnecessary casts to int, str, float or bool (remove-unnecessary-cast)

Suggested change
for p in range(int(p_start), int(p_start + n_periods + 1)):
for p in range(p_start, int(p_start + n_periods + 1)):

@joamatab joamatab merged commit 4fb3bc5 into main Mar 24, 2024
10 of 11 checks passed
@joamatab joamatab deleted the small_improvements branch March 24, 2024 14:49
Copy link

codecov bot commented Mar 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.78%. Comparing base (eeab492) to head (64deb71).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2641   +/-   ##
=======================================
  Coverage   71.77%   71.78%           
=======================================
  Files         366      366           
  Lines       23736    23732    -4     
  Branches     3874     3873    -1     
=======================================
- Hits        17037    17035    -2     
+ Misses       5574     5572    -2     
  Partials     1125     1125           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant