diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c53884ad..a7a417f2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace args: [--markdown-linebreak-ext=md] @@ -49,7 +49,7 @@ repos: # Changes tabs to spaces - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.5 + rev: v1.5.6 hooks: - id: remove-tabs @@ -64,7 +64,7 @@ repos: # Autoremoves unused Python imports - repo: https://github.com/hadialqattan/pycln - rev: v2.5.0 + rev: v2.6.0 hooks: - id: pycln name: pycln (python) @@ -103,12 +103,12 @@ repos: ) # Python Formatting -- repo: https://github.com/psf/black - rev: 25.1.0 # Keep in sync with blacken-docs +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.1.0 # Keep in sync with blacken-docs hooks: - id: black - repo: https://github.com/asottile/blacken-docs - rev: 1.19.1 + rev: 1.20.0 hooks: - id: blacken-docs args: [--line-length=80] @@ -128,7 +128,7 @@ repos: # Checks the manifest for missing files (native support) - repo: https://github.com/mgedmin/check-manifest - rev: "0.50" + rev: "0.51" hooks: - id: check-manifest # This is a slow hook, so only run this if --hook-stage manual is passed diff --git a/doc/source/conf.py b/doc/source/conf.py index 56d9963d..3870d41b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -12,11 +12,9 @@ # from datetime import date - # -- Import version ---------------------------------------------------------- from optimas import __version__ # noqa: E402 - # -- Project information ----------------------------------------------------- project = "optimas" project_copyright = "2023-%s, the optimas collaborators" % date.today().year diff --git a/examples/hipace/run_example.py b/examples/hipace/run_example.py index 5c8a1644..f1cde562 100644 --- a/examples/hipace/run_example.py +++ b/examples/hipace/run_example.py @@ -17,7 +17,6 @@ from analysis_script import analyze_simulation - # Create VOCS object. vocs = VOCS( variables={ diff --git a/examples/ionization_injection/run_example.py b/examples/ionization_injection/run_example.py index 8e9445b6..0814dcae 100644 --- a/examples/ionization_injection/run_example.py +++ b/examples/ionization_injection/run_example.py @@ -20,7 +20,6 @@ from analysis_script import analyze_simulation - # Create VOCS object. vocs = VOCS( variables={ diff --git a/examples/ionization_injection_mf/run_example.py b/examples/ionization_injection_mf/run_example.py index d5262b8d..679c2d49 100644 --- a/examples/ionization_injection_mf/run_example.py +++ b/examples/ionization_injection_mf/run_example.py @@ -20,7 +20,6 @@ from analysis_script import analyze_simulation - # Create VOCS object. vocs = VOCS( variables={ diff --git a/examples/multi_stage/run_example.py b/examples/multi_stage/run_example.py index 5bc86014..b88f85bd 100644 --- a/examples/multi_stage/run_example.py +++ b/examples/multi_stage/run_example.py @@ -17,7 +17,6 @@ from analysis_script import analyze_simulation - # Create VOCS object. vocs = VOCS( variables={ diff --git a/examples/multitask_lpa_fbpic_waket/custom_fld_diags.py b/examples/multitask_lpa_fbpic_waket/custom_fld_diags.py index f8bb0ca7..98a89f2d 100644 --- a/examples/multitask_lpa_fbpic_waket/custom_fld_diags.py +++ b/examples/multitask_lpa_fbpic_waket/custom_fld_diags.py @@ -11,6 +11,7 @@ not to write to disk at every timestep - Parallel output is not implemented for the moment """ + import os import numpy as np from scipy.constants import c diff --git a/examples/multitask_lpa_fbpic_waket/custom_ptcl_diags.py b/examples/multitask_lpa_fbpic_waket/custom_ptcl_diags.py index a5eae22b..0a332ed1 100644 --- a/examples/multitask_lpa_fbpic_waket/custom_ptcl_diags.py +++ b/examples/multitask_lpa_fbpic_waket/custom_ptcl_diags.py @@ -10,6 +10,7 @@ - The class implements memory buffering of the slices, so as not to write to disk at every timestep """ + import os import math import numpy as np diff --git a/examples/multitask_lpa_fbpic_waket/run_opt.py b/examples/multitask_lpa_fbpic_waket/run_opt.py index 6fb2f743..027919c0 100644 --- a/examples/multitask_lpa_fbpic_waket/run_opt.py +++ b/examples/multitask_lpa_fbpic_waket/run_opt.py @@ -10,7 +10,6 @@ from analysis_script import analyze_simulation - # Create VOCS object. vocs = VOCS( variables={ diff --git a/examples/multitask_lpa_fbpic_waket/template_simulation_script.py b/examples/multitask_lpa_fbpic_waket/template_simulation_script.py index 31fc3116..151509d0 100644 --- a/examples/multitask_lpa_fbpic_waket/template_simulation_script.py +++ b/examples/multitask_lpa_fbpic_waket/template_simulation_script.py @@ -11,7 +11,6 @@ import aptools.plasma_accel.general_equations as ge from bunch_utils import trapezoidal_bunch - # Parammeters exposed to optimizer. task = {{task}} beam_i_1 = {{beam_i_1}} diff --git a/examples/wake_t/run_example.py b/examples/wake_t/run_example.py index f3a4175e..af139e8d 100644 --- a/examples/wake_t/run_example.py +++ b/examples/wake_t/run_example.py @@ -18,7 +18,6 @@ from analysis_script import analyze_simulation - # Create VOCS object. vocs = VOCS( variables={ diff --git a/examples/wake_t_fbpic_mt/run_example.py b/examples/wake_t_fbpic_mt/run_example.py index 36327a51..39d8ec97 100644 --- a/examples/wake_t_fbpic_mt/run_example.py +++ b/examples/wake_t_fbpic_mt/run_example.py @@ -20,7 +20,6 @@ from analysis_script import analyze_simulation - # Create VOCS object. vocs = VOCS( variables={ diff --git a/optimas/core/__init__.py b/optimas/core/__init__.py index 081f88e3..e0b7fec6 100644 --- a/optimas/core/__init__.py +++ b/optimas/core/__init__.py @@ -3,7 +3,6 @@ from .task import Task from .trial import Trial, TrialStatus - __all__ = [ "Evaluation", "Parameter", diff --git a/optimas/evaluators/__init__.py b/optimas/evaluators/__init__.py index 95766dfe..684ce8de 100644 --- a/optimas/evaluators/__init__.py +++ b/optimas/evaluators/__init__.py @@ -3,7 +3,6 @@ from .multitask_evaluator import MultitaskEvaluator from .chain_evaluator import ChainEvaluator - __all__ = [ "FunctionEvaluator", "TemplateEvaluator", diff --git a/optimas/explorations/__init__.py b/optimas/explorations/__init__.py index 7f8b80a1..d5ad8c61 100644 --- a/optimas/explorations/__init__.py +++ b/optimas/explorations/__init__.py @@ -1,4 +1,3 @@ from .base import Exploration - __all__ = ["Exploration"] diff --git a/optimas/explorations/base.py b/optimas/explorations/base.py index 22d2d074..ccd21f09 100644 --- a/optimas/explorations/base.py +++ b/optimas/explorations/base.py @@ -22,7 +22,6 @@ from optimas.utils.logger import get_logger from optimas.utils.other import convert_to_dataframe - logger = get_logger(__name__) diff --git a/optimas/generators/ax/base.py b/optimas/generators/ax/base.py index e721b147..206f37d6 100644 --- a/optimas/generators/ax/base.py +++ b/optimas/generators/ax/base.py @@ -9,7 +9,6 @@ from optimas.generators.base import Generator from gest_api.vocs import VOCS - # Disable Ax loggers to get cleaner output. In principle, setting # `verbose_logging=False` in the `AxClient` should already avoid most of the # logs, but this does not work when using 'spawn' multiprocessing. diff --git a/tests/resources/template_simulation_script_moo.py b/tests/resources/template_simulation_script_moo.py index fa326c09..e17f527a 100644 --- a/tests/resources/template_simulation_script_moo.py +++ b/tests/resources/template_simulation_script_moo.py @@ -6,7 +6,6 @@ import numpy as np - # 2D function with multiple minima f1 = -({{x0}} + 10 * np.cos({{x0}})) * ({{x1}} + 5 * np.cos({{x1}})) f2 = -({{x0}} + 10 * np.cos({{x0}} + 10)) * ({{x1}} + 5 * np.cos({{x1}} - 5)) diff --git a/tests/test_ax_generators.py b/tests/test_ax_generators.py index 57d566b5..d76c6263 100644 --- a/tests/test_ax_generators.py +++ b/tests/test_ax_generators.py @@ -17,7 +17,6 @@ from optimas.core import Task from gest_api.vocs import VOCS - # Some tests will use threading (instead of multiprocessing) to be able to # trigger failed trials based on a global counter. threadLock = threading.Lock()