Skip to content

Commit

Permalink
Data Patch Pipeline and Patch 001 (#69)
Browse files Browse the repository at this point in the history
Data Patch Pipeline and Patch_001
  • Loading branch information
jikaczmarski authored Jul 30, 2024
1 parent 4af6327 commit 0ce3d45
Show file tree
Hide file tree
Showing 42 changed files with 2,782 additions and 4,702 deletions.
8 changes: 4 additions & 4 deletions _regions_map.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ css=html`<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]
```

```{ojs}
aea_regions = FileAttachment("data/working/regions/aea_regions.geojson").json()
acep_regions = FileAttachment("data/working/regions/acep_regions.geojson").json()
aea_regions = FileAttachment("data/final_data/aea_regions.geojson").json()
acep_regions = FileAttachment("data/final_data/acep_regions.geojson").json()
coords_json = FileAttachment("data/working/regions/coordinates.geojson").json()
coords_json = FileAttachment("data/final_data/coordinates.geojson").json()
// coords_csv = FileAttachment("data/working/regions/coordinates_pce.csv").csv({typed: true})
// coords_csv = FileAttachment("data/final_data/coordinates_pce.csv").csv({typed: true})
```

Expand Down
4 changes: 2 additions & 2 deletions capacity.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ library(dplyr)
library(readr)
# Import the data
capacity_data <- read.csv("data/working/capacity/capacity_long.csv")
capacity_data <- read.csv("data/final_data/capacity.csv")
# Regional capacity
regional_capacity <- capacity_data %>%
Expand Down Expand Up @@ -405,6 +405,6 @@ Plot.plot({


```{ojs}
original_cap_data = FileAttachment("data/working/capacity/capacity_long.csv").csv({ typed: true })
original_cap_data = FileAttachment("data/final_data/capacity.csv").csv({ typed: true })
cap_data = original_cap_data.map((d) => ({...d, "Prime Mover": d.prime_mover}))
```
4 changes: 2 additions & 2 deletions consumption.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ library(dplyr)
library(tidyr)
# Import the consumption data
consumption_data <- read.csv(file = "data/working/consumption/consumption_long.csv")
consumption_data <- read.csv(file = "data/final_data/consumption.csv")
# Regionalized consumption data
regional_consumption_data <- consumption_data %>%
Expand Down Expand Up @@ -62,7 +62,7 @@ Statewide electricity consumption growth for the residential sector was `r state
import {tidy, groupBy, rename, summarize, sum, mutate, select, n, nDistinct, mean, filter, pivotWider, pivotLonger, leftJoin, slice, fullJoin, lag, TMath, rowNumber,mutateWithSummary, arrange, asc} from "@pbeshai/tidyjs"
// Import the consumption data
consumption_data = FileAttachment("data/working/consumption/consumption_long.csv").csv({ typed: true })
consumption_data = FileAttachment("data/final_data/consumption.csv").csv({ typed: true })
// Condense the data for regional plotting
regional_consumption_data = tidy(
Expand Down
16 changes: 8 additions & 8 deletions data.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Individual tables can be downloaded here as text files (CSV, comma-separated val

```{ojs}
capacity_wide_description = metadata.resources[0].description;
capacity_wide_raw = FileAttachment("data/working/capacity/capacity_wide.csv").csv({typed: true});
capacity_wide_raw = FileAttachment("data/final_data/capacity.csv").csv({typed: true});
capacity_wide = tidy(capacity_wide_raw,
filter((d) => d.year < 2020))
Expand Down Expand Up @@ -62,7 +62,7 @@ button(capacity_wide, `capacity.csv`, `Capacity`)

```{ojs}
net_generation_wide_description = metadata.resources[2].description
net_generation_wide_raw = FileAttachment("data/working/generation/net_generation_wide.csv").csv({typed: true});
net_generation_wide_raw = FileAttachment("data/final_data/generation.csv").csv({typed: true});
net_generation_wide = tidy(net_generation_wide_raw,
filter((d) => d.year < 2020))
Expand All @@ -85,8 +85,8 @@ Inputs.table(generation_input);
:::
::: {.column width="80%"}
```{ojs}
button(net_generation_wide_metadata, 'net_generation_wide_metadata.csv', `Generation Metadata`)
button(net_generation_wide, `net_generation_wide.csv`, `Net Generation`)
button(net_generation_wide_metadata, 'net_generation_metadata.csv', `Generation Metadata`)
button(net_generation_wide, `generation.csv`, `Net Generation`)
```
:::
:::
Expand All @@ -99,7 +99,7 @@ button(net_generation_wide, `net_generation_wide.csv`, `Net Generation`)

```{ojs}
consumption_wide_description = metadata.resources[4].description
consumption_wide_raw = FileAttachment("data/working/consumption/consumption_wide.csv").csv({typed: true});
consumption_wide_raw = FileAttachment("data/final_data/consumption.csv").csv({typed: true});
consumption_wide = tidy(consumption_wide_raw,
filter((d) => d.year < 2020))
Expand Down Expand Up @@ -138,7 +138,7 @@ button(consumption_wide, `consumption_wide.csv`, `Consumption`)

```{ojs}
prices_description = metadata.resources[6].description;
prices_raw = FileAttachment("data/working/prices/prices.csv").csv({typed: true});
prices_raw = FileAttachment("data/final_data/prices.csv").csv({typed: true});
prices = tidy(prices_raw,
filter((d) => d.year < 2020))
Expand Down Expand Up @@ -177,7 +177,7 @@ button(prices, `prices.csv`, `Prices`);

```{ojs}
weighted_prices_description = metadata.resources[7].description;
weighted_prices_raw = FileAttachment("data/working/prices/weighted_prices.csv").csv({typed: true});
weighted_prices_raw = FileAttachment("data/final_data/weighted_prices.csv").csv({typed: true});
weighted_prices = tidy(weighted_prices_raw,
filter((d) => d.year < 2020))
Expand Down Expand Up @@ -217,7 +217,7 @@ d3 = require("d3@7")
import {tidy, groupBy, rename, summarize, sum, mutate, select, n, nDistinct, mean, filter, pivotWider, pivotLonger, leftJoin, slice} from "@pbeshai/tidyjs"
// load metadata
metadata = FileAttachment("data/metadata.json").json();
metadata = FileAttachment("data/final_data/metadata.json").json();
```

Expand Down
1 change: 0 additions & 1 deletion data/final/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0ce3d45

Please sign in to comment.