Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 20, 2025
1 parent 62d2b51 commit 2a7676a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/netcomp/distance/exact.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ def lambda_dist(A1, A2, k=None, p=2, kind="laplacian"):
evals1, evals2 = [evals[::-1] for evals in [evals1, evals2]]
else:
raise InputError(
"Invalid type, choose from 'laplacian', "
"'laplacian_norm', and 'adjacency'."
"Invalid type, choose from 'laplacian', 'laplacian_norm', and 'adjacency'."
)
dist = la.norm(evals1[:k] - evals2[:k], ord=p)
return dist
Expand Down
2 changes: 1 addition & 1 deletion src/netcomp/linalg/resistance.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def resistance_matrix(A, check_connected=True):
G = nx.from_numpy_array(A)
if not nx.is_connected(G):
raise UndefinedException(
"Graph is not connected. " "Resistance matrix is undefined."
"Graph is not connected. Resistance matrix is undefined."
)
L = laplacian_matrix(A)
with suppress(Exception):
Expand Down
4 changes: 2 additions & 2 deletions src/swmmanywhere/swmmanywhere.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def swmmanywhere(config: dict) -> tuple[Path, dict | None]:
logger.info(f"Project structure created at {addresses.project_paths.base_dir}")
logger.info(f"Project name: {config['project']}")
logger.info(
f"""Bounding box: {config['bbox']},
f"""Bounding box: {config["bbox"]},
number: {addresses.bbox_paths.bbox_number}"""
)
logger.info(f"Model number: {addresses.model_paths.model_number}")
Expand Down Expand Up @@ -275,7 +275,7 @@ def check_starting_graph(config: dict):
if not config["starting_graph"].exists():
raise FileNotFoundError(
f"""starting_graph not found at
{config['starting_graph']}"""
{config["starting_graph"]}"""
)

return config
Expand Down
2 changes: 1 addition & 1 deletion tests/test_swmmanywhere.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_swmmanywhere():
assert set(metrics.keys()) == set(config["metric_list"])

# Check results were saved
assert (inp.parent / f'{config["graphfcn_list"][-1]}_graph.json').exists()
assert (inp.parent / f"{config['graphfcn_list'][-1]}_graph.json").exists()
assert inp.exists()
assert (inp.parent / "results.parquet").exists()
assert (config["real"]["inp"].parent / "real_results.parquet").exists()
Expand Down

0 comments on commit 2a7676a

Please sign in to comment.