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

[pre-commit.ci] pre-commit autoupdate #1407

Merged
merged 3 commits into from
Mar 17, 2024
Merged
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
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
args: [--remove]

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.1
hooks:
- id: pyupgrade
types: [file]
Expand All @@ -36,15 +36,15 @@ repos:
types_or: [python, pyi]

- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.2.0
hooks:
- id: black
types: [file]
types_or: [python, pyi]
language_version: python3

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
types: [file]
Expand All @@ -59,7 +59,7 @@ repos:

# Notebook tools
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.7.1
hooks:
- id: nbstripout
args:
Expand All @@ -68,7 +68,7 @@ repos:
- "metadata.vscode metadata.language_info.version"

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
rev: 1.8.4
hooks:
- id: nbqa-black
additional_dependencies: [black==22.6.0]
Expand All @@ -92,7 +92,7 @@ repos:
additional_dependencies: [flake8-docstrings, flake8-print>=5.0.0]

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
name: "flake8 lint code"
Expand All @@ -104,7 +104,7 @@ repos:
- "--count"

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
alias: flake8-docs
Expand All @@ -116,7 +116,7 @@ repos:
additional_dependencies: [flake8-docstrings, darglint==1.8.0]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.9.0
hooks:
- id: mypy
exclude: "docs|benchmark/|.*/tests?/.*"
Expand Down
36 changes: 9 additions & 27 deletions benchmark/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,56 @@
// The version of the config file format. Do not change, unless
// you know what you are doing.
"version": 1,

// The name of the project being benchmarked
"project": "pyglotaran",

// The project's homepage
"project_url": "https://github.com/glotaran/pyglotaran",

// The URL or local path of the source code repository for the
// project being benchmarked
"repo": "..",

// The Python project's subdirectory in your repo. If missing or
// the empty string, the project is assumed to be located at the root
// of the repository.
// "repo_subdir": "",

// Customizable commands for building, installing, and
// uninstalling the project. See asv.conf.json documentation.
//
// "install_command": ["in-dir={env_dir} python -mpip install {wheel_file}"],
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
// "build_command": [
// "python setup.py build",
// "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
// ],

// FIX build command
// Ref.: https://github.com/airspeed-velocity/asv/issues/903#issuecomment-1276110657
"build_command": [
"python -m pip install build",
"python -m build --wheel -o {build_cache_dir} {build_dir}"
],
// List of branches to benchmark. If not provided, defaults to "master"
// (for git) or "default" (for mercurial).
"branches": ["HEAD"], // for git
"branches": [
"HEAD"
], // for git
// "branches": ["default"], // for mercurial

// The DVCS being used. If not set, it will be automatically
// determined from "repo" by looking at the protocol in the URL
// (if remote), or by looking for special directories, such as
// ".git" (if local).
"dvcs": "git",

// The tool to use to create environments. May be "conda",
// "virtualenv" or other value depending on the plugins in use.
// If missing or the empty string, the tool will be automatically
// determined by looking for tools on the PATH environment
// variable.
"environment_type": "virtualenv",

// timeout in seconds for installing any dependencies in environment
// defaults to 10 min
//"install_timeout": 600,

// the base URL to show a commit for the project.
"show_commit_url": "https://github.com/glotaran/pyglotaran/commit/",

// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
// "pythons": ["3.8", "3.9"],

// The list of conda channel names to be searched for benchmark
// dependency packages in the specified order
// "conda_channels": ["conda-forge", "defaults"],

// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
// list or empty string indicates to just test against the default
Expand All @@ -76,7 +67,6 @@
// "six": ["", null], // test with and without six installed
// "pip+emcee": [""], // emcee is only available for install with pip.
// },

// Combinations of libraries/python versions can be excluded/included
// from the set to test. Each entry is a dictionary containing additional
// key-value pairs to include/exclude.
Expand Down Expand Up @@ -109,31 +99,24 @@
// // additional env if run on windows+conda
// {"platform": "win32", "environment_type": "conda", "python": "2.7", "libpython": ""},
// ],

// The directory (relative to the current directory) that benchmarks are
// stored in. If not provided, defaults to "benchmarks"
// "benchmark_dir": "benchmarks",

// The directory (relative to the current directory) to cache the Python
// environments in. If not provided, defaults to "env"
"env_dir": ".asv/env",

// The directory (relative to the current directory) that raw benchmark
// results are stored in. If not provided, defaults to "results".
"results_dir": ".asv/results",

// The directory (relative to the current directory) that the html tree
// should be written to. If not provided, defaults to "html".
"html_dir": ".asv/html"

// The number of characters to retain in the commit hashes.
// "hash_length": 8,

// `asv` will cache results of the recent builds in each
// environment, making them faster to install next time. This is
// the number of builds to keep, per environment.
// "build_cache_size": 2,

// The commits after which the regression search in `asv publish`
// should start looking for regressions. Dictionary whose keys are
// regexps matching to benchmark names, and values corresponding to
Expand All @@ -146,7 +129,6 @@
// "some_benchmark": "352cdf", // Consider regressions only after this commit
// "another_benchmark": null, // Skip regression detection altogether
// },

// The thresholds for relative change in results, after which `asv
// publish` starts reporting regressions. Dictionary of the same
// form as in ``regressions_first_commits``, with values
Expand Down
1 change: 1 addition & 0 deletions docs/remove_notebook_written_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
If you use ``tox`` to run the tests (``tox`` or ``tox -e docs-notebooks``)
this script will be run before the tests.
"""

import shutil
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions glotaran/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Glotaran package root."""

