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
10 changes: 5 additions & 5 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: "v5.0.0"
rev: "v6.0.0"
hooks:
- id: check-added-large-files
exclude: ^docs/_static/k3d_(tesla|wr75)_example\.html$
Expand All @@ -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
1 change: 1 addition & 0 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
python release.py <X.Y.Z>

"""

import re
import subprocess
import sys
Expand Down
2 changes: 1 addition & 1 deletion src/simultipac/simulation_results/simulations_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/simultipac/util/log_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

"""

import logging
import subprocess
import sys
Expand Down
4 changes: 2 additions & 2 deletions tests/simulation_results/test_simulations_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
}
)
Expand All @@ -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)],
}
)
Expand Down
8 changes: 4 additions & 4 deletions tests/util/test_exponential_growth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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(
Expand All @@ -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()


Expand All @@ -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()


Expand Down
Loading