https://github.com/catalyst-cooperative/eia_cleaned_hourly_electricity_demand_code

Code associated with the EIA demand data anomaly screening and imputation project

https://github.com/catalyst-cooperative/eia_cleaned_hourly_electricity_demand_code

Science Score: 33.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    2 of 5 committers (40.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Code associated with the EIA demand data anomaly screening and imputation project

Basic Info
  • Host: GitHub
  • Owner: catalyst-cooperative
  • License: mit
  • Default Branch: master
  • Size: 89.8 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Fork of gschivley/EIA_Cleaned_Hourly_Electricity_Demand_Code
Created almost 6 years ago · Last pushed almost 6 years ago
Metadata Files
Readme License

README.md

EIACleanedHourlyElectricityDemand_Code

Code associated with the U.S. Energy Information Administration (EIA) demand data anomaly screening and imputation project.

Find archived versions of this code at: DOI

Find the resulting cleaned data at: DOI

Code Description

The notebooks in this repository can be used to reproduce the workflow used to: * Step (1) Query the EIA database for raw demand data * Step (2) Screen the data for anomalous values * Step (3) Impute missing and anomalous values with the Multiple Imputation by Chained Equations (MICE) procedure * Step (4) Distribute the imputed results to balancing authority-level files as well as regional, interconnect, and CONUS level aggregates

Required Packages

Steps (1), (2), and (4) are based on python code, were written in python3.7, and use the following additional packages: * pandas * numpy

Step (3) is written in the R programming language and relies on the mice package

The exact environment used when cleaning and imputing the EIA data is saved in the file package-list.txt. The environment was created and managed using Conda.

Running the Code

  • Step (1): see the Jupyter notebook get_eia_demand_data.ipynb. You will need to acquire an API key from the EIA. Additional documentation is provided in the notebook.
  • Step (2): see the Jupyter notebook anomaly_screening.ipynb. For a full description of the algorithms and their motivation see the paper.
  • Step (3): see the R Markdown notebook MICE_step.Rmd
  • Step (4): see the Jupyter notebook distribute_MICE_results.ipynb. This code distributes and aggregates the results as seen in the published content here.

Completing Step (3)

The following three steps will help you to run the MICE imputation Markdown script (MICE_Step.Rmd) if you are unfamiliar with R and RMarkdown.

(a) Download and install R at https://cran.rstudio.com/ (b) Download the free version of RStudio at https://rstudio.com/products/rstudio/download/ (c) Open MICE_Step.Rmd in Rstudio and "Run All"*

*lines 167 and 173 control the amount of parallel computing that this code will attempt. Currently the code is set up to compute 4 chains on each of 4 processing cores. If your computer does not have 4 cores available and/or you would like to only use 1 or 2 cores to run this code, then you will need to change the code to one of the following:

  • 16 chains on 1 core (no parallel computing): Change line 167 to "n.imp.core = 16," and line 173 to "n.core = 1,"

  • 8 chains on 2 cores: Change line 167 to "n.imp.core = 8," and line 173 to "n.core = 2,"

Reproducibility

To achieve exact reproducibility with the published results a user should: * Instead of querying EIA for data for Step (1), you will use the 10 September 2019 files used for the original analysis. Download the Zenodo repository archived here XXX UPDATE DOI * Adjust the initial flags and data path in the second code cell of anomaly_screening.ipynb to point to the archived files and run Step (2) * Run Step (3): * Running Step (3) using RStudio is probably simpler. However, we have verified that exact reproduciblity is achieved running MICE_step.Rmd from the command line based on the Conda environment saved in package-list.txt. * From the command line, run: R -e "rmarkdown::render('MICE_step.Rmd',output_file='output.html')" * Adjust the initial flags and data path in the second code cell of distribute_MICE_results.ipynb to point to the archived files and run Step (4) * Compare results

Because EIA will update historical data values if a balancing authority requests this, it is possible for historical values to change altering the final results. Altered values will change the regressions performend in the MICE step leading to different imputed values for all imputed entries.

Owner

  • Name: Catalyst Cooperative
  • Login: catalyst-cooperative
  • Kind: organization
  • Email: hello@catalyst.coop
  • Location: United States of America

Catalyst is a small data engineering cooperative working on electricity regulation and climate change.

GitHub Events

Total
Last Year

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 36
  • Total Committers: 5
  • Avg Commits per committer: 7.2
  • Development Distribution Score (DDS): 0.472
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Tyler Ruggles t****s@w****u 19
Tyler Ruggles t****s@g****m 8
Greg Schivley g****y@g****m 4
d-farnham d****m@c****u 4
Tyler Ruggles t****s 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 2 years ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels