Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix stack deprecation warning #225

Merged
merged 7 commits into from
Jun 14, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 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 @@ -206,14 +207,16 @@ 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
result = (
aligned_peak_data.stack()
.stack()
.reorder_levels(["axis", "peak time", "peak offset"])
)
# Use new implementation of future_stack if Python version >= 3.9
levels = ["axis", "peak time", "peak offset"]
if minor_version < 9:
jaydenpersonnat marked this conversation as resolved.
Show resolved Hide resolved
return aligned_peak_data.stack().stack().reorder_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):
Expand Down
Loading