Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmudaf committed Jul 3, 2023
1 parent 72e30c2 commit 7f1ca3e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions floris/tools/parallel_computing_interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2022 Shell
import copy
import warnings
from time import perf_counter as timerpc

import numpy as np
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 7f1ca3e

Please sign in to comment.