What’s New in LEGWORK
This log keeps track of the changes implemented in each version of LEGWORK.
v1.0.0 | GitHub release
UNRELEASED
- New science changes:
Updated LISA confusion noise model “karnesis21” added, based on https://scixplorer.org/abs/2021PhRvD.104d3019K/abstract, set as the new default for all LISA calculations
Added
DECIGOas an instrument for PSD calculations based on Yagi & Seto 2011 [2011PhRvD..83d4011Y] with update from erratum Yagi & Seto 2017 [2017PhRvD..95j9901Y]. It uses the same confusion noise model as LISA by default.
- Features/enhancements:
Indexing and masking:
Sourceclasses can now be masked with any index identifier (e.g.sources[0],sources[[1, 2]],sources[:10],sources[sources.snr > 7]), which returns a new class containing only the masked sources. Any interpolatedg(n,e)and sensitivity curve functions are passed directly to the new class so no interpolation is repeated, but the arrays are separate copies/masks. You can also copySourceinstances withSource.copy()Saving and loading: Sources can be saved to an HDF5 file with
Source.save()and read back in withSource.from_file(). The version of LEGWORK used to create the sources is recorded in the file and a warning is shown on load if it differs from the installed version (this addsh5pyas a new dependency).- New class properties
Source.m_c,Source.a,Source.n_sourcesandSource.ecc_tolare now derived properties rather than stored variables, so they always stay consistent with the values they’re calculated from.m_c,n_sourcesandecc_tolare read-only (changem_1orm_2, the number of sources, orgw_lum_tolinstead), whilst assigning toaupdatesf_orbto match.Added
Source.interpolate_g, which reports whether the g(n,e) function is interpolated for a set of sourcesSource.gw_lum_tolandSource.sc_paramsare now properties, so they can be changed directly instead of through separate update functions. Assigning toSource.gw_lum_tolrecalculatesecc_tolandharmonics_required, and changingSource.sc_paramsre-interpolates the sensitivity curve — either by assigning a whole new dictionary (anything left out reverts to its default), or by changing a single value with e.g.sources.sc_params["t_obs"] = 5 * u.yr.
Breaking change:
Source.update_gw_lum_tol()andSource.update_sc_params()have been removed, assign toSource.gw_lum_tolandSource.sc_paramsinstead.Breaking change: the
re_interpolate_scargument has been removed fromget_snr(),get_snr_stationary()andget_snr_evolving(). These functions now always keepsc_paramsin sync with the values they are given, and the sensitivity curve is only re-interpolated when something actually changes.
- Code clean up and package modernisation:
Consolidate all packaging/tooling config into
pyproject.toml(PEP 621) —setup.py,setup.cfg,requirements.txt,environment.ymlanddocs/requirements.txthave been removedMove the package to a
src/layout (legwork/->src/legwork/)Replace
flake8withruff(configured under[tool.ruff]inpyproject.toml) and fix the lint errors it surfacedReplace every
printstatement that wasn’t behind averboseflag with theloggingmodule. Messages now go through a logger calledLEGWORK(available aslegwork.logger) and are prefixed with a boldLEGWORK info/LEGWORK warning/LEGWORK error, coloured yellow for warnings and red for errors when writing to a terminal. Messages can be silenced with e.g.legwork.logger.setLevel(logging.ERROR)Standardise the imports within the package on explicit relative imports (
from . import utils) instead of a mix ofimport legwork.utils as utilsandfrom legwork import utils(the tests still import the package absolutely, since they should test the installed version)Build releases with
python -m buildinstead ofpython setup.py sdist bdist_wheelSplit CI into separate
Lint,TestsandDocs notebooksworkflows so a failure says what brokeAdd
.pre-commit-config.yamlso lint problems are caught locally before they reach CIAdd Dependabot to keep the GitHub Actions versions up to date
- Documentation
Add dark mode, changelog page, full-screen pages, and documentation for the new changes listed above
v0.5.3 | GitHub release
TW 09/07/26
Bug fix for #127 found by @willcerny. This corrects $g(n, e)$ where one term was cubed instead of squared. This causes slight issues for low harmonic modes of very eccentric sources. See the issue for a plot demonstrating where this is focused.
Use decorators for visualisation to avoid changing global matplotlib settings for plot
Change to use
np.trapezoidovernp.trapzand fix numpy to >= 2.0
v0.5.2 | GitHub release
TW 02/06/25
Bug fix: Ensure that
plot_sources_on_scemploys the sensitivity curve settings that are saved in aSourceclass when plotting y-values of sources (thanks to Kierstin Sorensen for pointing out this issue)
v0.5.1 | GitHub release
TW 11/01/25
Issue [#116] LEGWORK will now raise errors if invalid harmonics are supplied
v0.5.0 | GitHub release
TW 22/06/24
- Update to Python 3.11 and various dependencies
Fix deprecations based on these updates
Add
__repr__and__len__functions for the Source class and its subclasses
v0.4.7 | GitHub release
TW 12/10/23
Issue [#111] Allow
plot_sources_on_scto change the underlying sensitivity curve directly withsc_vis_settings
v0.4.6 | GitHub release
TW 13/04/23
- Issue [#109] Upgrade
numpyversion Upgrade required to avoid error in
np.nan_to_numusage - thanks to Jakob Stegmann for raising this
- Issue [#109] Upgrade
v0.4.5 | GitHub release
TW 27/09/22
Change positions coordinate system to barycentric rather than heliocentric
Ensure
thetais a co-latitude inamplitude_modulation
v0.4.4 | GitHub release
TW 14/09/22
Issues [#106] Fix sampling of inclination and polarisation when they are not supplied to
Source
v0.4.3 | GitHub release
TW 27/06/22
- Issues [#102] Make SNR functions notice when you change confusion noise
Source.get_snr()now takes allsc_paramsas arguments for re-interpolation etcSource.get_snr_stationaryandSource.get_snr_evolvinghave the same parameters added as aboveAll functions in
snrnow take**kwargsthat are passed directly topsd.power_spectral_densityfor maximum flexibility
v0.4.2 | GitHub release
TW 27/07/22
Issues [#101] Unhide cells that change plot styles in demos so no errors are thrown
v0.4.1 | GitHub release
- Issue [#98]
log_scalecan now be used throughout plots This additionally changes what the x and y labels are set to in
Source.plot_source_variables:D
- Issue [#98]
Issue [#99]
y_labelnow automatically worked out for 1D plots fromSource.plot_source_variablesReplaced two functions
visualisation.plot_sources_on_sc_circ_statandvisualisation.plot_sources_on_sc_ecc_statwith a simplervisualisation.plot_sources_on_scsince there was no point in having two when we could just setf_dom=2 f_orbFix demos to account for recent changes
v0.4.0 | GitHub release
TW 15/06/22
Bug fix: snr class variable was not updated when sources have merged
Non-averaged SNR calculations are only applicable for circular/stationary sources so removed option for other sources
Amplitude modulation for non-averaged SNR changed to match Babak+21 this significantly changes the SNR of sources with specific positions/polarisations/inclinations
v0.3.1 | GitHub release
TW 26/05/22
Bug fix: LISA noise wasn’t calculated correctly, fixed to match Robson+19 Eq. 12. Thanks to Kevin Burdge for helping us to notice this!
Issues [#94] Fix condition
v0.3.0 | GitHub release
TW 01/02/22
New major version of LEGWORK after several updates during the JOSS review (see 0.2.0-0.2.5)
v0.2.5 | GitHub release
TW 27/01/22
- Issue [#89]
Created environment.yml for the package
Updated installation instructions to match
Issue [#90] Added all psd functions to __all__
v0.2.4 | GitHub release
TW 27/01/22
Make dependencies in setup.cfg match requirements.txt!
v0.2.3 | GitHub release
TW 23/01/22
Issue [#75] Fix mixing quantities with floats when plotting
Issue [#86] Clarify how notebooks should be run and update the installation instructions
v0.2.2 | GitHub release
KB 18/01/22
Issues [#68, #84] Removes upper bound on version limits for numpy and numba
v0.2.1 | GitHub release
TW 11/01/22
Issue [#64] Remove “auto” option from
interpolate_gin favour of interpolating by default warning the user if they don’t have many samplesIssue [#76] Make it so that
strain.h_0_nreturns as unitless (same assource.Source.get_h_0_n). Same forsnrfunctions.Fixed an issue introduced in 0.2.0 where automated observation times didn’t work in
visualisation.plot_sources_on_sc_circ_statIssue [#78] Add a warning for when people are evolving past the merger with
avoid_merger=True
KB 13/01/22 - Issues [#79, #80] Add discussion of limitiations and scope of legwork snr calculations
v0.2.0 | GitHub release
TW 05/01/21
- A couple of changes to how confusion noise is handled
End user can now access confusion noise functions directly through
get_confusion_noiseAdded confusion noise fit from Huang+20 to be used with TianQin
Added confusion noise fit from Thiele+21 which is based on a WDWD population with a metallicity dependent binary fraction
TianQin psd function now include the confusion noise
- Change defaults used in
sourceandpsd Often defaults for arm length, observation time and confusion noise were previously LISA related, LEGWORK now automatically works out the defaults based on what instrument is chosen
- Change defaults used in
Bug fix: in
visualisationavoid mixing floats with Quantities when filling in a sensitivity curve
v0.1.7 | GitHub release
TW 05/01/21
Link GitHub releases to Zenodo
v0.1.6 | GitHub release
TW 18/11/21
Add a factor of 10/3 to the TianQin sensitivity curve to make it consistent with LISA (thanks to Yi-Ming Hu for pointing this out!)
v0.1.5 | GitHub release
KB 18/11/21
Make confusion noise follow shape of supplied frequency even in case of no confusion
v0.1.4 | GitHub release
TW 17/11/21
Add
custom_psdto thesc_paramsinSourceChange the default parameters of
Source.get_snr()to usesc_params
v0.1.3 | GitHub release
TW 16/11/21
Move
determine_stationarityfromutilstoevolto avoid cyclical imports
v0.1.2 | GitHub release
TW 12/11/21
Change default values for
small_e_tolandlarge_e_tolinget_t_merge_eccallow users to specify custom confusion noise in sensitivity curves
v0.1.1 | GitHub release
TW, 5/11/21
Small changes to visualisation code and updates to tutorials/demos with the new code
allow user to specify weights in
Sourceand visualisation functionsallow user to customise sensitivity curve in any use of
plot_sources_on_sclegwork.__version__now prints the version numberAdd new demo about verification binaries and other miscellaneous docs fixes
v0.1.0 | GitHub release
TW, KB 31/10/21
Major version change as we’ve added a significant enhancement with the new non-average SNR calculations.
Change
snrmodule to allow the calculation of non-averaged SNR using exact inclination, sky position and polarisationsLet users specific inclination, sky position and polarisation in
SourceinstantiationAdd
VerificationBinariesclass toSourcemodule for convenient access to LISA verification binary data from Kupfer+18Change max line length in code from 80 to 110 to increase readability
v0.0.6 | GitHub release
TW, 26/10/21
Avoid plotting merged sources in any of the automatic routines
Allow source class evolution code to handle sources close to their merger
Ensure SNR calculation works if some sources have merged and produces no warnings
Change default behaviour of Source class with interpolate_g - no longer always interpolate, only when the collection of sources is fairly large or it contains eccentric sources
Add a warning for if all timesteps are too close to the merger (based on
t_before) and hence evolution can’t happen
v0.0.5 | GitHub release
TW, 25/09/21
Avoid LSODA warnings by preventing integration from getting near the singularity at the merger
Allow user to select how long before a merger to stop integration
v0.0.4 | GitHub release
TW, 19/05/21
Change visualisation module to be more flexible with kwargs (allow any for dist plot and add linewidth to sensitivity curve function)
Change Source.get_snr() to allow re-interpolation of the sensitivity curve for convenience (and fix the warning so it works properly)
v0.0.3 | GitHub release
TW, 12/04/21
- Allow the computation of merger times with
get_merger_times After computing, times are used automatically in subsequent SNR calculations to avoid doubling up the computation
- Allow the computation of merger times with
- Add
evolve_sourcesfunction that evolves sources through time, updates merger times and if necessary marks them as merged Merged sources are ignored in other computations (e.g. strain and SNR)
- Add
Add
ret_snr2_by_harmonicto eccentric snr functions to allow the user to get the SNR at each harmonic separately instead of the totalAdd minor fixes to snr for evolving sources for when sources are closes to merging
v0.0.2 | GitHub release
Update version number to work with pip
v0.0.1 | GitHub release
Initial release