Skip to content

Commit

Permalink
Make flake8 happy
Browse files Browse the repository at this point in the history
  • Loading branch information
iomaganaris committed Jul 24, 2023
1 parent 7a38dd2 commit 5debd79
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
15 changes: 13 additions & 2 deletions neurodamus/cell_distributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,14 @@ class LoadBalance:
_cx_filename_tpl = "cx_%s#.dat" # use # to well delimiter the target name
_cpu_assign_filename_tpl = "cx_%s#.%s.dat" # prefix must be same (imposed by Neuron)

def __init__(self, balance_mode, nodes_path, target_manager, output_path, target_cpu_count=None):
def __init__(
self,
balance_mode,
nodes_path,
target_manager,
output_path,
target_cpu_count=None,
):
"""
Creates a new Load Balance object, associated with a given node file
"""
Expand Down Expand Up @@ -982,7 +989,11 @@ def load_balance_info(self, target_spec):
def _loadbal_dir(cls, nodefile, output_path) -> Path:
"""Returns the dir where load balance files are stored for a given nodes file"""
nodefile_hash = hashlib.md5(nodefile.encode()).digest().hex()[:10]
return Path(output_path) / (cls._base_output_dir) / (cls._circuit_lb_dir_tpl % nodefile_hash)
return (
Path(output_path)
/ (cls._base_output_dir)
/ (cls._circuit_lb_dir_tpl % nodefile_hash)
)

def _cx_filename(self, target_str, basename_str=False) -> Path:
"""Gets the filename of a cell complexity file for a given target"""
Expand Down
8 changes: 7 additions & 1 deletion neurodamus/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,13 @@ def compute_load_balance(self):
# Compat Note: data_src in BlueConfig mode was the nrnPath. Not anymore.
prosp_hosts = self._run_conf.get("ProspectiveHosts")
data_src = circuit.CircuitPath if is_sonata_config else self._run_conf["nrnPath"]
load_balancer = LoadBalance(lb_mode, data_src, self._target_manager, self._run_conf["OutputRoot"], prosp_hosts)
load_balancer = LoadBalance(
lb_mode,
data_src,
self._target_manager,
self._run_conf["OutputRoot"],
prosp_hosts
)

if load_balancer.valid_load_distribution(target_spec):
logging.info("Load Balancing done.")
Expand Down

0 comments on commit 5debd79

Please sign in to comment.