diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4642426..859338e 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: "v5.0.0" + rev: "v6.0.0" hooks: - id: check-added-large-files exclude: ^docs/_static/k3d_(tesla|wr75)_example\.html$ @@ -26,18 +26,18 @@ repos: - id: trailing-whitespace types_or: [python, toml] - repo: https://github.com/asottile/pyupgrade - rev: v3.19.1 + rev: v3.22.0 hooks: - id: pyupgrade - repo: https://github.com/pycqa/isort # args set in pyproject.toml - rev: 6.0.1 + rev: 9.0.2 hooks: - id: isort name: isort (python) - id: isort name: isort (cython) types: [cython] - - repo: https://github.com/psf/black # args set in pyproject.toml - rev: 25.1.0 + - repo: https://github.com/psf/black-pre-commit-mirror # args set in pyproject.toml + rev: 26.10.1 hooks: - id: black diff --git a/release.py b/release.py index 091c9e7..9dce84e 100755 --- a/release.py +++ b/release.py @@ -8,6 +8,7 @@ python release.py """ + import re import subprocess import sys diff --git a/src/simultipac/simulation_results/simulations_results.py b/src/simultipac/simulation_results/simulations_results.py index aacd65c..a7d5b3d 100644 --- a/src/simultipac/simulation_results/simulations_results.py +++ b/src/simultipac/simulation_results/simulations_results.py @@ -228,7 +228,7 @@ def _to_plot( """ if to_plot is not None: - return [r for r in to_plot] + return [*to_plot] if id_to_plot is not None: return [self.get_by_id(id) for id in id_to_plot] if idx_to_plot is None: diff --git a/src/simultipac/util/log_manager.py b/src/simultipac/util/log_manager.py index ca1fe2b..76cabe5 100755 --- a/src/simultipac/util/log_manager.py +++ b/src/simultipac/util/log_manager.py @@ -12,6 +12,7 @@ https://en.wikipedia.org/wiki/ANSI_escape_code#Colors """ + import logging import subprocess import sys diff --git a/tests/simulation_results/test_simulations_results.py b/tests/simulation_results/test_simulations_results.py index a60d508..80b5537 100644 --- a/tests/simulation_results/test_simulations_results.py +++ b/tests/simulation_results/test_simulations_results.py @@ -117,7 +117,7 @@ def test_to_pandas() -> None: returned = SimulationsResults(results)._to_pandas("id", "e_acc") expected = pd.DataFrame( { - "id": [i for i in range(n_points)], + "id": [*range(n_points)], "e_acc": [i**2 for i in range(n_points)], } ) @@ -139,7 +139,7 @@ def test_to_pandas_with_exp_growth_params() -> None: returned = SimulationsResults(results)._to_pandas("id", "alpha") expected = pd.DataFrame( { - "id": [i for i in range(n_points)], + "id": [*range(n_points)], "alpha": [i**2 for i in range(n_points)], } ) diff --git a/tests/util/test_exponential_growth.py b/tests/util/test_exponential_growth.py index 43f2448..a9fa511 100644 --- a/tests/util/test_exponential_growth.py +++ b/tests/util/test_exponential_growth.py @@ -28,7 +28,7 @@ def test_indexes_for_fit_no_multipactor() -> None: time, population, fitting_range=5.0, minimum_number_of_points=0 ) - assert [i for i in indexes] == [1, 2, 3, 4, 5, 6] + assert [*indexes] == [1, 2, 3, 4, 5, 6] def test_indexes_for_fit_with_multipactor() -> None: @@ -41,7 +41,7 @@ def test_indexes_for_fit_with_multipactor() -> None: time, population, fitting_range=4.0, minimum_number_of_points=0 ) - assert [i for i in indexes] == [6, 7, 8, 9, 10] + assert [*indexes] == [6, 7, 8, 9, 10] def test_indexes_for_fit_fitting_larger_than_simulation_warning( @@ -57,7 +57,7 @@ def test_indexes_for_fit_fitting_larger_than_simulation_warning( time, population, fitting_range=5.0, minimum_number_of_points=0 ) - assert [i for i in indexes] == [0, 1, 2] + assert [*indexes] == [0, 1, 2] mock_warning.assert_called_once() @@ -74,7 +74,7 @@ def test_indexes_for_fit_fitting_not_enough_points_warning( time, population, fitting_range=2.0, minimum_number_of_points=5 ) - assert [i for i in indexes] == [0, 1, 2] + assert [*indexes] == [0, 1, 2] mock_warning.assert_called_once()