Skip to content

Commit

Permalink
Fix plotconfig mkdir (#16)
Browse files Browse the repository at this point in the history
* remove make_plots_dir

* Update main_analysis.py

fix missing dir issue

* bump version

* Update smarteole_example.ipynb

* Update smarteole_example.ipynb

filter SmallSampleWarning

* Update smarteole_example.ipynb

fix ruff issue
  • Loading branch information
aclerc authored Sep 4, 2024
1 parent d8889b3 commit fbf5b07
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 151 deletions.
296 changes: 152 additions & 144 deletions examples/smarteole_example.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "res-wind-up"
version = "0.1.8"
version = "0.1.9"
authors = [
{ name = "Alex Clerc", email = "[email protected]" }
]
Expand Down
2 changes: 1 addition & 1 deletion wind_up/main_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def calc_test_ref_results(
toggle_df: pd.DataFrame | None = None,
) -> dict:
test_name = test_wtg.name
(plot_cfg.plots_dir / test_name / ref_name).mkdir(exist_ok=True)
(plot_cfg.plots_dir / test_name / ref_name).mkdir(exist_ok=True, parents=True)
ref_pw_col = "pw_clipped"
if test_name == ref_name:
ref_ws_col = "WindSpeedMean"
Expand Down
5 changes: 0 additions & 5 deletions wind_up/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ class PlotConfig(BaseModel):
skip_per_turbine_plots: bool = Field(default=False, description="If True skip per turbine plots")
plots_dir: Path = Field(description="Directory to save plots to")

@model_validator(mode="after")
def make_plots_dir(self: "PlotConfig") -> "PlotConfig":
self.plots_dir.mkdir(parents=True, exist_ok=True)
return self


class TurbineType(BaseModel):
turbine_type: str = Field(
Expand Down

0 comments on commit fbf5b07

Please sign in to comment.