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 DECIGO as 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: Source classes 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 interpolated g(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 copy Source instances with Source.copy()

    • Saving and loading: Sources can be saved to an HDF5 file with Source.save() and read back in with Source.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 adds h5py as a new dependency).

    • New class properties
      • Source.m_c, Source.a, Source.n_sources and Source.ecc_tol are now derived properties rather than stored variables, so they always stay consistent with the values they’re calculated from. m_c, n_sources and ecc_tol are read-only (change m_1 or m_2, the number of sources, or gw_lum_tol instead), whilst assigning to a updates f_orb to match.

      • Added Source.interpolate_g, which reports whether the g(n,e) function is interpolated for a set of sources

      • Source.gw_lum_tol and Source.sc_params are now properties, so they can be changed directly instead of through separate update functions. Assigning to Source.gw_lum_tol recalculates ecc_tol and harmonics_required, and changing Source.sc_params re-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() and Source.update_sc_params() have been removed, assign to Source.gw_lum_tol and Source.sc_params instead.

    • Breaking change: the re_interpolate_sc argument has been removed from get_snr(), get_snr_stationary() and get_snr_evolving(). These functions now always keep sc_params in 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.yml and docs/requirements.txt have been removed

    • Move the package to a src/ layout (legwork/ -> src/legwork/)

    • Replace flake8 with ruff (configured under [tool.ruff] in pyproject.toml) and fix the lint errors it surfaced

    • Replace every print statement that wasn’t behind a verbose flag with the logging module. Messages now go through a logger called LEGWORK (available as legwork.logger) and are prefixed with a bold LEGWORK 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 of import legwork.utils as utils and from legwork import utils (the tests still import the package absolutely, since they should test the installed version)

    • Build releases with python -m build instead of python setup.py sdist bdist_wheel

    • Split CI into separate Lint, Tests and Docs notebooks workflows so a failure says what broke

    • Add .pre-commit-config.yaml so lint problems are caught locally before they reach CI

    • Add 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.trapezoid over np.trapz and fix numpy to >= 2.0


v0.5.2 | GitHub release

TW 02/06/25

  • Bug fix: Ensure that plot_sources_on_sc employs the sensitivity curve settings that are saved in a Source class 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_sc to change the underlying sensitivity curve directly with sc_vis_settings


v0.4.6 | GitHub release

TW 13/04/23

  • Issue [#109] Upgrade numpy version
    • Upgrade required to avoid error in np.nan_to_num usage - thanks to Jakob Stegmann for raising this


v0.4.5 | GitHub release

TW 27/09/22

  • Change positions coordinate system to barycentric rather than heliocentric

  • Ensure theta is a co-latitude in amplitude_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 all sc_params as arguments for re-interpolation etc

    • Source.get_snr_stationary and Source.get_snr_evolving have the same parameters added as above

    • All functions in snr now take **kwargs that are passed directly to psd.power_spectral_density for 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_scale can now be used throughout plots
    • This additionally changes what the x and y labels are set to in Source.plot_source_variables :D

  • Issue [#99] y_label now automatically worked out for 1D plots from Source.plot_source_variables

  • Replaced two functions visualisation.plot_sources_on_sc_circ_stat and visualisation.plot_sources_on_sc_ecc_stat with a simpler visualisation.plot_sources_on_sc since there was no point in having two when we could just set f_dom=2 f_orb

  • Fix 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_g in favour of interpolating by default warning the user if they don’t have many samples

  • Issue [#76] Make it so that strain.h_0_n returns as unitless (same as source.Source.get_h_0_n). Same for snr functions.

  • Fixed an issue introduced in 0.2.0 where automated observation times didn’t work in visualisation.plot_sources_on_sc_circ_stat

  • Issue [#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_noise

    • Added 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 source and psd
    • 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

  • Bug fix: in visualisation avoid 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_psd to the sc_params in Source

  • Change the default parameters of Source.get_snr() to use sc_params


v0.1.3 | GitHub release

TW 16/11/21

  • Move determine_stationarity from utils to evol to avoid cyclical imports


v0.1.2 | GitHub release

TW 12/11/21

  • Change default values for small_e_tol and large_e_tol in get_t_merge_ecc

  • allow 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 Source and visualisation functions

  • allow user to customise sensitivity curve in any use of plot_sources_on_sc

  • legwork.__version__ now prints the version number

  • Add 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 snr module to allow the calculation of non-averaged SNR using exact inclination, sky position and polarisations

  • Let users specific inclination, sky position and polarisation in Source instantiation

  • Add VerificationBinaries class to Source module for convenient access to LISA verification binary data from Kupfer+18

  • Change 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

  • Add evolve_sources function 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 ret_snr2_by_harmonic to eccentric snr functions to allow the user to get the SNR at each harmonic separately instead of the total

  • Add 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