From b859f480dbb094002c979aeeee2f9c7485cdfc69 Mon Sep 17 00:00:00 2001 From: Mohammad Mohseni Aref Date: Mon, 13 Mar 2023 02:53:55 +0100 Subject: [PATCH 1/3] Replace clock with time due to new update for time package Replace clock with time due to new update for time package --- JUST_PythonPackage_EGhaderpour/ALLSSA.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JUST_PythonPackage_EGhaderpour/ALLSSA.py b/JUST_PythonPackage_EGhaderpour/ALLSSA.py index 49c8cf6..f15bd10 100644 --- a/JUST_PythonPackage_EGhaderpour/ALLSSA.py +++ b/JUST_PythonPackage_EGhaderpour/ALLSSA.py @@ -211,10 +211,10 @@ def ALLSSA(t, f, P = 1, Omega = [], ind = [], level = 0.01, t0 = t - t[0] # For the sake of computational efficiency - tic = time.clock() + tic = time.time() Results = ALLSSA(t0, f, P = P, Omega = Omega, ind = args.ind, level = args.level, trend = args.trend, slope = args.slope, decimal = args.decimal) - toc = time.clock() + toc = time.time() print("Computational Time: ", round(toc-tic,2), "s") freq = Results[5] print("The ALLSSA estimated cyclic frequencies:", freq) From e9692ec56f55e07eb34cddfc83e1ebf06a9f5b7c Mon Sep 17 00:00:00 2001 From: Mohammad Mohseni Aref Date: Mon, 13 Mar 2023 03:10:35 +0100 Subject: [PATCH 2/3] Update time.clock and a minor modification updated time.clock() to time.time() new function and set int for example to work correctly --- JUST_PythonPackage_EGhaderpour/JUSTdecompose.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/JUST_PythonPackage_EGhaderpour/JUSTdecompose.py b/JUST_PythonPackage_EGhaderpour/JUSTdecompose.py index a8ccaa8..fda756a 100644 --- a/JUST_PythonPackage_EGhaderpour/JUSTdecompose.py +++ b/JUST_PythonPackage_EGhaderpour/JUSTdecompose.py @@ -384,18 +384,18 @@ def PlotDecompose (t, f, P, trend, seasonal, remainder, elif Dim[1] == Dim[0] + 2: P = tfP[:,2:] else: P = 1 - if args.Numtime > 0: tt = np.linspace(t[0], t[len(t)-1], args.Numtime) + if args.Numtime > 0: tt = np.linspace(t[0], t[len(t)-1], int(args.Numtime)) else: tt = [] if args.Ufreq > 0 and args.Numfreq > 0: Omega = np.linspace(args.Lfreq, args.Ufreq, args.Numfreq) else: Omega = [] - tic = time.clock() + tic = time.time() Results = JUSTdecompose(t, f, P = P, tt = tt, size = args.size, step = args.step, season = args.season, Omega = Omega, ind = args.ind, level = args.level) - toc = time.clock() + toc = time.time() print("Computational Time: ", round(toc-tic,2), "s") # Save the results as .csv @@ -417,4 +417,4 @@ def PlotDecompose (t, f, P, trend, seasonal, remainder, - \ No newline at end of file + From 36c3c101a187fbb78f8cf9bbfdd9284b00d95868 Mon Sep 17 00:00:00 2001 From: Mohammad Mohseni Aref Date: Mon, 13 Mar 2023 03:28:51 +0100 Subject: [PATCH 3/3] time.clock() update and int modification time.clock() update and int modification --- JUST_PythonPackage_EGhaderpour/LSWA.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/JUST_PythonPackage_EGhaderpour/LSWA.py b/JUST_PythonPackage_EGhaderpour/LSWA.py index 804c98a..ed047e6 100644 --- a/JUST_PythonPackage_EGhaderpour/LSWA.py +++ b/JUST_PythonPackage_EGhaderpour/LSWA.py @@ -306,22 +306,22 @@ def PlotSpectrogram (t, f, tt, Omega, spectrogram, stoch_surf, amp_spectrogram, else: Ltim = args.Ltime if args.Utime == 0: Utim = t[len(t)-1] else: Utim = args.Utime - tt = np.linspace(Ltim, Utim, args.Numtime) + tt = np.linspace(Ltim, Utim,int(args.Numtime)) else: tt = [] if args.Ufreq > 0 and args.Numfreq > 0: - Omega = np.linspace(args.Lfreq, args.Ufreq, args.Numfreq) + Omega = np.linspace(args.Lfreq, args.Ufreq,int(args.Numfreq)) else: Omega = [] t0 = t - t[0] # For the sake of computational efficiency if len(tt) > 0: tt0 = tt - t[0] # For the sake of computational efficiency else: tt0 = [] - tic = time.clock() + tic = time.time() Results = LSWA(t0, f, P = P, tt = tt0, rate = args.rate, Omega = Omega, ind = args.ind, level = args.level, trend = args.trend, slope = args.slope, freq = args.freq, L1 = args.L1, L0 = args.L0, morlet = args.morlet) - toc = time.clock() + toc = time.time() print("Computational Time: ", round(toc-tic,2), "s") # Select larger window size parameters (e.g., L0 = 5) if you got the following error: # 'The size of the time series (segment) is too small!' @@ -345,4 +345,4 @@ def PlotSpectrogram (t, f, tt, Omega, spectrogram, stoch_surf, amp_spectrogram, amp_spectrogram, args.display) - \ No newline at end of file +