From 7f1ca3e0210d181d109e0f941ae5d95834400dcb Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 3 Jul 2023 12:20:34 -0500 Subject: [PATCH] Fix formatting --- floris/tools/parallel_computing_interface.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/floris/tools/parallel_computing_interface.py b/floris/tools/parallel_computing_interface.py index 8480dafdc..b1808ddb5 100644 --- a/floris/tools/parallel_computing_interface.py +++ b/floris/tools/parallel_computing_interface.py @@ -1,5 +1,6 @@ # Copyright 2022 Shell import copy +import warnings from time import perf_counter as timerpc import numpy as np @@ -9,8 +10,6 @@ from floris.tools.optimization.yaw_optimization.yaw_optimizer_sr import YawOptimizationSR from floris.tools.uncertainty_interface import FlorisInterface, UncertaintyInterface -import warnings - def _load_local_floris_object( fi_dict, @@ -106,12 +105,15 @@ def __init__( # Set defaults for backward compatibility if use_mpi4py is not None: - warnings.warn("The option 'mpi4py' will be removed in a future version. Please use the option 'interface'.") + warnings.warn( + "The option 'mpi4py' will be removed in a future version. " + "Please use the option 'interface'." + ) if use_mpi4py: interface = "mpi4py" else: interface = "multiprocessing" - + if interface == "mpi4py": import mpi4py.futures as mp self._PoolExecutor = mp.MPIPoolExecutor @@ -124,7 +126,10 @@ def __init__( from concurrent.futures import ProcessPoolExecutor self._PoolExecutor = ProcessPoolExecutor else: - raise UserWarning(f"Interface '{interface}' not recognized. Please use 'concurrent', 'multiprocessing' or 'mpi4py'.") + raise UserWarning( + f"Interface '{interface}' not recognized. " + "Please use 'concurrent', 'multiprocessing' or 'mpi4py'." + ) # Initialize floris object and copy common properties self.fi = fi.copy()