Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Dec 12, 2024
1 parent 39cd278 commit 036cf30
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions apps/predbat/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def run_prediction(self, charge_limit, charge_window, export_window, export_limi

if not self.set_export_freeze_only and (export_window_n >= 0) and export_limits[export_window_n] < 100.0 and (soc - step * self.battery_rate_max_discharge_scaled) >= discharge_min:
# Discharge enable
discharge_rate_now = self.battery_rate_max_discharge # Assume discharge becomes enabled here
discharge_rate_now = self.battery_rate_max_discharge # Assume discharge becomes enabled here
discharge_rate_now_curve = get_discharge_rate_curve(soc, discharge_rate_now, self.soc_max, self.battery_rate_max_discharge, self.battery_discharge_power_curve, self.battery_rate_min) * self.battery_rate_max_scaling_discharge

battery_draw = min(discharge_rate_now_curve * step, battery_to_min)
Expand Down Expand Up @@ -649,19 +649,19 @@ def run_prediction(self, charge_limit, charge_window, export_window, export_limi
if save in ["best", "best10", "test"]:
# Only tune charge rate on final plan not every simulation
charge_rate_now = find_charge_rate(
minute_absolute,
soc,
charge_window[charge_window_n],
charge_limit_n,
self.battery_rate_max_charge,
self.soc_max,
self.battery_charge_power_curve,
self.set_charge_low_power,
minute_absolute,
soc,
charge_window[charge_window_n],
charge_limit_n,
self.battery_rate_max_charge,
self.soc_max,
self.battery_charge_power_curve,
self.set_charge_low_power,
self.charge_low_power_margin,
self.battery_rate_min,
self.battery_rate_max_scaling,
self.battery_loss,
None
None,
)
else:
charge_rate_now = self.battery_rate_max_charge # Assume charge becomes enabled here
Expand Down Expand Up @@ -815,8 +815,8 @@ def run_prediction(self, charge_limit, charge_window, export_window, export_limi
if soc < self.best_soc_keep and battery_draw > 0:
# Apply keep as a percentage of the time in the future so it gets stronger over an 4 hour period
# Weight to 50% chance of the scenario
#keep_diff = max(get_diff(0, 0, pv_now, load_yesterday, inverter_loss), battery_draw)
#if keep_diff > 0:
# keep_diff = max(get_diff(0, 0, pv_now, load_yesterday, inverter_loss), battery_draw)
# if keep_diff > 0:
metric_keep += rate_import[minute_absolute] * battery_draw * keep_minute_scaling
if diff > 0:
# Import
Expand Down

0 comments on commit 036cf30

Please sign in to comment.