FXC-4546: add baseband source time classes for transient simulations#3250
Open
dmarek-flex wants to merge 1 commit intodevelopfrom
Open
FXC-4546: add baseband source time classes for transient simulations#3250dmarek-flex wants to merge 1 commit intodevelopfrom
dmarek-flex wants to merge 1 commit intodevelopfrom
Conversation
Contributor
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/components/source/time.pyLines 106-119 106 freqs = np.fft.rfftfreq(len(values), d=dt)
107
108 peak = np.max(spectrum)
109 if peak == 0:
! 110 return (0.0, 1.0)
111
112 cutoff = np.exp(-(num_fwidth**2) / 2)
113 above_cutoff = spectrum >= cutoff * peak
114 if not np.any(above_cutoff):
! 115 return (0.0, freqs[-1])
116
117 indices = np.where(above_cutoff)[0]
118 fmin = float(freqs[indices[0]])
119 fmax = float(freqs[indices[-1]]) |
711db32 to
965c864
Compare
Contributor
Author
Add BasebandStep, BasebandGaussianPulse, BasebandRectangularPulse, and BasebandCustomSourceTime for unmodulated transient RF excitations (TDR, step functions, arbitrary time profiles). These inherit from SourceTime directly, require no freq0/fwidth, and compute frequency_range from the signal's actual frequency content. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
965c864 to
8e17e32
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| "rise_time" | ||
| ], | ||
| "type": "object" | ||
| }, |
There was a problem hiding this comment.
Schema type names mismatch Python class names
High Severity
The JSON schemas define type discriminators BasebandStepSourceTime and BasebandGaussianSourceTime, but the corresponding Python classes are named BasebandStep and BasebandGaussianPulse. This mismatch will cause JSON serialization/deserialization failures since the type discriminator values won't match between the Python code output and what the schemas expect.
Additional Locations (1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Note
Medium Risk
Introduces new
source_timevariants and updates schema discriminators and type unions used across simulation/source validation, which could affect serialization and downstream integrations if any assumptions about allowedSourceTimeTypevalues exist.Overview
Adds new baseband (carrier-free) source time types for transient RF simulations:
BasebandStep,BasebandGaussianPulse,BasebandRectangularPulse, andBasebandCustomSourceTime(dataset-driven with FFT-derived bandwidth and end-time detection).Wires these types through the system by introducing a shared
SourceTimeTypeunion incomponents/types/time.py, updating imports/validators and S-matrix component modelers/ports, exporting the new classes viatidy3d.__init__andtidy3d/rf.py, and extending JSON schemas (Simulation,ModeSimulation,TerminalComponentModeler) sosource_timediscriminators accept the new variants.Adds a comprehensive microwave test suite covering phase-locking to 0, waveform shapes,
frequency_range/end_timebehavior (including edge cases), plotting, and fullSimulationvalidation with each new baseband type; also updates theCHANGELOGaccordingly.Written by Cursor Bugbot for commit 8e17e32. This will update automatically on new commits. Configure here.