Align output formats and data return options between inspiral-only and IMR generation functions#12
Draft
Copilot wants to merge 5 commits into
Draft
Align output formats and data return options between inspiral-only and IMR generation functions#12Copilot wants to merge 5 commits into
Copilot wants to merge 5 commits into
Conversation
…meseries flag, fix return order (modes/polarizations last) Agent-Logs-Url: https://github.com/gwnrtools/esigmapy/sessions/57837241-fb95-4316-a67c-050fb712fdda Co-authored-by: Akash-Maurya-0899 <100226598+Akash-Maurya-0899@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gwnrtools/esigmapy/sessions/57837241-fb95-4316-a67c-050fb712fdda Co-authored-by: Akash-Maurya-0899 <100226598+Akash-Maurya-0899@users.noreply.github.com>
… with f-strings Agent-Logs-Url: https://github.com/gwnrtools/esigmapy/sessions/57837241-fb95-4316-a67c-050fb712fdda Co-authored-by: Akash-Maurya-0899 <100226598+Akash-Maurya-0899@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Align output formats and data return options for IMR functions
Align output formats and data return options between inspiral-only and IMR generation functions
May 5, 2026
| ) | ||
| else: | ||
| modes_imr = modes_imr_numpy | ||
| t_imr = np.arange(len(next(iter(modes_imr_numpy.values())))) * delta_t - t_peak |
Collaborator
There was a problem hiding this comment.
@Akash-Maurya-0899 / @copilot Check if this matches with the time-grid generated by the sample_times method of the corresponding PyCBC TimeSeries modes.
prayush
reviewed
May 7, 2026
Comment on lines
+686
to
+692
| if return_hybridization_info and return_orbital_params_user: | ||
| return retval, orbital_vars_dict, modes_imr | ||
| elif return_orbital_params_user: | ||
| return orbital_vars_dict, modes_imr | ||
| elif return_hybridization_info: | ||
| return retval, modes_imr | ||
| return modes_imr |
Contributor
There was a problem hiding this comment.
@copilot Here and everywhere in this PR, keep the order of return objects such that modes_imr is first and all the others are packed into a tuple. e.g. these lines can be replaced with
if return_hybridization_info and return_orbital_params_user:
return modes_imr, (retval, orbital_vars_dict)
elif return_orbital_params_user:
return modes_imr, (orbital_vars_dict,)
elif return_hybridization_info:
return modes_imr, (retval,)
return modes_imr
prayush
requested changes
May 7, 2026
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.
IMR waveform functions had two inconsistencies with their inspiral counterparts: modes/polarizations were returned first (inspiral returns them last), and there was no
return_pycbc_timeseriesflag to skip the overhead of packaging numpy arrays into PyCBCTimeSeriesobjects.Changes
get_imr_esigma_modes/get_imr_esigma_waveform(generator.py)return_pycbc_timeseries=Trueparameter; whenFalse, returns raw numpy arrays with a time grid as the first element(orbital_vars_dict, hyb_info, modes_imr)instead of(modes_imr, orbital_vars_dict, hyb_info)get_imr_esigma_waveformnow calls modes internally withreturn_pycbc_timeseries=Falseand handles PyCBC wrapping itself, consistent with inspiral waveformretval→inspiral_retvalto disambiguate from hybridizationretvalget_imr_esigmasur_mode/get_imr_esigmasur_waveform(surrogate/generator.py)return_pycbc_timeseries=Trueaddition with numpy+time-grid pathget_imr_esigmasur_waveformwhere unpacking fromget_imr_esigmasur_modeincorrectly assumed modes-first ordering (that function already returned modes last)get_imr_esigmasur_waveformMisc
exec()f-string pattern for orbital vars PyCBC wrapping with direct dict assignmentUsage after this change