vicelab / cen-sierra-pywr

Code base for modeling the central Sierra Nevada hydropower systems
3 stars 5 forks source link

initial condition updates should be based on correct scenario #78

Open drheinheimer opened 4 years ago

drheinheimer commented 4 years ago

The planning model initial conditions is updated from the daily model in run_basin_model.py. Currently, this updating routine erroneously uses the last scenario of all scenarios:

initial_volume = m.nodes[res].volume[-1]

That -1 is incorrect: it should refer to the appropriate scenario.global_id instead. This can be fixed by looping over scenarios for the initial condition update.