-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from NICD-UK/script-templates
Script templates
- Loading branch information
Showing
16 changed files
with
230 additions
and
12 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
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
Empty file.
16 changes: 16 additions & 0 deletions
16
{{cookiecutter.project_directory_name}}/reports/clean/clean.Rmd
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,16 @@ | ||
# Load Libraries | ||
```{r message=FALSE} | ||
library(glue) | ||
library(here) | ||
library(tidyverse) | ||
``` | ||
|
||
# Setup | ||
```{r} | ||
data_name <- "<data-name>" | ||
``` | ||
|
||
# Read Data | ||
```{r} | ||
clean_data <- read_rds(here("data", "clean", glue("{data_name}.rds"))) | ||
``` |
10 changes: 10 additions & 0 deletions
10
{{cookiecutter.project_directory_name}}/reports/clean/clean.py
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,10 @@ | ||
#%% Load Libraries | ||
import pandas | ||
from pyprojroot import here | ||
import os | ||
|
||
#%% Setup | ||
data_name = "<data-name>" | ||
|
||
#%% Read Data | ||
clean_data = pandas.read_pickle(os.path.join(here(), "data", "clean", f"{data_name}.pkl")) |
16 changes: 16 additions & 0 deletions
16
{{cookiecutter.project_directory_name}}/reports/wrangle/wrangle.Rmd
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,16 @@ | ||
# Load Libraries | ||
```{r message=FALSE} | ||
library(glue) | ||
library(here) | ||
library(tidyverse) | ||
``` | ||
|
||
# Setup | ||
```{r} | ||
data_name <- "<data-name>" | ||
``` | ||
|
||
# Read Data | ||
```{r} | ||
wrangle_data <- read_rds(here("data", "wrangle", glue("{data_name}.rds"))) | ||
``` |
10 changes: 10 additions & 0 deletions
10
{{cookiecutter.project_directory_name}}/reports/wrangle/wrangle.py
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,10 @@ | ||
#%% Load Libraries | ||
import pandas | ||
from pyprojroot import here | ||
import os | ||
|
||
#%% Setup | ||
data_name = "<data-name>" | ||
|
||
#%% Read Data | ||
wrangle_data = pandas.read_pickle(os.path.join(here(), "data", "wrangle", f"{data_name}.pkl")) |
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 @@ | ||
# Transformation Checklist | ||
|
||
## Motivation | ||
|
||
## Cleaning Checklist | ||
|
||
For each data source: | ||
|
||
- [ ] read data from `/data/raw/` | ||
- [ ] ... | ||
- [ ] write data to `/data/clean/` | ||
|
||
## Wrangling Checklist | ||
|
||
For each data product: | ||
|
||
- [ ] read data from `/data/clean/` | ||
- [ ] ... | ||
- [ ] write data to `/data/wrangle/` | ||
|
||
## Processing | ||
|
||
For models: | ||
|
||
|
||
|
||
|
||
|
26 changes: 26 additions & 0 deletions
26
{{cookiecutter.project_directory_name}}/src/clean/clean.Rmd
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,26 @@ | ||
# Load Libraries | ||
```{r message=FALSE} | ||
library(glue) | ||
library(here) | ||
library(tidyverse) | ||
``` | ||
|
||
# Setup | ||
```{r} | ||
data_name <- "<data-name>" | ||
``` | ||
|
||
# Read Data | ||
```{r} | ||
raw_data <- read_csv(here("data", "raw", glue("{data_name}.csv"))) | ||
``` | ||
|
||
# Clean Data | ||
```{r} | ||
clean_data <- raw_data | ||
``` | ||
|
||
# Write Data | ||
```{r} | ||
write_rds(clean_data, here("data", "clean", glue("{data_name}.rds"))) | ||
``` |
16 changes: 16 additions & 0 deletions
16
{{cookiecutter.project_directory_name}}/src/clean/clean.py
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,16 @@ | ||
#%% Load Libraries | ||
import pandas | ||
from pyprojroot import here | ||
import os | ||
|
||
#%% Setup | ||
data_name = "<data-name>" | ||
|
||
#%% Read Data | ||
raw_data = pandas.read_csv(os.path.join(here(), "data", "raw", f"{data_name}.csv")) | ||
|
||
#%% Clean Data | ||
clean_data = raw_data | ||
|
||
#%% Write Data | ||
clean_data.to_pickle(os.path.join(here(), "data", "clean", f"{data_name}.pkl")) |
16 changes: 16 additions & 0 deletions
16
{{cookiecutter.project_directory_name}}/src/model/model.Rmd
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,16 @@ | ||
# Load Libraries | ||
```{r message=FALSE} | ||
library(glue) | ||
library(here) | ||
library(tidyverse) | ||
``` | ||
|
||
# Setup | ||
```{r} | ||
data_name <- "<data-name>" | ||
``` | ||
|
||
# Read Data | ||
```{r} | ||
wrangle_data <- read_rds(here("data", "wrangle", glue("{data_name}.rds"))) | ||
``` |
10 changes: 10 additions & 0 deletions
10
{{cookiecutter.project_directory_name}}/src/model/model.py
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,10 @@ | ||
#%% Load Libraries | ||
import pandas | ||
from pyprojroot import here | ||
import os | ||
|
||
#%% Setup | ||
data_name = "<data-name>" | ||
|
||
#%% Read Data | ||
wrangle_data = pandas.read_pickle(os.path.join(here(), "data", "wrangle", f"{data_name}.pkl")) |
26 changes: 26 additions & 0 deletions
26
{{cookiecutter.project_directory_name}}/src/wrangle/wrangle.Rmd
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,26 @@ | ||
# Load Libraries | ||
```{r message=FALSE} | ||
library(glue) | ||
library(here) | ||
library(tidyverse) | ||
``` | ||
|
||
# Setup | ||
```{r} | ||
data_name <- "<data-name>" | ||
``` | ||
|
||
# Read Data | ||
```{r} | ||
clean_data <- read_rds(here("data", "clean", glue("{data_name}.rds"))) | ||
``` | ||
|
||
# Wrangle Data | ||
```{r} | ||
wrangle_data <- clean_data | ||
``` | ||
|
||
# Write Data | ||
```{r} | ||
write_rds(wrangle_data, here("data", "wrangle", glue("{data_name}.rds"))) | ||
``` |
16 changes: 16 additions & 0 deletions
16
{{cookiecutter.project_directory_name}}/src/wrangle/wrangle.py
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,16 @@ | ||
#%% Load Libraries | ||
import pandas | ||
from pyprojroot import here | ||
import os | ||
|
||
#%% Setup | ||
data_name = "<data-name>" | ||
|
||
#%% Read Data | ||
clean_data = pandas.read_pickle(os.path.join(here(), "data", "clean", f"{data_name}.pkl")) | ||
|
||
#%% Clean Data | ||
wrangle_data = clean_data | ||
|
||
#%% Write Data | ||
wrangle_data.to_pickle(os.path.join(here(), "data", "wrangle", f"{data_name}.pkl")) |
13 changes: 13 additions & 0 deletions
13
{{cookiecutter.project_directory_name}}/{{cookiecutter.project_directory_name}}.Rproj
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,13 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: No | ||
SaveWorkspace: No | ||
AlwaysSaveHistory: No | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX |