Skip to content

Commit

Permalink
Updated test for varied heuristics
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjasa committed Jan 24, 2025
1 parent 8148264 commit 225e2cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions hopp/utilities/keys.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from dotenv import load_dotenv, find_dotenv
import os

developer_nrel_gov_key = ""
developer_nrel_gov_email = ""
developer_nrel_gov_key = "EIJvR91RkJEA2dSelHTnoCux22tPncYScLs8kqde"
developer_nrel_gov_email = "[email protected]"


def set_developer_nrel_gov_key(key: str):
Expand Down
10 changes: 6 additions & 4 deletions tests/hopp/test_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,9 @@ def create_test_objective_rule(m):

def test_hybrid_dispatch_baseload_heuristic_and_analysis(site):

desired_schedule = 8760*[20]
desired_schedule = 8760 * [20]
# Using a non-uniform schedule to test the baseload heuristic bugfix
desired_schedule[:2000] = [10.] * 2000

desired_schedule_site = SiteInfo(flatirons_site,
desired_schedule=desired_schedule)
Expand All @@ -998,9 +1000,9 @@ def test_hybrid_dispatch_baseload_heuristic_and_analysis(site):

hybrid_plant = hi.system

assert hybrid_plant.grid.time_load_met == pytest.approx(92.87, 1e-2)
assert hybrid_plant.grid.capacity_factor_load == pytest.approx(94.45, 1e-2)
assert hybrid_plant.grid.total_number_hours == pytest.approx(3844, 1e-2)
assert hybrid_plant.grid.time_load_met == pytest.approx(94.429, 1e-2)
assert hybrid_plant.grid.capacity_factor_load == pytest.approx(95.659, 1e-2)
assert hybrid_plant.grid.total_number_hours == pytest.approx(4270, 1e-2)

def test_dispatch_load_following_heuristic_with_wave(site, subtests):
dispatch_options = {'battery_dispatch': 'load_following_heuristic', 'grid_charging': False}
Expand Down

0 comments on commit 225e2cf

Please sign in to comment.