From 8120e32285ed8d4a63962e6e09d3e6d91f52acc9 Mon Sep 17 00:00:00 2001 From: Marc Weitz Date: Tue, 3 Dec 2024 10:18:28 +0100 Subject: [PATCH] fixes DeprecationWarnings --- paat/__init__.py | 4 +--- paat/features.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/paat/__init__.py b/paat/__init__.py index 60cd1a7..37d6635 100644 --- a/paat/__init__.py +++ b/paat/__init__.py @@ -22,7 +22,6 @@ import platform from importlib import metadata -from pip._vendor import pkg_resources import toml from . import estimates, features, io, preprocessing, sleep, wear_time @@ -46,8 +45,7 @@ def sysinfo(): """ Prints system the dependency information """ - paat = pkg_resources.working_set.by_key["paat"] - dependencies = [requirement.project_name for requirement in paat.requires()] + dependencies = [dep.split(" ")[0] for dep in metadata.requires("paat")] header = ("PAAT Information\n" "=================\n\n") diff --git a/paat/features.py b/paat/features.py index 1e9348c..e7b8755 100644 --- a/paat/features.py +++ b/paat/features.py @@ -317,6 +317,6 @@ def calculate_actigraph_counts(data, sample_freq, epoch_length): sec_per_epoch = pd.Timedelta(epoch_length).seconds counts = get_counts(data[["Y", "X", "Z"]].values, sample_freq, sec_per_epoch) - index = data.resample(epoch_length).mean().index + index = data.resample(epoch_length).mean(numeric_only=True).index counts = pd.DataFrame(counts, columns=["Y", "X", "Z"], index=index[:len(counts)]) return counts