Skip to content

Commit

Permalink
Fix flake8 error E231 missing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jnettels authored Oct 23, 2023
1 parent 0c58e40 commit 1cfc486
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dhnx/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ def add(self, class_name, id, **kwargs):
id
kwargs
"""
assert class_name in available_components.index,\
assert class_name in available_components.index, \
f"Component class {class_name} is not within the available components" \
f" {available_components.index}."

list_name = available_components.loc[class_name].list_name

assert id not in self.components[list_name].index,\
assert id not in self.components[list_name].index, \
f"There is already a component with the id {id}."

# check if required parameters are in kwargs
Expand Down Expand Up @@ -187,12 +187,12 @@ def remove(self, class_name, id):
id : int
id of the component to remove
"""
assert class_name in available_components.index,\
assert class_name in available_components.index, \
"Component class '{}' is not within the available_components."

list_name = available_components.loc[class_name].list_name

assert id in self.components[list_name].index,\
assert id in self.components[list_name].index, \
f"There is no component with the id {id}."

self.components[list_name].drop(id, inplace=True)
Expand Down
4 changes: 2 additions & 2 deletions dhnx/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(

self.nx_graph = thermal_network.to_nx_graph()

assert nx.algorithms.tree.is_tree(self.nx_graph),\
assert nx.algorithms.tree.is_tree(self.nx_graph), \
"Currently, only tree networks can be modeled. " \
"Looped networks are not implemented yet."

Expand Down Expand Up @@ -270,7 +270,7 @@ def _calculate_pipes_mass_flow(self):
rcond=None
)

assert residuals < self.tolerance,\
assert residuals < self.tolerance, \
f"Residuals {residuals} are larger than tolerance {self.tolerance}!"

pipes_mass_flow.update({t: x})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pandas as pd
import matplotlib.pyplot as plt

from dhnx.optimization.precalc_hydraulic import v_max_bisection,\
from dhnx.optimization.precalc_hydraulic import v_max_bisection, \
calc_mass_flow, calc_power, v_max_secant

df = pd.read_csv("Pipe_data.csv", sep=";")
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def check_if_csv_dirs_equal(dir_a, dir_b, **kwargs):

diff = list(set(f_names_a).symmetric_difference(set(f_names_b)))

assert not diff,\
assert not diff, \
f"Lists of filenames are not the same." \
f" The diff is: {diff}"

Expand Down

0 comments on commit 1cfc486

Please sign in to comment.