From 91d1223f62bd94599b018a2a77201c48bd56f0da Mon Sep 17 00:00:00 2001 From: Lars Kaiser <71793357+kaiserls@users.noreply.github.com> Date: Tue, 28 May 2024 22:04:53 +0200 Subject: [PATCH] [Formatting] New black formatting --- eulerpi/core/model.py | 12 ++++++------ eulerpi/core/plotting.py | 15 ++++++++------- eulerpi/core/sampling.py | 1 - tests/test_dense_grid.py | 1 + tests/test_fixed_params.py | 1 + tests/test_slices.py | 1 + 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/eulerpi/core/model.py b/eulerpi/core/model.py index eeb9207e..cc33d2ad 100644 --- a/eulerpi/core/model.py +++ b/eulerpi/core/model.py @@ -38,12 +38,12 @@ class Model(ABC): Examples of model implementations can be found in the :doc:`Example Models `. """ - param_dim: Optional[ - int - ] = None #: The dimension of the parameter space of the model. It must be defined in the subclass. - data_dim: Optional[ - int - ] = None #: The dimension of the data space of the model. It must be defined in the subclass. + param_dim: Optional[int] = ( + None #: The dimension of the parameter space of the model. It must be defined in the subclass. + ) + data_dim: Optional[int] = ( + None #: The dimension of the data space of the model. It must be defined in the subclass. + ) def __init_subclass__(cls, **kwargs): """Check if the required attributes are set.""" diff --git a/eulerpi/core/plotting.py b/eulerpi/core/plotting.py index 5adc5c0b..cc2c01a1 100644 --- a/eulerpi/core/plotting.py +++ b/eulerpi/core/plotting.py @@ -29,7 +29,6 @@ def sample_violin_plot( num_vertical_grid_points: int = 100, axis_labels: Optional[list[str]] = None, ) -> axes: - """Creates an overview figure with one violin plot for each marginal distribution. Can be used for parameters and simulation results and compares reference (or true underlying) and inferred values when possible. @@ -261,9 +260,9 @@ def sample_violin_plot( reference_left_bound_konf, reference_right_bound_konf, color=colorOrig, - label=r"$\Phi_\mathcal{" + variable_name + "}$" - if i == 0 - else "", + label=( + r"$\Phi_\mathcal{" + variable_name + "}$" if i == 0 else "" + ), alpha=0.3, ) @@ -371,9 +370,11 @@ def sample_violin_plot( reconstructed_left_bound_konf, reconstructed_right_bound_konf, color=colorAppr, - label=r"$\Phi_{\hat{\mathcal{" + variable_name + "}}}$" - if i == 0 - else "", + label=( + r"$\Phi_{\hat{\mathcal{" + variable_name + "}}}$" + if i == 0 + else "" + ), alpha=0.3, ) diff --git a/eulerpi/core/sampling.py b/eulerpi/core/sampling.py index 0a2fda02..ced804b3 100644 --- a/eulerpi/core/sampling.py +++ b/eulerpi/core/sampling.py @@ -11,7 +11,6 @@ Read the documentation of :func:`inference_mcmc ` to learn more about the available options for the MCMC based inference. """ - import typing from multiprocessing import get_context from os import path diff --git a/tests/test_dense_grid.py b/tests/test_dense_grid.py index 3251d979..1424fbbe 100644 --- a/tests/test_dense_grid.py +++ b/tests/test_dense_grid.py @@ -1,6 +1,7 @@ """ Test the slices functionality for each of the inference methods. """ + import numpy as np import pytest diff --git a/tests/test_fixed_params.py b/tests/test_fixed_params.py index 46ff19ee..3dfd49ed 100644 --- a/tests/test_fixed_params.py +++ b/tests/test_fixed_params.py @@ -1,6 +1,7 @@ """ Test the slices functionality for each of the inference methods. """ + import importlib import pytest diff --git a/tests/test_slices.py b/tests/test_slices.py index bd5d57a8..3a045841 100644 --- a/tests/test_slices.py +++ b/tests/test_slices.py @@ -1,6 +1,7 @@ """ Test the slices functionality for each of the inference methods. """ + import numpy as np import pytest