-
Notifications
You must be signed in to change notification settings - Fork 66
chore: minor EME docstring and validation improvements #3032
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
e13884a to
b4763fa
Compare
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.
4 files reviewed, 4 comments
b4763fa to
788f7d4
Compare
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.
7 files reviewed, 2 comments
788f7d4 to
c81685b
Compare
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.
7 files reviewed, no comments
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
|
This PR:
num_freqsvalidation to use sampling points, with a larger limit for the overall interpolated freqsnum_sweepfrom 1 toNoneforEMECoefficientMonitorSubsumes the easy part of this PR:
#3024
Greptile Overview
Greptile Summary
This PR improves EME frequency validation and documentation by distinguishing between frequency sampling points (where modes are computed) and total interpolated frequencies. The validation now allows up to 2000 total frequencies when interpolation is enabled, but limits sampling points to 500, making the limits more practical for users who rely on mode interpolation.
Key changes:
num_sweepinEMECoefficientMonitorfrom 1 toNoneto record all sweep indices by default_num_sampling_pointsproperty to calculate actual mode solve points based on interpolation settingsConfidence Score: 5/5
num_sweepis backward-compatible (None is more permissive than 1), and comprehensive tests verify both interpolation-enabled and disabled scenarios.Important Files Changed
File Analysis
num_sweepfrom 1 to None in EMECoefficientMonitor, fixed typo in docstringsSequence Diagram
sequenceDiagram participant User participant EMESimulation participant Validation participant EMEGrid participant ModeSpec User->>EMESimulation: Create simulation with freqs=[f1, f2, ..., fN] User->>EMESimulation: validate_pre_upload() EMESimulation->>Validation: _validate_size() Validation->>Validation: Check len(freqs) <= MAX_NUM_FREQS (2000) Validation->>EMESimulation: Get _num_sampling_points EMESimulation->>EMEGrid: Loop through mode_specs loop For each mode_spec EMEGrid->>ModeSpec: Get interp_spec alt interp_spec is None ModeSpec-->>EMESimulation: Add all freqs to set else interp_spec exists ModeSpec-->>EMESimulation: Add sampling_points(freqs) to set end end EMESimulation-->>Validation: Return len(unique sampling points) Validation->>Validation: Check sampling_points <= MAX_NUM_SAMPLING_POINTS (500) alt sampling_points > 500 Validation-->>User: Raise SetupError else sampling_points > 20 Validation-->>User: Log warning else Validation-->>User: Validation passes end