From 34448de82fbd49f4bea574ae7ec9728e79cb8eb7 Mon Sep 17 00:00:00 2001 From: Julien Emile-Geay Date: Tue, 16 Sep 2025 15:32:08 -0700 Subject: [PATCH 1/7] new envt + fix docstring escape sequences pytest success with 3.11, 3.12 and 3.13 --- environment.yml | 6 +++--- pyleoclim/utils/spectral.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/environment.yml b/environment.yml index 2b88ead0..2be245b4 100644 --- a/environment.yml +++ b/environment.yml @@ -1,14 +1,14 @@ # Development environment. This environment includes all the required # packages for this repo including running the test suite. -name: pyleo +name: pyleo2025 channels: - default - conda-forge dependencies: - - python=3.11.0 + - python=3.13.0 - cartopy - numba - - scipy<1.16 + - scipy - pyyaml - requests - scikit-learn diff --git a/pyleoclim/utils/spectral.py b/pyleoclim/utils/spectral.py index e1f61d09..aff15577 100644 --- a/pyleoclim/utils/spectral.py +++ b/pyleoclim/utils/spectral.py @@ -1025,10 +1025,10 @@ def cwt_psd(ys, ts, freq=None, freq_method='log', freq_kwargs=None,scale = None, def beta_estimation(psd, freq, fmin=None, fmax=None, logf_binning_step='max', verbose=False): ''' Estimate the scaling exponent of a power spectral density. - Models the spectrum as :math: `S(f) \propto 1/f^{\beta}`. For instance: - - :math: `\beta = 0` corresponds to white noise - - :math: `\beta = 1` corresponds to pink noise - - :math: `\beta = 2` corresponds to red noise (Brownian motion) + Models the spectrum as :math: `S(f) \\propto 1/f^{\\beta}`. For instance: + - :math: `\\beta = 0` corresponds to white noise + - :math: `\\beta = 1` corresponds to pink noise + - :math: `\\beta = 2` corresponds to red noise (Brownian motion) Parameters @@ -1170,7 +1170,7 @@ def beta2Hurst(beta): Parameters ---------- beta : float - the estimated slope of a power spectral density :math: `S(f) \propto 1/f^{\beta}` + the estimated slope of a power spectral density :math: `S(f) \\propto 1/f^{\\beta}` Returns ------- From 12098f59ffa9294417e383e867de50c871c1ac1f Mon Sep 17 00:00:00 2001 From: Julien Emile-Geay Date: Tue, 16 Sep 2025 15:32:37 -0700 Subject: [PATCH 2/7] renamed pyleo --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 2be245b4..bc9e7871 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,6 @@ # Development environment. This environment includes all the required # packages for this repo including running the test suite. -name: pyleo2025 +name: pyleo channels: - default - conda-forge From 11296d6056db6ff1a7d578b4bff13617896c81cf Mon Sep 17 00:00:00 2001 From: Julien Emile-Geay Date: Tue, 16 Sep 2025 15:40:01 -0700 Subject: [PATCH 3/7] revert to 3.12 --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index bc9e7871..e4942577 100644 --- a/environment.yml +++ b/environment.yml @@ -5,7 +5,7 @@ channels: - default - conda-forge dependencies: - - python=3.13.0 + - python=3.12.0 - cartopy - numba - scipy From add1d2541f41ea2ade5ba3705fb99eede1f9aa9f Mon Sep 17 00:00:00 2001 From: Julien Emile-Geay Date: Wed, 17 Sep 2025 10:32:14 -0700 Subject: [PATCH 4/7] revert to Python 3.11 --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index e4942577..9c33c5b6 100644 --- a/environment.yml +++ b/environment.yml @@ -5,7 +5,7 @@ channels: - default - conda-forge dependencies: - - python=3.12.0 + - python=3.11.0 - cartopy - numba - scipy From e5709766c2514bad23a765e8c3f55dde53211e5e Mon Sep 17 00:00:00 2001 From: Julien Emile-Geay Date: Wed, 17 Sep 2025 11:55:58 -0700 Subject: [PATCH 5/7] latest scipy + harmonize across yml and toml --- environment.yml | 2 +- pyproject.toml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/environment.yml b/environment.yml index 9c33c5b6..eae9f429 100644 --- a/environment.yml +++ b/environment.yml @@ -18,8 +18,8 @@ dependencies: - tqdm - wget - pip - - pytest - pip: + - pytest - pyhht - dill - '-e .' diff --git a/pyproject.toml b/pyproject.toml index ed2aca4d..e4b5a517 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,17 +25,15 @@ dependencies = [ "seaborn>=0.13.0", "scikit-learn>=0.24.2", "pathos>=0.2.8", - "tqdm>=4.61.2", - "tftb>=0.1.3", + "tqdm", "wget>=3.2", "numba>=0.56", "nitime>=0.9", "tabulate>=0.8.9", - "Unidecode>=1.1.1", "cartopy>=0.22.0", "pyyaml", "beautifulsoup4", - "scipy<1.16.0", + "scipy>=1.15.0", "requests", "dill", ] From fd02cf45ba0a6880a6cfb514252bab8d6553e29c Mon Sep 17 00:00:00 2001 From: Julien Emile-Geay Date: Wed, 17 Sep 2025 11:57:48 -0700 Subject: [PATCH 6/7] Update environment.yml fix indentation --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index eae9f429..02a88e5e 100644 --- a/environment.yml +++ b/environment.yml @@ -19,7 +19,7 @@ dependencies: - wget - pip - pip: - - pytest + - pytest - pyhht - dill - '-e .' From 306c8e29024e753db9c9928deccc37f7430e2bdd Mon Sep 17 00:00:00 2001 From: Julien Emile-Geay Date: Wed, 17 Sep 2025 16:07:29 -0700 Subject: [PATCH 7/7] numpy updates np.NaN deprecated --> moved to np.nan --- pyleoclim/core/correns.py | 2 +- pyleoclim/utils/tsutils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyleoclim/core/correns.py b/pyleoclim/core/correns.py index 1653547c..a8830c55 100644 --- a/pyleoclim/core/correns.py +++ b/pyleoclim/core/correns.py @@ -202,7 +202,7 @@ def plot(self, figsize=[4, 4], title=None, ax=None, savefig_settings=None, hist_ # put everything into a dataframe to be able to use seaborn - data = np.empty((len(self.r),3)); data[:] = np.NaN + data = np.empty((len(self.r),3)); data[:] = np.nan col = [f'p < {self.alpha} (w/ FDR)',f'p < {self.alpha} (w/o FDR)', f'p ≥ {self.alpha}'] data[self.signif_fdr,0] = r_signif_fdr data[self.signif, 1] = r_signif diff --git a/pyleoclim/utils/tsutils.py b/pyleoclim/utils/tsutils.py index 740dcbb8..beaa0df6 100644 --- a/pyleoclim/utils/tsutils.py +++ b/pyleoclim/utils/tsutils.py @@ -1316,7 +1316,7 @@ def gaussianize(ys): # Create a blank copy of the array. yg = copy.deepcopy(ys) - yg[:] = np.NAN + yg[:] = np.nan nz = np.logical_not(np.isnan(ys)) index = np.argsort(ys[nz])