Skip to content

Commit

Permalink
fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tg359 committed Aug 20, 2024
1 parent ce32c27 commit c27df38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Methods for handling CFD results for spatial comfort assessments."""

# pylint: disable=E0401
import json
import warnings
Expand All @@ -17,7 +18,6 @@
# pylint: enable=E0401



EXAMPLE_CFD_CONFIG_JSON = """
[
{
Expand Down Expand Up @@ -172,7 +172,9 @@ def load_cfd_extract(file: Path, velocity_col: str = "VELOCITY") -> pd.DataFrame
.drop(columns=["level_0"])
)
except pd.errors.ParserError:
df = pd.read_csv(StringIO(dat.split("\n\n")[1]), sep=",", skiprows=1, index_col=0)
df = pd.read_csv(
StringIO(dat.split("\n\n")[1]), sep=",", skiprows=1, index_col=0
)
if len(df.columns) != 4:
raise ValueError("Columns should be of length 4 (x, y, z, velocity)")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Methods for handling SpatialMetric results for spatial comfort assessments."""

# pylint: disable=broad-exception-caught,W0212
# pylint: disable=line-too-long
# pylint: disable=E0401
Expand Down Expand Up @@ -46,9 +47,6 @@
# pyling: enable=E0401





@dataclass(init=True, repr=True, eq=True)
class SpatialComfort:
"""A SpatialComfort object, used to calculate spatial UTCI.
Expand Down Expand Up @@ -2029,7 +2027,7 @@ def spatial_comfort_possible(sim_dir: Path) -> bool:
free_space = free_space // (2**20)

sim_dir_size = 0
for filename in sim_dir.glob("**/*.*"):
for filename in sim_dir.glob("**/*.*"):
if not filename.is_file():
continue
if filename.suffix in [".parquet", ".png"]:
Expand All @@ -2040,6 +2038,8 @@ def spatial_comfort_possible(sim_dir: Path) -> bool:
# additional results will be ~1.68 times smaller, based on precedent
results_size = sim_dir_size / 1.68
if results_size > free_space:
warnings.warn(f"You might not have enough disk space to run this process. Estimated results size of {results_size:0.0f}Mb, with free space of {free_space:0.0f}Mb. You might be alright, but it's worthwhile clearing some space just in case.")
warnings.warn(
f"You might not have enough disk space to run this process. Estimated results size of {results_size:0.0f}Mb, with free space of {free_space:0.0f}Mb. You might be alright, but it's worthwhile clearing some space just in case."
)

return True

0 comments on commit c27df38

Please sign in to comment.