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 all 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
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 @@
)

# 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)

Check warning on line 217 in endaq/batch/core.py

View check run for this annotation

Codecov / codecov/patch

endaq/batch/core.py#L217

Added line #L217 was not covered by tests


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