-
Notifications
You must be signed in to change notification settings - Fork 65
feat(source_time): broadband pulse #2969
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.
5 files reviewed, 1 comment
6c05805 to
026198a
Compare
026198a to
b00febc
Compare
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/components/source/time.pytidy3d/packaging.py |
72a3ed2 to
dc16fac
Compare
caseyflex
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.
Great! So now if use_local_subpixel is None, then the feature will be used if everything works (package installed + licensing for that feature), and otherwise it will not be used. I think this makes sense going forward.
@daquinteroflex The install option tidy3d[extras] is still commented out in pyproject.toml. It should be uncommented before release. However I think it will cause an issue with poetry lock because the version is not yet available on pypi. Did we ever decide how to resolve this?
|
Hi @caseyflex I was actually testing just that yesterday https://github.com/flexcompute/tidy3d/pull/2967/files |
0f4f242 to
c871fa2
Compare
c871fa2 to
81e3dc1
Compare
81e3dc1 to
09d91b7
Compare
Greptile Overview
Updated On: 2025-11-05 20:52:36 UTC
Greptile Summary
This PR introduces
BroadbandPulse, a new source time dependence class that enables exciting simulations across a wide frequency spectrum. The feature is implemented as a wrapper around the tidy3d-extras licensed implementation.Key changes:
BroadbandPulseclass intidy3d/components/source/time.pywith configurable frequency range and minimum amplitude_check_tidy3d_extras_availableandcheck_tidy3d_extras_licensed_feature)Issues found:
tidy3d/packaging.py:244- missing 'f' prefix on f-string causes literal{exc!s}to appear in error message instead of being interpolatedConfidence Score: 4/5
tidy3d/packaging.pywhich contains a syntax error on line 244Important Files Changed
File Analysis
BroadbandPulseclass that wraps tidy3d-extras implementation for wide frequency spectrum excitationSequence Diagram
sequenceDiagram participant User participant BroadbandPulse participant Validator participant PackagingModule participant TidyExtras User->>BroadbandPulse: Instantiate with freq_range, minimum_amplitude BroadbandPulse->>Validator: _check_broadband_pulse_available() Validator->>PackagingModule: check_tidy3d_extras_licensed_feature("BroadbandPulse") PackagingModule->>PackagingModule: _check_tidy3d_extras_available() alt tidy3d-extras not loaded PackagingModule->>TidyExtras: import tidy3d_extras alt Import fails TidyExtras-->>PackagingModule: ImportError PackagingModule-->>Validator: Tidy3dImportError Validator-->>User: Error: Install tidy3d-extras else Import succeeds TidyExtras-->>PackagingModule: tidy3d_extras_mod PackagingModule->>PackagingModule: Check version and features alt BroadbandPulse not in features PackagingModule-->>Validator: Tidy3dImportError Validator-->>User: Error: Feature not licensed else Feature available PackagingModule->>PackagingModule: Cache tidy3d_extras["mod"] Validator-->>BroadbandPulse: Validation passed end end else tidy3d-extras already loaded PackagingModule->>PackagingModule: Check features list alt BroadbandPulse not in features PackagingModule-->>Validator: Tidy3dImportError Validator-->>User: Error: Feature not licensed else Feature available Validator-->>BroadbandPulse: Validation passed end end BroadbandPulse->>User: Instance created User->>BroadbandPulse: Call amp_time(time) or amp_freq(freq) BroadbandPulse->>BroadbandPulse: Access _source property BroadbandPulse->>TidyExtras: extension.BroadbandPulse(...) TidyExtras-->>BroadbandPulse: BroadbandPulse instance BroadbandPulse->>TidyExtras: _source.amp_time(time) TidyExtras-->>BroadbandPulse: Complex amplitude BroadbandPulse-->>User: Return amplitude