Skip to content
Open
Show file tree
Hide file tree
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
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: check-added-large-files
args: ["--maxkb=1000"]
Expand All @@ -24,32 +24,32 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.15.10
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
types_or: [python, pyi, jupyter]

- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 8.0.1
hooks:
- id: isort
name: isort

- repo: https://github.com/psf/black
rev: 24.4.2
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
hooks:
- id: black
language_version: python3

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
rev: 1.20.0
hooks:
- id: blacken-docs
additional_dependencies: [black==22.3.0]

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.3.0
hooks:
- id: flake8
exclude: docs/source/conf.py, __pycache__
Expand All @@ -66,7 +66,7 @@ repos:
]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.20.1
hooks:
- id: mypy
files: predictably/
Expand All @@ -85,29 +85,29 @@ repos:
additional_dependencies: [".[toml]"]

- repo: https://github.com/PyCQA/bandit
rev: 1.7.8
rev: 1.9.4
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.2
hooks:
- id: codespell
types_or: [python, rst, markdown]
additional_dependencies:
- tomli

- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
rev: v2.0.0
hooks:
- id: doc8
args: ["--max-line-length=88", "--config=pyproject.toml", "docs"]
additional_dependencies: ["tomli"]

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.9.1
rev: v1.0.2
hooks:
- id: sphinx-lint

Expand All @@ -118,13 +118,13 @@ repos:
additional_dependencies: ["flake8-builtins"]

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.21.2
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/numpy/numpydoc
rev: v1.7.0
rev: v1.10.0
hooks:
- id: numpydoc-validation
exclude: |
Expand Down
1 change: 1 addition & 0 deletions predictably/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Predictable, well-documented interfaces so you can predict *ably*.
"""

from typing import List

from predictably._config import (
Expand Down
1 change: 1 addition & 0 deletions predictably/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

Allows users to configure `predictably`.
"""

import threading
from contextlib import contextmanager
from typing import Any, Dict, Iterator, List, Literal, Optional, get_args
Expand Down
1 change: 1 addition & 0 deletions predictably/_config_param_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Used to store information about predictably's global configuration.
"""

import collections
import warnings
from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions predictably/_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

These tools can be used to build other `predictably` compliant packages.
"""

from typing import List

__author__: List[str] = ["RNKuhns"]
Expand Down
1 change: 1 addition & 0 deletions predictably/_core/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

`predictably` classes typically inherit from ``BaseClass``.
"""

import collections
import inspect
import re
Expand Down
1 change: 1 addition & 0 deletions predictably/_core/_pprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

The approach follows scikit-learn conventions.
"""

from typing import List

__author__: List[str] = ["RNKuhns"]
Expand Down
7 changes: 2 additions & 5 deletions predictably/_core/_pprint/_object_html_repr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

Follows scikit-learn pretty printing conventions.
"""

# mypy: ignore-errors
from __future__ import annotations

Expand Down Expand Up @@ -343,11 +344,7 @@ def _write_base_object_html(
#$id div.sk-text-repr-fallback {
display: none;
}
""".replace(
" ", ""
).replace(
"\n", ""
)
""".replace(" ", "").replace("\n", "")


def _object_html_repr(base_object: prc._base.BaseOBject) -> str:
Expand Down
1 change: 1 addition & 0 deletions predictably/_core/_pprint/_pprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

The pretty printing approach very closely follows scikit-learn.
"""

# mypy: ignore-errors
import inspect
import pprint
Expand Down
1 change: 1 addition & 0 deletions predictably/_core/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Tests of core functionality are included here. Tests of specific submodule
functionality is included in submodule tests.
"""

from typing import List

__all__: List[str] = []
Expand Down
1 change: 1 addition & 0 deletions predictably/_core/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# The code is copyrighted by the respective scikit-learn developers (BSD-3-Clause
# License): https://github.com/scikit-learn/scikit-learn/blob/main/COPYING
"""Test configuration functionality."""

import time
from concurrent.futures import ThreadPoolExecutor
from typing import Any
Expand Down
1 change: 1 addition & 0 deletions predictably/_core/tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

test_exceptions_raise_error - Test that skbase exceptions raise expected error.
"""

from typing import List

import pytest
Expand Down
1 change: 1 addition & 0 deletions predictably/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
as examples throughout the package.
- :mod:`predictably.data.generate` provides tools for data generation.
"""

from typing import List

__author__: List[str] = ["RNKuhns"]
Expand Down
1 change: 1 addition & 0 deletions predictably/data/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
interface or the `from_array` and `from_dataframe` interface on a particular
data type class.
"""

from typing import List

from predictably.data.types._base import Metadata
Expand Down
1 change: 1 addition & 0 deletions predictably/data/types/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

