From 44ba3a328eacc35e1c3f4a996c4df4c55b3ca2da Mon Sep 17 00:00:00 2001 From: Jayden Personnat <89941534+jaydenpersonnat@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:37:42 -0400 Subject: [PATCH 1/7] fix stack deprecation warning --- endaq/batch/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/endaq/batch/core.py b/endaq/batch/core.py index 3596fc9..3993c12 100644 --- a/endaq/batch/core.py +++ b/endaq/batch/core.py @@ -208,7 +208,7 @@ def _make_peak_windows(ch_data_cache: analyzer.CalcCache, margin_len): # Format results result = ( - aligned_peak_data.stack() + aligned_peak_data.stack(future_stack=True) .stack() .reorder_levels(["axis", "peak time", "peak offset"]) ) From 1c798ddec4948268aecf79c4531cb07417d98e28 Mon Sep 17 00:00:00 2001 From: Jayden Personnat <89941534+jaydenpersonnat@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:54:43 -0400 Subject: [PATCH 2/7] fix future_stack error in core --- endaq/batch/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/endaq/batch/core.py b/endaq/batch/core.py index 3993c12..150e209 100644 --- a/endaq/batch/core.py +++ b/endaq/batch/core.py @@ -7,6 +7,7 @@ from functools import partial import warnings import os +import sys import numpy as np import pandas as pd @@ -206,9 +207,13 @@ def _make_peak_windows(ch_data_cache: analyzer.CalcCache, margin_len): ) ) + # minor version of python 3.x + minor_version = sys.version_info.minor + # Format results + # Use new implementation of future_stack if Python version >= 3.9 result = ( - aligned_peak_data.stack(future_stack=True) + aligned_peak_data.stack(future_stack=minor_version>=9) .stack() .reorder_levels(["axis", "peak time", "peak offset"]) ) From ae27e1b8c82da8358282593e385609ff5663eb44 Mon Sep 17 00:00:00 2001 From: Jayden Personnat <89941534+jaydenpersonnat@users.noreply.github.com> Date: Fri, 14 Jun 2024 10:01:12 -0400 Subject: [PATCH 3/7] try fixing future stack again --- endaq/batch/core.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/endaq/batch/core.py b/endaq/batch/core.py index 150e209..0d70c82 100644 --- a/endaq/batch/core.py +++ b/endaq/batch/core.py @@ -212,13 +212,11 @@ def _make_peak_windows(ch_data_cache: analyzer.CalcCache, margin_len): # Format results # Use new implementation of future_stack if Python version >= 3.9 - result = ( - aligned_peak_data.stack(future_stack=minor_version>=9) - .stack() - .reorder_levels(["axis", "peak time", "peak offset"]) - ) + levels = ["axis", "peak time", "peak offset"] + if minor_version < 9: + return aligned_peak_data.stack().stack().recorder_levels(levels) - return result + return aligned_peak_data.stack(future_stack=True).stack().reorder_levels(levels) def _make_vc_curves(ch_data_cache: analyzer.CalcCache): From 4b4d73ffb4415d45fab964b6f1dee05864eb9f08 Mon Sep 17 00:00:00 2001 From: Jayden Personnat <89941534+jaydenpersonnat@users.noreply.github.com> Date: Fri, 14 Jun 2024 10:07:53 -0400 Subject: [PATCH 4/7] fix typo --- endaq/batch/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/endaq/batch/core.py b/endaq/batch/core.py index 0d70c82..b34e0ca 100644 --- a/endaq/batch/core.py +++ b/endaq/batch/core.py @@ -214,7 +214,7 @@ def _make_peak_windows(ch_data_cache: analyzer.CalcCache, margin_len): # Use new implementation of future_stack if Python version >= 3.9 levels = ["axis", "peak time", "peak offset"] if minor_version < 9: - return aligned_peak_data.stack().stack().recorder_levels(levels) + return aligned_peak_data.stack().stack().reorder_levels(levels) return aligned_peak_data.stack(future_stack=True).stack().reorder_levels(levels) From ffad7aacd447d3a48560964345495d0a08470012 Mon Sep 17 00:00:00 2001 From: Jayden Personnat <89941534+jaydenpersonnat@users.noreply.github.com> Date: Fri, 14 Jun 2024 10:53:20 -0400 Subject: [PATCH 5/7] check for python<3.9 Co-authored-by: David Randall Stokes --- endaq/batch/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/endaq/batch/core.py b/endaq/batch/core.py index b34e0ca..3fd512c 100644 --- a/endaq/batch/core.py +++ b/endaq/batch/core.py @@ -213,7 +213,7 @@ def _make_peak_windows(ch_data_cache: analyzer.CalcCache, margin_len): # Format results # Use new implementation of future_stack if Python version >= 3.9 levels = ["axis", "peak time", "peak offset"] - if minor_version < 9: + if sys.version_info< (3, 9): return aligned_peak_data.stack().stack().reorder_levels(levels) return aligned_peak_data.stack(future_stack=True).stack().reorder_levels(levels) From fd491ef1177a62fe54a9af7339d4d4faf972537b Mon Sep 17 00:00:00 2001 From: Jayden Personnat <89941534+jaydenpersonnat@users.noreply.github.com> Date: Fri, 14 Jun 2024 10:53:57 -0400 Subject: [PATCH 6/7] rm unused var --- endaq/batch/core.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/endaq/batch/core.py b/endaq/batch/core.py index 3fd512c..bf80b1d 100644 --- a/endaq/batch/core.py +++ b/endaq/batch/core.py @@ -207,13 +207,10 @@ def _make_peak_windows(ch_data_cache: analyzer.CalcCache, margin_len): ) ) - # minor version of python 3.x - minor_version = sys.version_info.minor - # Format results # Use new implementation of future_stack if Python version >= 3.9 levels = ["axis", "peak time", "peak offset"] - if sys.version_info< (3, 9): + if sys.version_info < (3, 9): return aligned_peak_data.stack().stack().reorder_levels(levels) return aligned_peak_data.stack(future_stack=True).stack().reorder_levels(levels) From 08c620acc1e3ba78520218619d8446eb0955954e Mon Sep 17 00:00:00 2001 From: Jayden Personnat <89941534+jaydenpersonnat@users.noreply.github.com> Date: Fri, 14 Jun 2024 11:28:29 -0400 Subject: [PATCH 7/7] retry tests --- endaq/batch/core.py | 1 + 1 file changed, 1 insertion(+) diff --git a/endaq/batch/core.py b/endaq/batch/core.py index bf80b1d..d2a0494 100644 --- a/endaq/batch/core.py +++ b/endaq/batch/core.py @@ -208,6 +208,7 @@ def _make_peak_windows(ch_data_cache: analyzer.CalcCache, margin_len): ) # Format results + # Use new implementation of future_stack if Python version >= 3.9 levels = ["axis", "peak time", "peak offset"] if sys.version_info < (3, 9):