Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get time series of results #50

Closed
4 tasks done
rouille opened this issue May 17, 2021 · 1 comment
Closed
4 tasks done

Get time series of results #50

rouille opened this issue May 17, 2021 · 1 comment
Assignees
Labels

Comments

@rouille
Copy link
Collaborator

rouille commented May 17, 2021

Build data frames:

  • PG
  • PF
  • duals
  • storage dispatch
@danielolsen
Copy link
Contributor

#102 should help us extract storage dispatch. It looks like storage energy (our STORAGE_E) is in keys that start with StateOfCharge, and birectional storage dispatch can be constructed using the values in DispatchGen (for positive STORAGE_PG) and ChargeStorage (for negative STORAGE_PG).

Here's what I get when parsing the results file from @YifanLi86's example storage run:

>>> import pickle
>>> import re
>>> from switchwrapper.switch_to_grid import construct_grids_from_switch_results
>>> filename = "path_to_storage_results_file/results_storage.pickle"
>>> with open(filename, "rb") as f:
...     results = pickle.load(f)
... 
>>> sorted({re.search(r"(.*)\[", v).group(1) for v in results.solution._list[0]["Variable"]})
['BuildGen', 'BuildLocalTD', 'BuildStorageEnergy', 'BuildTx', 'ChargeStorage', 'DispatchBaseloadByPeriod', 'DispatchGen', 'DispatchTx', 'GenFuelUseRate', 'StateOfCharge', 'UnservedLoad', 'WithdrawFromCentralGrid']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants