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
Small improvements #2641
Conversation
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.
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
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 |
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 (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)): |
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.
suggestion (code-quality): Remove unnecessary casts to int, str, float or bool (remove-unnecessary-cast
)
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)): |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
@LuYouxi