from glotaran.deprecation.deprecation_utils import deprecate_submodule
from glotaran.plugin_system.base_registry import load_plugins

Expand Down
1 change: 1 addition & 0 deletions glotaran/analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This package contains functions for model simulation and fitting."""

from glotaran.deprecation.deprecation_utils import deprecate_submodule

simulation = deprecate_submodule(
Expand Down
1 change: 1 addition & 0 deletions glotaran/builtin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This package contains builtin plugins."""

from glotaran.deprecation.deprecation_utils import deprecate_submodule

read_data_file = deprecate_submodule(
Expand Down
1 change: 1 addition & 0 deletions glotaran/builtin/io/netCDF/netCDF.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module containing the NetCDF4 Data IO plugin."""

from __future__ import annotations

# Needed to prevent a netCDF4 RuntimeWarning at import time
Expand Down
1 change: 1 addition & 0 deletions glotaran/builtin/io/sdt/sdt_file_reader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module containing the SDT Data IO plugin."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions glotaran/builtin/io/yml/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utility module for ``glotaran.builtin.io.yml.yml``."""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions glotaran/builtin/io/yml/yml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module containing the YAML Data and Project IO plugins."""

from __future__ import annotations

from dataclasses import replace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This package contains the kinetic megacomplex item."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This package contains the decay megacomplex item."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This package contains the decay megacomplex item."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This package contains the initial concentration item."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion glotaran/builtin/megacomplexes/decay/irf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""This package contains irf items."""


import numpy as np

from glotaran.model import ModelError
Expand Down
1 change: 1 addition & 0 deletions glotaran/builtin/megacomplexes/decay/k_matrix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" K-Matrix """

from __future__ import annotations

import itertools
Expand Down
1 change: 1 addition & 0 deletions glotaran/deprecation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Deprecation helpers and place to put deprecated implementations till removing."""

from glotaran.deprecation.deprecation_utils import GlotaranApiDeprecationWarning
from glotaran.deprecation.deprecation_utils import GlotaranDeprecatedApiError
from glotaran.deprecation.deprecation_utils import deprecate
Expand Down
1 change: 1 addition & 0 deletions glotaran/deprecation/modules/builtin_io_yml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Deprecation functions for the yaml parser."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions glotaran/deprecation/modules/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Package with deprecation tests and helper functions."""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions glotaran/deprecation/modules/test/test_glotaran_root.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test deprecated imports from 'glotaran/__init__.py' """

from __future__ import annotations

from warnings import warn
Expand Down
1 change: 1 addition & 0 deletions glotaran/deprecation/test/dummy_package/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module containing a deprecated fake module."""

from glotaran.deprecation.deprecation_utils import deprecate_submodule

# just here to be tested
Expand Down
1 change: 1 addition & 0 deletions glotaran/io/prepare_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module containing dataset preparation functionality."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions glotaran/io/preprocessor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Tools for data pre-processing."""

from glotaran.io.preprocessor.pipeline import PreProcessingPipeline
1 change: 1 addition & 0 deletions glotaran/io/preprocessor/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A pre-processor pipeline for data."""

from __future__ import annotations

from typing import Annotated
Expand Down
1 change: 1 addition & 0 deletions glotaran/io/preprocessor/preprocessor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A pre-processor pipeline for data."""

from __future__ import annotations

import abc
Expand Down
1 change: 1 addition & 0 deletions glotaran/model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The glotaran model package."""

from glotaran.model.clp_constraint import OnlyConstraint
from glotaran.model.clp_constraint import ZeroConstraint
from glotaran.model.clp_penalties import EqualAreaPenalty
Expand Down
1 change: 1 addition & 0 deletions glotaran/model/clp_constraint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains clp constraint items."""

from __future__ import annotations

from glotaran.model.interval_item import IntervalItem
Expand Down
1 change: 1 addition & 0 deletions glotaran/model/clp_relation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains clp relation items."""

from __future__ import annotations

from glotaran.model.interval_item import IntervalItem
Expand Down
7 changes: 4 additions & 3 deletions glotaran/model/dataset_group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the dataset group."""

from __future__ import annotations

from collections.abc import Mapping
Expand All @@ -25,9 +26,9 @@
class DatasetGroupModel(ModelItem):
"""A group of datasets which will evaluated independently."""

residual_function: Literal[
"variable_projection", "non_negative_least_squares"
] = "variable_projection"
residual_function: Literal["variable_projection", "non_negative_least_squares"] = (
"variable_projection"
)
"""The residual function to use."""

link_clp: bool | None = None
Expand Down
1 change: 1 addition & 0 deletions glotaran/model/interval_item.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the interval item."""

from __future__ import annotations

from glotaran.model.item import Item
Expand Down
11 changes: 8 additions & 3 deletions glotaran/model/item.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the items."""

from __future__ import annotations

import contextlib
Expand Down Expand Up @@ -333,9 +334,13 @@ def iterate_names_and_labels(
yield name, v if isinstance(v, str) else (name, v.label) # type:ignore[misc]

else:
yield name, value if isinstance(value, str) else (
name,
value.label, # type:ignore[misc]
yield name, (
value
if isinstance(value, str)
else (
name,
value.label, # type:ignore[misc]
)
)


Expand Down
Loading
Loading