How to add a region - Gavin-McCormick/watttime GitHub Wiki
The basic idea is to get as many as possible of the following data types, at minimum for the current time and preferably also for day-ahead forecasts: total load, total generation, generation from wind, generation from other sources in whatever detail is available, and marginal fuel. Links to data sources are in this google doc. It's usually not possible to get all of these from open data streams for any individual ISO, which means that there is some heterogeneity in the data we ingest and therefore in the code. Please follow the existing code conventions where it makes sense to do so, and don’t feel constrained by them where they don’t.
You can fork the code and do a pull request, or Gavin can add you as a collaborator, whichever is easier for you. For this task, you’ll mostly be dealing with the windfriendly app.
To add a new region, the biggest step is to write a parser class in windfriendly/parsers.py
. I've found it useful to roughly conform to the UtilityParser interface but your mileage may vary. If you add any new imports, those go in requirements.txt
After that, the rest is more or less boilerplate:
- add tests to the
windfriendly/tests
module (can test bypython manage.py test windfriendly
; feel free to exceed the current subpar testing standard :) ) - add a model to
windfriendly/models/bas.py
and towindfriendly/models/init.py
(remember to syncdb) - update
windfriendly/balancing_authorities.py
where appropriate (can test by going to localhost/update/[BA_NAME]) - add a tastypie resource to
windfriendly/api.py
and add it to theBA_RESOURCES
list at the bottom of the file (can test by exploring the API documented inwindfriendly/README.md
) - add the model name to line 6 of
workers/management/commands/runfrequently.py
(can test bypython manage.py runfrequently
)
Questions, comments, pull requests? Talk to Anna at [email protected]