-
Notifications
You must be signed in to change notification settings - Fork 70
chore: add GaussianDoping frontend validators #3168
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
base: develop
Are you sure you want to change the base?
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.
2 files reviewed, 3 comments
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
|
98ba3bf to
65f324e
Compare
|
@greptileai Check the updated PR and provide a new confidence score. |
261e108 to
1bdec8f
Compare
|
@greptileai Check the updated PR and provide a new confidence score. Be careful, I didn't remove any tests! |
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.
3 files reviewed, 1 comment
marc-flex
left a comment
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.
Thanks Damiano!
Just a couple of comments below
ca63742 to
d733d4a
Compare
|
@greptileai make the final check and ensure all the issues have been solved. All the tests passed. |
d733d4a to
c3b3ec4
Compare
Greptile's behavior is changing!From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
Note
Strengthens
GaussianDopinginput validation and aligns schemas/tests accordingly.ref_con < concentration; raises validation error to prevent invalid sigma calculationsourceto [xmin,xmax,ymin,ymax,zmin,zmax] via type (Literal[...]) and JSON schema enums across simulation schemas< 2*widthto flag potentially insufficient transition regionref_con,sourcevalidation, width-size warnings) and documents changes inCHANGELOG.mdWritten by Cursor Bugbot for commit c3b3ec4. This will update automatically on new commits. Configure here.
Greptile Summary
This PR strengthens input validation for
GaussianDopingby adding three frontend validators. The changes enforce thatref_con < concentration(preventing mathematical errors in sigma calculation), restrictsourceto valid face identifiers viaLiteraltype, and warn users when any finite box dimension is smaller than2*width(indicating potential issues in the transition region). The implementation follows established patterns using pydantic validators and the logging system. Test coverage is comprehensive, validating all three scenarios including edge cases likenp.infdimensions and all coordinate directions.Confidence Score: 4/5
tidy3d/components/tcad/doping.pyfor style guide compliance with single quotes in error/warning messagesImportant Files Changed
Sequence Diagram
sequenceDiagram participant User participant GaussianDoping participant Validator participant Logger User->>GaussianDoping: Create with params (ref_con, concentration, width, size, source) GaussianDoping->>Validator: Validate source field Note over Validator: Type checking via Literal["xmin", "xmax", "ymin", "ymax", "zmin", "zmax"] Validator-->>GaussianDoping: Valid source or ValidationError GaussianDoping->>Validator: _validate_ref_con_less_than_concentration(concentration) Validator->>Validator: Check ref_con < concentration alt ref_con >= concentration Validator-->>GaussianDoping: Raise ValueError else ref_con < concentration Validator-->>GaussianDoping: Return valid concentration end GaussianDoping->>Validator: _validate_width_vs_size(width) Validator->>Validator: Loop over size dimensions (x, y, z) loop For each dimension alt not np.isinf(size[i]) and size[i] < 2*width Validator->>Logger: log.warning about insufficient size end end Validator-->>GaussianDoping: Return valid width GaussianDoping-->>User: Instance created or ValidationError raised