All `predictably` data types should inherit from ``BasePredictablyDataType``.
"""

from __future__ import annotations

import collections
Expand Down
1 change: 1 addition & 0 deletions predictably/data/types/_cross_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
or `from_dataframe` methods or the ``predictably.from_external_data`` functional
interface.
"""

from __future__ import annotations

import attrs
Expand Down
1 change: 1 addition & 0 deletions predictably/data/types/_from_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Users should use :func:`predictably.from_external_data` or call the `from_array`
or `from_dataframe` on the applicable `predictably` data type.
"""

from __future__ import annotations

import sys
Expand Down
1 change: 1 addition & 0 deletions predictably/data/types/_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
or `from_dataframe` methods or the ``predictably.from_external_data`` functional
interface.
"""

from __future__ import annotations

import attrs
Expand Down
1 change: 1 addition & 0 deletions predictably/data/types/_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
or `from_dataframe` methods or the ``predictably.from_external_data`` functional
interface.
"""

from __future__ import annotations

import sys
Expand Down
7 changes: 4 additions & 3 deletions predictably/data/types/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Should be used for typing throughout `predictably`.
"""

from __future__ import annotations

import sys
Expand Down Expand Up @@ -104,7 +105,7 @@ def _get_forward_ref_module_name(fref: str, return_abbrev: bool = False) -> str:


def _evaluate_available_forward_refs(
supported: tuple[str | type, ...]
supported: tuple[str | type, ...],
) -> tuple[tuple[type, ...], tuple[str, ...]]:
"""Load and evaluate available forward references.

Expand Down Expand Up @@ -152,7 +153,7 @@ def _evaluate_available_forward_refs(


def _supported_type_msg(
type_: Literal["dataframe", "array", "any"] = "dataframe"
type_: Literal["dataframe", "array", "any"] = "dataframe",
) -> str:
"""Create message about the types of dataframes that `predictably` supports.

Expand Down Expand Up @@ -185,7 +186,7 @@ def _supported_type_msg(


def raise_not_supported_external_type(
type_: Literal["dataframe", "array", "any"] = "dataframe"
type_: Literal["dataframe", "array", "any"] = "dataframe",
) -> NoReturn:
"""Raise an error if the input data container is not supported by `predictably`.

Expand Down
1 change: 1 addition & 0 deletions predictably/data/types/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Tests for all data type functionality are included here.
"""

from typing import List

__all__: List[str] = []
Expand Down
1 change: 1 addition & 0 deletions predictably/data/types/tests/test_base_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Tests for all data type functionality are included here.
"""

import re
from typing import List

Expand Down
1 change: 1 addition & 0 deletions predictably/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Tests of core functionality are included here. Tests of specific submodule
functionality is included in submodule tests.
"""

from typing import List

__all__: List[str] = []
Expand Down
1 change: 1 addition & 0 deletions predictably/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# The code is copyrighted by the respective scikit-learn developers (BSD-3-Clause
# License): https://github.com/scikit-learn/scikit-learn/blob/main/COPYING
"""Test configuration functionality."""

import time
from concurrent.futures import ThreadPoolExecutor
from typing import Any
Expand Down
1 change: 1 addition & 0 deletions predictably/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
This module includes general utilities. Statistical utilities will be kept in
predictably.stats.utils.
"""

from typing import List

__author__: List[str] = ["RNKuhns"]
Expand Down
1 change: 1 addition & 0 deletions predictably/utils/_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# are copyrighted by the skbase developers, BSD-3-Clause License. For
# conditions see https://github.com/sktime/skbase/blob/main/LICENSE
"""Utility functionality for working with sequences.""" # numpydoc ignore=ES01

import collections
import re
from typing import Any, List, Optional, Sequence, Union
Expand Down
1 change: 1 addition & 0 deletions predictably/utils/tests/test_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- test_scalar_to_seq_raises: verify that _scalar_to_seq raises error when an
invalid value is provided for sequence_type parameter.
"""

from collections.abc import Sequence

import pytest
Expand Down
1 change: 1 addition & 0 deletions predictably/validate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
This module contains functions used throughout `predictably` to provide standard
validation of inputs to `predictably` methods and functions.
"""

from typing import List

from predictably.validate._named_objects import (
Expand Down
1 change: 1 addition & 0 deletions predictably/validate/_named_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
named objects conform with predictably's named object API. Among other use cases
this is used in particular to verify that input to pipelines are specified correctly.
"""

import collections.abc
from typing import (
TYPE_CHECKING,
Expand Down
1 change: 1 addition & 0 deletions predictably/validate/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
For specific functionality to validate the `predictably` data types, see
:mod:`predictably.validate._data_types`.
"""

import collections
import inspect
import math
Expand Down
1 change: 1 addition & 0 deletions predictably/validate/tests/test_type_validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- test_check_sequence_with_seq_of_class_and_instance_input
- test_convert_scalar_seq_type_input_to_tuple_raises_error
"""

import collections

# import numpy as np
Expand Down
Loading