From 67658b01920bf1f19136b7a43eb9de74477270de Mon Sep 17 00:00:00 2001 From: Matteo Bachetti Date: Thu, 4 Jul 2024 22:01:50 +0200 Subject: [PATCH 1/3] Fix link in docs --- docs/acknowledgements.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/acknowledgements.rst b/docs/acknowledgements.rst index ba8bcc193..e6277171c 100644 --- a/docs/acknowledgements.rst +++ b/docs/acknowledgements.rst @@ -4,4 +4,4 @@ Acknowledgements Thank you to JetBrains for the free use of `PyCharm `_. -Stingray participated in the `Google Summer of Code `_ in 2018 and 2020 under `Open Astronomy `_, in 2017 under the `Python Software Foundation `_, and in 2016 under `Timelab `_. +Stingray participated in the `Google Summer of Code `_ in 2018, 2020, 2021, 2022, 2023, 2024 under `Open Astronomy `_, in 2017 under the `Python Software Foundation `_, and in 2016 under Timelab. From d05b341481b4e98f2aaee5a78771c06564fe2e76 Mon Sep 17 00:00:00 2001 From: Matteo Bachetti Date: Thu, 4 Jul 2024 22:14:43 +0200 Subject: [PATCH 2/3] Fix link to versioning on Zenodo --- docs/citing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/citing.rst b/docs/citing.rst index 6d23f5091..13c27e343 100644 --- a/docs/citing.rst +++ b/docs/citing.rst @@ -12,7 +12,7 @@ If possible, we ask that you cite a DOI corresponding to the specific version of .. include:: _zenodo.rst -If this isn't possible — for example, because you worked with an unreleased version of the code — you can cite Stingray's `concept DOI `__, `10.5281/zenodo.1490116 `__ (`BibTeX `__), which will always resolve to the latest release. +If this isn't possible — for example, because you worked with an unreleased version of the code — you can cite Stingray's `concept DOI `__, `10.5281/zenodo.1490116 `__ (`BibTeX `__), which will always resolve to the latest release. Papers ====== From 35446435e7a59f82527fd0700088e21967dc938b Mon Sep 17 00:00:00 2001 From: Matteo Bachetti Date: Fri, 5 Jul 2024 08:50:53 +0200 Subject: [PATCH 3/3] Use new integration function from Numpy 2.0.0 on --- stingray/multitaper.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stingray/multitaper.py b/stingray/multitaper.py index 6de5bfab7..3d93f5d91 100644 --- a/stingray/multitaper.py +++ b/stingray/multitaper.py @@ -16,6 +16,12 @@ from .lightcurve import Lightcurve from .utils import rebin_data, simon, fft, rfft, rfftfreq +try: + integration_func = np.trapezoid +except AttributeError: + # < Numpy 2.0.0 + integration_func = np.trapz + __all__ = ["Multitaper"] # Inspired from nitime (https://nipy.org/nitime/) @@ -460,7 +466,7 @@ def _get_adaptive_psd(self, freq_response, eigvals, max_iter=150): psd_est = self.psd_from_freq_response(freq_response, sqrt_eigvals[:, np.newaxis]) - var = np.trapz(psd_est, dx=np.pi / n_freqs) / (2 * np.pi) + var = integration_func(psd_est, dx=np.pi / n_freqs) / (2 * np.pi) del psd_est psd = np.empty(n_freqs)