From 0d2f6192d95aae12e4d77c3361998d8de846bda2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:57:25 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/figures-gen/make-cpd-movie.ipynb | 32 +++++++++---------- .../00-Introducing-dupin/00-index.ipynb | 8 ++--- .../01-basic-approach.ipynb | 4 +-- .../02-data-pipeline.ipynb | 18 +++++------ .../03-collecting-data.ipynb | 26 +++++++-------- .../04-feature-selection.ipynb | 20 ++++++------ dupin/data/__init__.py | 1 + dupin/data/aggregate.py | 1 - dupin/preprocessing/__init__.py | 1 + dupin/preprocessing/supervised.py | 2 +- tests/data/test_reduce.py | 6 ++-- tests/detect/test_costs.py | 12 +++---- 12 files changed, 66 insertions(+), 65 deletions(-) diff --git a/docs/figures-gen/make-cpd-movie.ipynb b/docs/figures-gen/make-cpd-movie.ipynb index e2876fd..a3c5d9f 100644 --- a/docs/figures-gen/make-cpd-movie.ipynb +++ b/docs/figures-gen/make-cpd-movie.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ee8310a4-8773-4d81-b57e-723e97f14104", + "id": "0", "metadata": {}, "source": [ "## Create movies of detection" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": 1, - "id": "4feeba70-0dfc-43d7-8483-7e747bbc67dd", + "id": "1", "metadata": { "tags": [] }, @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "de80b833-363c-4fe1-b803-922b3c5a27b2", + "id": "2", "metadata": { "tags": [] }, @@ -44,7 +44,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "06187197-0d28-4437-96f4-afefa9308689", + "id": "3", "metadata": { "tags": [] }, @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": 6, - "id": "456e495f-966d-42cf-b39f-379911b6653d", + "id": "4", "metadata": { "tags": [] }, @@ -81,7 +81,7 @@ { "cell_type": "code", "execution_count": 7, - "id": "7a86d907-669c-42e8-83d8-7dfe5b1807ec", + "id": "5", "metadata": { "tags": [] }, @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "ebe8e317-3026-4269-9e7d-6bb010db03a3", + "id": "6", "metadata": {}, "source": [ "## Signal" @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": 8, - "id": "6006509d-f8e0-4f6f-a46b-ad7c3c90e31c", + "id": "7", "metadata": { "tags": [] }, @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": 9, - "id": "1d2f37f2-2839-4fd2-9bf5-b96887ce6ef1", + "id": "8", "metadata": { "tags": [] }, @@ -203,7 +203,7 @@ { "cell_type": "code", "execution_count": 10, - "id": "7145918a-dfe4-41ea-9fcd-c7d2bf4cd319", + "id": "9", "metadata": { "tags": [] }, @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "1a6d741a-3d61-4017-b400-641ffb7d2c2a", + "id": "10", "metadata": {}, "source": [ "## System" @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "4acd28ab-9395-4bd3-bf57-d01e841ddf66", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": 42, - "id": "f0a24221-7aa4-4f57-9b7d-de7efaed61b5", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -315,7 +315,7 @@ { "cell_type": "code", "execution_count": 43, - "id": "8d75f1c6-9b84-4703-b870-ca8e4330d9ab", + "id": "13", "metadata": {}, "outputs": [ { @@ -370,7 +370,7 @@ { "cell_type": "code", "execution_count": 39, - "id": "e08a88b6-8838-456a-b650-cdf098c280a0", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -380,7 +380,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72edc292-c175-4887-9cac-fdfea7c29be7", + "id": "15", "metadata": {}, "outputs": [], "source": [] diff --git a/docs/tutorials/00-Introducing-dupin/00-index.ipynb b/docs/tutorials/00-Introducing-dupin/00-index.ipynb index 752eac9..69ca819 100644 --- a/docs/tutorials/00-Introducing-dupin/00-index.ipynb +++ b/docs/tutorials/00-Introducing-dupin/00-index.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "184036df-6227-4dd6-8558-b4a97b95f579", + "id": "0", "metadata": {}, "source": [ "# Introducting dupin\n", @@ -17,7 +17,7 @@ }, { "cell_type": "markdown", - "id": "178a8387-9138-499a-92c0-93ef15c98505", + "id": "1", "metadata": { "nbsphinx-toctree": { "maxdepth": 1 @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "925f0eb1-baa0-44f1-96fc-4c48acc02ad4", + "id": "2", "metadata": { "tags": [] }, @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "23be74a3-d26d-4b70-ad4c-827c433bc16c", + "id": "3", "metadata": { "nbsphinx": "hidden", "tags": [] diff --git a/docs/tutorials/00-Introducing-dupin/01-basic-approach.ipynb b/docs/tutorials/00-Introducing-dupin/01-basic-approach.ipynb index dfe38cf..536a8de 100644 --- a/docs/tutorials/00-Introducing-dupin/01-basic-approach.ipynb +++ b/docs/tutorials/00-Introducing-dupin/01-basic-approach.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f1ebdc87-7048-4d26-b592-3920cc8fc0cc", + "id": "0", "metadata": {}, "source": [ "# Basic Approach\n", @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "34e9a7d8-10c0-418a-a0c6-8fb41654eebd", + "id": "1", "metadata": { "nbsphinx": "hidden", "tags": [] diff --git a/docs/tutorials/00-Introducing-dupin/02-data-pipeline.ipynb b/docs/tutorials/00-Introducing-dupin/02-data-pipeline.ipynb index f0548f1..ec9aea5 100644 --- a/docs/tutorials/00-Introducing-dupin/02-data-pipeline.ipynb +++ b/docs/tutorials/00-Introducing-dupin/02-data-pipeline.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cd783fa3-301a-48fa-8995-8668b4455366", + "id": "0", "metadata": {}, "source": [ "# Setting up a Data Pipeline\n", @@ -23,7 +23,7 @@ { "cell_type": "code", "execution_count": 1, - "id": "b9f4d0e9-ae52-407f-8296-6e928489c561", + "id": "1", "metadata": { "tags": [] }, @@ -36,7 +36,7 @@ }, { "cell_type": "markdown", - "id": "0f3a757b-1626-449d-821d-4f0f99b21c3a", + "id": "2", "metadata": {}, "source": [ "## The data module\n", @@ -68,7 +68,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "a124fb81-2a90-4c54-b003-b5a103aba6b9", + "id": "3", "metadata": { "tags": [] }, @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "9f5d4c75-e671-4625-975a-29114c405555", + "id": "4", "metadata": {}, "source": [ "## Builder syntax\n", @@ -106,7 +106,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "b96ac587-d12d-426b-81ee-888f8333cd75", + "id": "5", "metadata": { "tags": [] }, @@ -121,7 +121,7 @@ }, { "cell_type": "markdown", - "id": "52078405-31ea-4510-96f1-bdfb89f560f7", + "id": "6", "metadata": {}, "source": [ "## Reducers\n", @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": 4, - "id": "70e38008-9dc0-47a5-8c90-ab2707ee907f", + "id": "7", "metadata": { "tags": [] }, @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "39fee380-029a-493a-b95a-1d597348cec2", + "id": "8", "metadata": { "nbsphinx": "hidden", "tags": [] diff --git a/docs/tutorials/00-Introducing-dupin/03-collecting-data.ipynb b/docs/tutorials/00-Introducing-dupin/03-collecting-data.ipynb index 372427a..50c4ad1 100644 --- a/docs/tutorials/00-Introducing-dupin/03-collecting-data.ipynb +++ b/docs/tutorials/00-Introducing-dupin/03-collecting-data.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7eca3b5b-2026-4fa4-9eb9-891a07055927", + "id": "0", "metadata": {}, "source": [ "# Collecting Data\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": 1, - "id": "3b4c6b84-e2e3-4869-90b0-8a16e6f39e18", + "id": "1", "metadata": { "tags": [] }, @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "1595ac4a-3278-4b0f-a185-561f955c3ca5", + "id": "2", "metadata": { "tags": [] }, @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "fb1af1f7-b24b-4747-81cd-fbe2eb12615d", + "id": "3", "metadata": {}, "source": [ "## Create the generator\n", @@ -75,7 +75,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "d77d099e-eb0b-4d7b-b7e9-3501d49c1ae7", + "id": "4", "metadata": { "tags": [] }, @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "e13339b0-264c-4cf5-92d4-8c2700ddef29", + "id": "5", "metadata": {}, "source": [ "## Calling the Generator\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": 4, - "id": "8227e5f2-1bf4-48ab-a090-3a6a58e7292a", + "id": "6", "metadata": { "tags": [] }, @@ -156,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "f59b9b57-ea42-4f04-aa86-2f837a60be2a", + "id": "7", "metadata": {}, "source": [ "## Data Collection\n", @@ -169,7 +169,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "523397bd-09d6-4eea-bf3b-56c57ac4fe05", + "id": "8", "metadata": { "tags": [] }, @@ -180,7 +180,7 @@ }, { "cell_type": "markdown", - "id": "ab8de7f3-8606-4ef4-b4f5-17326a4d4f5b", + "id": "9", "metadata": {}, "source": [ "For this tutorial, we will use the `accumulate` method which is a bit simpler to use than `compute`.\n", @@ -194,7 +194,7 @@ { "cell_type": "code", "execution_count": 6, - "id": "79ab0a54-5d5c-4628-868f-4ad41e3ff482", + "id": "10", "metadata": { "tags": [] }, @@ -402,7 +402,7 @@ }, { "cell_type": "markdown", - "id": "9442fb14-6f3d-4c96-866f-496caba41b9d", + "id": "11", "metadata": {}, "source": [ "Now we have finished the event detection method to the fourth step, aggregate.\n", @@ -411,7 +411,7 @@ }, { "cell_type": "markdown", - "id": "649bb67e-3375-4d38-ae42-69e9be470b25", + "id": "12", "metadata": { "nbsphinx": "hidden", "tags": [] diff --git a/docs/tutorials/00-Introducing-dupin/04-feature-selection.ipynb b/docs/tutorials/00-Introducing-dupin/04-feature-selection.ipynb index 56c51c0..c0b67f6 100644 --- a/docs/tutorials/00-Introducing-dupin/04-feature-selection.ipynb +++ b/docs/tutorials/00-Introducing-dupin/04-feature-selection.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "6afc22f4-9b50-4950-b295-f6e66b69ac85", + "id": "0", "metadata": {}, "source": [ "# Feature Selection\n", @@ -22,7 +22,7 @@ { "cell_type": "code", "execution_count": 1, - "id": "5fae379d-9e27-4900-958c-59cdf293e2b5", + "id": "1", "metadata": { "tags": [] }, @@ -38,7 +38,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "eb984473-340d-406a-b4b3-ebafa2ab1a10", + "id": "2", "metadata": { "tags": [] }, @@ -63,7 +63,7 @@ }, { "cell_type": "markdown", - "id": "b2e9607d-a29f-47bd-8c76-c8df460ba257", + "id": "3", "metadata": {}, "source": [ "## Load the Data\n", @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "2784f8d4-6bbc-451c-8e6c-b905aec86e5e", + "id": "4", "metadata": { "tags": [] }, @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "df66e067-55e3-4285-935a-8e59154b8933", + "id": "5", "metadata": {}, "source": [ "## Transforming the Signal\n", @@ -122,7 +122,7 @@ { "cell_type": "code", "execution_count": 4, - "id": "ecb3769d-af52-4cd8-928a-eb123f0edeb9", + "id": "6", "metadata": { "tags": [] }, @@ -309,7 +309,7 @@ }, { "cell_type": "markdown", - "id": "3fb9382e-4287-4a45-a322-393f19dfd1f0", + "id": "7", "metadata": {}, "source": [ "In this particular case the number of features remains roughly the same as most of our features underwent a mean shift through the nucleation process.\n", @@ -319,7 +319,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "504ee8f5-236f-4f12-8e0c-4149e9a2ae14", + "id": "8", "metadata": { "tags": [] }, @@ -330,7 +330,7 @@ }, { "cell_type": "markdown", - "id": "f0a22da1-6f74-4114-9e93-9cec23788e50", + "id": "9", "metadata": { "nbsphinx": "hidden", "tags": [] diff --git a/dupin/data/__init__.py b/dupin/data/__init__.py index 21eca38..39a6843 100644 --- a/dupin/data/__init__.py +++ b/dupin/data/__init__.py @@ -59,6 +59,7 @@ def generator(): pass """ + from . import aggregate, base, freud, logging, map, reduce, spatial from .base import make_generator diff --git a/dupin/data/aggregate.py b/dupin/data/aggregate.py index 5addc25..0ebee25 100644 --- a/dupin/data/aggregate.py +++ b/dupin/data/aggregate.py @@ -4,7 +4,6 @@ provides methods for storing the output across a trajectory. """ - from collections.abc import Iterator from typing import Any, Optional diff --git a/dupin/preprocessing/__init__.py b/dupin/preprocessing/__init__.py index adc8f53..451312f 100644 --- a/dupin/preprocessing/__init__.py +++ b/dupin/preprocessing/__init__.py @@ -3,6 +3,7 @@ This module provides resources for the transformation step of the event detection pipeline. """ + from . import filter, signal, supervised __all__ = ("filter", "signal", "supervised") diff --git a/dupin/preprocessing/supervised.py b/dupin/preprocessing/supervised.py index ca9f203..05a689a 100644 --- a/dupin/preprocessing/supervised.py +++ b/dupin/preprocessing/supervised.py @@ -172,7 +172,7 @@ def test_size(self): @test_size.setter def test_size(self, value): - if value <= 0.0 or value >= 1.0: # noqa: PLR2004 + if value <= 0.0 or value >= 1.0: msg = "test_size must be between 0 and 1." raise ValueError(msg) self._test_size = value diff --git a/tests/data/test_reduce.py b/tests/data/test_reduce.py index 3e4d77f..143a4bc 100644 --- a/tests/data/test_reduce.py +++ b/tests/data/test_reduce.py @@ -304,9 +304,9 @@ def validate_logger(cls, instance, input_, output, logger): class CustomReducerValidator: - cls: typing.ClassVar[ - du.data.base.DataReducer - ] = du.data.reduce.CustomReducer + cls: typing.ClassVar[du.data.base.DataReducer] = ( + du.data.reduce.CustomReducer + ) constructor_args: typing.ClassVar[dict[str, typing.Any]] = { "custom_function": lambda d: {"first": d[0]} } diff --git a/tests/detect/test_costs.py b/tests/detect/test_costs.py index 523f625..e1efc6b 100644 --- a/tests/detect/test_costs.py +++ b/tests/detect/test_costs.py @@ -53,9 +53,9 @@ def test_error(self, perfect_signal): class TestLinearCost(BaseCostLinearTest): - cls: typing.ClassVar[ - du.detect.costs.BaseLinearCost - ] = du.detect.costs.CostLinearFit + cls: typing.ClassVar[du.detect.costs.BaseLinearCost] = ( + du.detect.costs.CostLinearFit + ) additional_constants: typing.ClassVar[dict[str, typing.Any]] = { "model": "linear_regression" } @@ -76,9 +76,9 @@ def test_error_noise(self, rng, perfect_signal): class TestBiasedCost(BaseCostLinearTest): - cls: typing.ClassVar[ - du.detect.costs.BaseLinearCost - ] = du.detect.costs.CostLinearBiasedFit + cls: typing.ClassVar[du.detect.costs.BaseLinearCost] = ( + du.detect.costs.CostLinearBiasedFit + ) additional_constants: typing.ClassVar[dict[str, typing.Any]] = { "model": "biased_linear_regression" }