Skip to content

Commit

Permalink
Keep step data for debug (#1784)
Browse files Browse the repository at this point in the history
* Keep step data for debug

* Re-do PV

* [pre-commit.ci lite] apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
  • Loading branch information
springfall2008 and pre-commit-ci-lite[bot] authored Dec 24, 2024
1 parent 4b743ca commit 8b066e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions apps/predbat/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2057,9 +2057,8 @@ def calculate_yesterday(self):
)

# Save step data for debug
if self.debug_enable:
self.yesterday_load_step = yesterday_load_step
self.yesterday_pv_step = yesterday_pv_step
self.yesterday_load_step = yesterday_load_step
self.yesterday_pv_step = yesterday_pv_step

# Save state
minutes_now = self.minutes_now
Expand Down
6 changes: 4 additions & 2 deletions apps/predbat/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1670,8 +1670,8 @@ def run_execute_test(

def run_single_debug(my_predbat, debug_file):
print("**** Running debug test {} ****\n".format(debug_file))
re_do_rates = True
reset_load_model = False
re_do_rates = False
reset_load_model = True
load_override = 1.0

reset_inverter(my_predbat)
Expand Down Expand Up @@ -1733,6 +1733,8 @@ def run_single_debug(my_predbat, debug_file):
load_scaling_dynamic=my_predbat.load_scaling_dynamic,
cloud_factor=min(my_predbat.metric_load_divergence + 0.5, 1.0) if my_predbat.metric_load_divergence else None,
)
my_predbat.pv_forecast_minute_step = my_predbat.step_data_history(my_predbat.pv_forecast_minute, my_predbat.minutes_now, forward=True, cloud_factor=my_predbat.metric_cloud_coverage)
my_predbat.pv_forecast_minute10_step = my_predbat.step_data_history(my_predbat.pv_forecast_minute10, my_predbat.minutes_now, forward=True, cloud_factor=min(my_predbat.metric_cloud_coverage + 0.2, 1.0) if my_predbat.metric_cloud_coverage else None)

pv_step = my_predbat.pv_forecast_minute_step
pv10_step = my_predbat.pv_forecast_minute10_step
Expand Down

0 comments on commit 8b066e8

Please sign in to comment.