From 7d5c6e40fc8bf7107702c3e8a0c1babf0f7409b1 Mon Sep 17 00:00:00 2001 From: MartinMohrmann Date: Thu, 11 Apr 2024 10:50:10 +0200 Subject: [PATCH] update environment --- .pre-commit-config.yaml | 10 +++++----- glidertools/cleaning.py | 4 +--- glidertools/utils.py | 6 +++--- setup.cfg | 1 + 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 863e698..640a791 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: check-ast @@ -10,14 +10,14 @@ repos: - id: check-added-large-files - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + rev: 7.0.0 hooks: - id: flake8 args: ["--max-line-length=105", "--select=C,E,F,W,B,B950", "--ignore=E203,E501,W503"] exclude: docs/source/conf.py -- repo: https://github.com/pre-commit/mirrors-isort - rev: v5.10.1 +- repo: https://github.com/PyCQA/isort + rev: 5.13.2 hooks: - id: isort additional_dependencies: [toml] @@ -29,7 +29,7 @@ repos: - id: seed-isort-config - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 24.3.0 hooks: - id: black language_version: python3 diff --git a/glidertools/cleaning.py b/glidertools/cleaning.py index 33ddbb9..b381f06 100644 --- a/glidertools/cleaning.py +++ b/glidertools/cleaning.py @@ -711,9 +711,7 @@ def savitzky_golay(var, window_size, order, deriv=0, rate=1, interpolate=True): y = array(arr) # precompute coefficients - b = mat( - [[k**i for i in order_range] for k in range(-half_window, half_window + 1)] - ) + b = mat([[k**i for i in order_range] for k in range(-half_window, half_window + 1)]) m = linalg.pinv(b).A[deriv] * rate**deriv * factorial(deriv) # pad the signal at the extremes with # values taken from the signal itself diff --git a/glidertools/utils.py b/glidertools/utils.py index bc42fdd..ba53240 100644 --- a/glidertools/utils.py +++ b/glidertools/utils.py @@ -261,9 +261,9 @@ def calc_dive_phase(time, depth, dive_depth_threshold=15): phase[velocity > 0.5] = 1 # down dive phase[velocity < -0.5] = 4 # up dive - phase[ - (depth > dive_depth_threshold) & (velocity >= -0.5) & (velocity <= 0.5) - ] = 3 # inflexion + phase[(depth > dive_depth_threshold) & (velocity >= -0.5) & (velocity <= 0.5)] = ( + 3 # inflexion + ) phase[depth <= dive_depth_threshold] = 0 # surface drift phase[isnan(phase)] = 6 phase = phase.astype(int) diff --git a/setup.cfg b/setup.cfg index d3d6df0..325ff3a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -67,6 +67,7 @@ classifiers = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 ## Add your email here author_email = "lukegre@gmail.com"