A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

USelectricity

Forecast the US demand for electricity.
https://github.com/RamiKrispin/USelectricity

Last synced: over 1 year ago
JSON representation

Acceptance Criteria

Repository metadata

Forecast the US demand for electricity

README.Rmd

          ---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

`%>%` <- magrittr::`%>%`
```

# USelectricity




WIP...

The [US Electricity Dashboard](https://ramikrispin.github.io/USelectricity/) provides real-time tracking and forecasting for US (lower 48 states) hourly electricity demand. This project's primary goal is to demonstrate a data science project's deployment into production using open source and free tools such as R, h2o, Github Actions, Docker, and others. That includes the following components:

* Data - pulling the US hourly demand and generation of electricity data from the Energy Information Administration (EIA) API with the use of R and jq
* Forecast - generating 72 hours forecast for the total demand with the use of Generalized Linear Model (GLM) using the h2o package
* Dashboard - communicating the demand data and forecast with the use of the flexdashboard package
* Automation - the data on the dashboard is getting refresh every hour, and the forecast generated every 72 hours with the use of Github Actions and Docker


### Data

The dashboard provides an overview for the overall hourly demand and generation of electricity in the US (lower 48). 


Demand 
https://www.eia.gov/opendata/qb.php?category=3389935&sdid=EBA.US48-ALL.D.H
Net generation
https://www.eia.gov/opendata/qb.php?category=3390020&sdid=EBA.US48-ALL.NG.H

```{r include=FALSE}
load("./data/elec_df.rda")
df <- elec_df %>% 
  dplyr::filter(date_time >= lubridate::ymd_hms("2021-01-01 00:00:00", tz = "US/Eastern" ) & 
                  date_time < lubridate::ymd_hms("2021-02-01 00:00:00", tz = "US/Eastern" )) %>%
  tidyr::pivot_wider(names_from = type, values_from = series)

df$date_time_us <- lubridate::with_tz(time = df$date_time, tzone = "US/Eastern")

p <- plotly::plot_ly(data = df) %>%
  plotly::add_lines(x = ~ date_time_us,
                y = ~ demand,
                name = "Demand",
                line = list(color = "#1f77b4")) %>%
  plotly::add_lines(x = ~ date_time_us,
                y = ~ generation,
                name = "Generation",
                line = list(color = "#2ca02c")) %>%
    plotly::layout(title = "The US (Lower 48) Demand and Generation of Electricity",
                 yaxis = list(title = "Megawatt-Hour"),
                 xaxis = list(title = "Eastern Time
Source: US Energy Information Administration"), hovermode = "compare") plotly::orca(p, "./figures/elec_df.svg") ```

Owner metadata


Committers metadata

Last synced: over 1 year ago

Total Commits: 7,311
Total Committers: 2
Avg Commits per committer: 3,655.5
Development Distribution Score (DDS): 0.001

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
RamiKrispin r****p@u****u 7306
RamiKrispin r****p@u****u 5

Committer domains:


Issue and Pull Request metadata

Last synced: over 1 year ago

Total issues: 1
Total pull requests: 0
Average time to close issues: N/A
Average time to close pull requests: N/A
Total issue authors: 1
Total pull request authors: 0
Average comments per issue: 0.0
Average comments per pull request: 0
Merged pull request: 0
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/RamiKrispin/USelectricity

Top Issue Authors

  • RamiKrispin (1)

Top Pull Request Authors


Top Issue Labels

  • documentation (1)
  • enhancement (1)

Top Pull Request Labels


Dependencies

.github/workflows/main.yml actions
  • actions/checkout v2 composite
docker/dev/Dockerfile docker
  • rkrispin/baser v.4.0.0 build
docker/rstudio/Dockerfile docker
  • rkrispin/us_electricity dev.0.0.0.9000 build
docs/docker/dev/Dockerfile docker
  • rkrispin/baser v.4.0.0 build
docs/docker/rstudio/Dockerfile docker
  • rkrispin/us_electricity dev.0.0.0.9000 build

Score: 5.267858159063328