-
Notifications
You must be signed in to change notification settings - Fork 66
Hotfix/fix scene doping limits #3013
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
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.
Pull Request Overview
This hotfix addresses an issue where the doping_bounds() method would return invalid sentinel values ([1e50, -1e50]) when no doping structures are present in a scene, instead of returning sensible default values of [0, 0].
Key Changes:
- Added sentinel value checks after the doping bounds calculation loop
- Reset bounds to
[0, 0]when no doping values are found in the scene
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
1 file reviewed, 1 comment
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
c09ccc0 to
9b4bbcb
Compare
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/components/scene.py |
0916999 to
0b3184d
Compare
Greptile Summary
doping_bounds()to return[0, 0]instead of sentinel values[1e50, -1e50]when no doping structures are presentConfidence Score: 3/5
== 1e50should usenp.isclose()for robustness. The logic is sound but the implementation needs a minor correction.tidy3d/components/scene.py- the sentinel value checks need tolerance-based comparisonImportant Files Changed
Sequence Diagram
sequenceDiagram participant User participant Scene participant doping_bounds participant Structures User->>Scene: "Visualize doping properties (N_a, N_d, or doping)" Scene->>doping_bounds: "Calculate doping bounds" doping_bounds->>Structures: "Loop through all_structures" alt Structures with SemiconductorMedium found Structures-->>doping_bounds: "Update acceptors_lims and donors_lims" else No structures with doping Structures-->>doping_bounds: "Limits remain at sentinel values [1e50, -1e50]" end doping_bounds->>doping_bounds: "Check if limits are still at sentinel values" alt Limits are sentinel values doping_bounds->>doping_bounds: "Set limits to [0, 0]" end doping_bounds-->>Scene: "Return acceptors_lims, donors_lims" Scene-->>User: "Use limits for visualization"