Skip to content

Commit

Permalink
cleaning up commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
ejsimley committed Dec 20, 2024
1 parent 42a79f3 commit 741d729
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
21 changes: 0 additions & 21 deletions flasc/analysis/expected_power_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ def _total_uplift_expected_power_with_standard_error(
percentiles: List[float] = [2.5, 97.5],
remove_any_null_turbine_bins: bool = False,
cov_terms: str = "zero",
# variance_only: bool = False,
# fill_cov_with_var: bool = False,
) -> Dict[str, Dict[str, float]]:
"""Calculate total uplift by propagating standard errors.
Expand Down Expand Up @@ -301,7 +299,6 @@ def _total_uplift_expected_power_with_standard_error(
terms set to the product of the square root of the individual turbine variances.
Defaults to "zero".
Returns:
Dict[str, Dict[str, float]]: A dictionary containing the uplift results with standard error.
"""
Expand Down Expand Up @@ -436,20 +433,12 @@ def _total_uplift_expected_power_with_standard_error(
count=(pl.col(f"count_{uplift_pair[0]}") + pl.col(f"count_{uplift_pair[1]}"))
)

# with pl.Config(tbl_cols=-1):
# print(df_sub)

# Compute the expected power ratio per bin
df_sub = df_sub.with_columns(
expected_power_ratio=pl.col(f"pow_farm_{uplift_pair[1]}")
/ pl.col(f"pow_farm_{uplift_pair[0]}")
)

# # Compute the weighted expected power ratio
# df_sub = df_sub.with_columns(
# weighted_expected_power_ratio=pl.col("expected_power_ratio") * pl.col("weight")
# )

# Compute the total expected power ratio (note this is not computed by
# combining the expected power ratios)
farm_power_0 = df_sub[f"weighted_farm_power_{uplift_pair[0]}"].sum()
Expand Down Expand Up @@ -482,9 +471,6 @@ def _total_uplift_expected_power_with_standard_error(
)
)

# with pl.Config(tbl_cols=-1):
# print(df_sub)

# The total uplift is the sum of the weighted expected power ratio and the weighted
# variance of the expected power ratio
result_dict = {}
Expand Down Expand Up @@ -535,8 +521,6 @@ def total_uplift_expected_power(
percentiles: List[float] = [2.5, 97.5],
remove_any_null_turbine_bins: bool = False,
cov_terms: str = "zero",
# variance_only: bool = False,
# fill_cov_with_var: bool = False,
) -> ExpectedPowerAnalysisOutput:
"""Calculate the total uplift in energy production using expected power methods.
Expand Down Expand Up @@ -650,11 +634,6 @@ def total_uplift_expected_power(
if use_standard_error and N != 1:
raise ValueError("N must be 1 when use_standard_error is True")

# # Raise an error if both variance_only and fill_cov_with_var are True
# May need to reinclude in the future but disabled for now
# if variance_only and fill_cov_with_var:
# raise ValueError("variance_only and fill_cov_with_var cannot both be True")

# Set up the column names for the wind speed and test cols

if not use_predefined_ws:
Expand Down
1 change: 0 additions & 1 deletion flasc/analysis/expected_power_analysis_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ def plot_with_distributions(
y_label = "Wind Direction (Deg)"

## AXIS 1 is histogram
# df_bin_counts = self.df_pandas.groupby([x_var]).size().reset_index(name='count')
sns.histplot(
data=self.df_pandas, x=x_var, ax=axarr[1], bins=sorted(self.df_pandas[x_var].unique())
)
Expand Down
8 changes: 0 additions & 8 deletions flasc/analysis/expected_power_analysis_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,6 @@ def _fill_cov_with_var(
.alias(n_col)
)

# # Wherever n_col is null, set cov_col to null
# df_cov = df_cov.with_columns(
# pl.when(pl.col(n_col).is_null())
# .then(None)
# .otherwise(pl.col(cov_col))
# .alias(cov_col)
# )

# Remove the null_map column if exists
if "null_map" in df_cov.columns:
df_cov = df_cov.drop("null_map")
Expand Down

0 comments on commit 741d729

Please sign in to comment.