Skip to content

Commit

Permalink
Merge pull request #225 from MideTechnology/fix/deprecation-warnings
Browse files Browse the repository at this point in the history
fix stack deprecation warning
  • Loading branch information
jaydenpersonnat authored Jun 14, 2024
2 parents 89e5674 + 08c620a commit 42ee034
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions endaq/batch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from functools import partial
import warnings
import os
import sys

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -207,13 +208,13 @@ def _make_peak_windows(ch_data_cache: analyzer.CalcCache, margin_len):
)

# Format results
result = (
aligned_peak_data.stack()
.stack()
.reorder_levels(["axis", "peak time", "peak offset"])
)

return result
# Use new implementation of future_stack if Python version >= 3.9
levels = ["axis", "peak time", "peak offset"]
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)


def _make_vc_curves(ch_data_cache: analyzer.CalcCache):
Expand Down

0 comments on commit 42ee034

Please sign in to comment.