-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbb9b9c
commit ab43c90
Showing
26 changed files
with
341 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.. _api: | ||
|
||
API reference | ||
============= | ||
This page gives an overview of all public ``gridemissions`` objects. | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
Data structure | ||
-------------- | ||
The main abstraction we use for holding data is :class:`GraphData` | ||
|
||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
GraphData | ||
read_csv | ||
GraphData.to_csv | ||
|
||
Accessing data | ||
|
||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
GraphData.get_data | ||
GraphData.get_cols | ||
GraphData.has_field | ||
|
||
There are several helper methods to check data consistency. | ||
|
||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
GraphData.check_all | ||
GraphData.check_antisymmetric | ||
GraphData.check_balance | ||
GraphData.check_generation_by_source | ||
GraphData.check_interchange | ||
GraphData.check_nans | ||
GraphData.check_positive | ||
|
||
Data cleaning | ||
------------- | ||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
BasicCleaner | ||
BasicCleaner.process | ||
RollingCleaner | ||
RollingCleaner.process | ||
|
||
Data reconciliation | ||
------------------- | ||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
CvxCleaner | ||
CvxCleaner.process | ||
|
||
Consumption-based emissions | ||
--------------------------- | ||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
EmissionsCalc | ||
EmissionsCalc.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.. _config: | ||
|
||
Configuration | ||
============= | ||
Some configuration is needed for this project, to hold environment variables like data paths, API keys and passwords. The recommended option is to use a configuration file (``config.json``). A default is created for you the first time you import the package, in the folder ``~/.config/gridemissions``. ``~`` stands for your home directory. On Linux, this is what ``$HOME`` evaluates to, on Windows/OSX, this is the directory that contains your Documents, Desktop and Downloads folders. | ||
|
||
Alternatively, configuration settings can be read from environment variables, e.g. with | ||
|
||
.. code-block:: bash | ||
export GRIDEMISSIONS_CONFIG_DIR_PATH="$HOME/.config/gridemissions_test" | ||
The config.json file | ||
-------------------- | ||
Whenever you import the gridemissions module, the key-value pairs stored in ``config.json`` are loaded into a dictionary that then becomes available to you as the dictionary gridemissions.config. These can also be modified at runtime. At a minimum, your ``config.json`` should contain: | ||
|
||
* ``DATA_PATH``: path to local data store, by default ``~/data/gridemissions`` | ||
* ``TMP_PATH``: for scratch data (e.g. when downloading data), by default ``~/tmp/gridemissions`` | ||
|
||
Supported Environment Variables | ||
------------------------------- | ||
|
||
.. code-block:: bash | ||
GRIDEMISSIONS_CONFIG_DIR_PATH # the configuration directory (default: "$HOME/.config/gridemissions") | ||
GRIDEMISSIONS_LOG_CONFIG_FILE_PATH # the file used to store logging (default: "$HOME/.config/gridemissions/logging.conf") | ||
GRIDEMISSIONS_CONFIG_FILE_PATH: # the configuration file (default: "$HOME/.config/gridemissions/config.json") | ||
GRIDEMISSIONS_DEFAULT_LOGGING_CONF # the default logging configuration (default can be read within ./src/gridemissions/configure.py") | ||
GRIDEMISSIONS_DATA_DIR_PATH # the data directory (default: "$HOME/data/gridemissions") | ||
GRIDEMISSIONS_TMP_DIR_PATH # the temporary data directory (default: "$HOME/tmp/gridemissions") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.BasicCleaner.process | ||
================================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: BasicCleaner.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
gridemissions.BasicCleaner | ||
========================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. autoclass:: BasicCleaner | ||
|
||
|
||
.. automethod:: __init__ | ||
|
||
|
||
.. rubric:: Methods | ||
|
||
.. autosummary:: | ||
|
||
~BasicCleaner.__init__ | ||
~BasicCleaner.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.CvxCleaner.process | ||
================================ | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: CvxCleaner.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
gridemissions.CvxCleaner | ||
======================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. autoclass:: CvxCleaner | ||
|
||
|
||
.. automethod:: __init__ | ||
|
||
|
||
.. rubric:: Methods | ||
|
||
.. autosummary:: | ||
|
||
~CvxCleaner.__init__ | ||
~CvxCleaner.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.EmissionsCalc.process | ||
=================================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: EmissionsCalc.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
gridemissions.EmissionsCalc | ||
=========================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. autoclass:: EmissionsCalc | ||
|
||
|
||
.. automethod:: __init__ | ||
|
||
|
||
.. rubric:: Methods | ||
|
||
.. autosummary:: | ||
|
||
~EmissionsCalc.__init__ | ||
~EmissionsCalc.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.check\_all | ||
================================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.check_all |
6 changes: 6 additions & 0 deletions
6
docs/generated/gridemissions.GraphData.check_antisymmetric.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.check\_antisymmetric | ||
============================================ | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.check_antisymmetric |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.check\_balance | ||
====================================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.check_balance |
6 changes: 6 additions & 0 deletions
6
docs/generated/gridemissions.GraphData.check_generation_by_source.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.check\_generation\_by\_source | ||
===================================================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.check_generation_by_source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.check\_interchange | ||
========================================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.check_interchange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.check\_nans | ||
=================================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.check_nans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.check\_positive | ||
======================================= | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.check_positive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.get\_cols | ||
================================= | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.get_cols |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.get\_data | ||
================================= | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.get_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.has\_field | ||
================================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.has_field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
gridemissions.GraphData | ||
======================= | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. autoclass:: GraphData | ||
|
||
|
||
.. automethod:: __init__ | ||
|
||
|
||
.. rubric:: Methods | ||
|
||
.. autosummary:: | ||
|
||
~GraphData.__init__ | ||
~GraphData.check_all | ||
~GraphData.check_antisymmetric | ||
~GraphData.check_balance | ||
~GraphData.check_generation_by_source | ||
~GraphData.check_interchange | ||
~GraphData.check_nans | ||
~GraphData.check_positive | ||
~GraphData.get_cols | ||
~GraphData.get_data | ||
~GraphData.has_field | ||
~GraphData.to_csv | ||
~GraphData.to_parquet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.GraphData.to\_csv | ||
=============================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: GraphData.to_csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.RollingCleaner.process | ||
==================================== | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. automethod:: RollingCleaner.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
gridemissions.RollingCleaner | ||
============================ | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. autoclass:: RollingCleaner | ||
|
||
|
||
.. automethod:: __init__ | ||
|
||
|
||
.. rubric:: Methods | ||
|
||
.. autosummary:: | ||
|
||
~RollingCleaner.__init__ | ||
~RollingCleaner.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gridemissions.read\_csv | ||
======================= | ||
|
||
.. currentmodule:: gridemissions | ||
|
||
.. autofunction:: read_csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
.. Grid emissions documentation master file, created by | ||
sphinx-quickstart on Sat Sep 19 15:20:32 2020. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
.. gridemissions documentation master file | ||
Documentation for the gridemissions project | ||
Documentation for the gridemissions package | ||
=========================================== | ||
|
||
Introduction | ||
~~~~~~~~~~~~~ | ||
The tools in this package power the visualization at `energy.stanford.edu/gridemissions`_, updated hourly. Associated datasets on electricity and emissions are made publicly available. In addition to tools to create the data, the gridemissions package provides a module to retrieve data from the API and methods to load and manipulate the data. | ||
|
||
Documentation contents | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
Configuration | ||
~~~~~~~~~~~~~ | ||
To come. | ||
|
||
Workflows | ||
~~~~~~~~~~~~~ | ||
To come | ||
config | ||
operations | ||
api | ||
|
||
API reference | ||
~~~~~~~~~~~~~ | ||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
api.retrieve | ||
.. _energy.stanford.edu/gridemissions: https://energy.stanford.edu/gridemissions |
Oops, something went wrong.