-
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 #18 from NICD-UK/script-templates
Script templates
- Loading branch information
Showing
32 changed files
with
264 additions
and
179 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
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,14 +1,19 @@ | ||
# .venv directory | ||
/.venv/ | ||
# venv directory | ||
/venv/* | ||
/renv/* | ||
!renv/activate.R | ||
|
||
# data directory | ||
/data/clean/* | ||
/data/model/* | ||
/data/raw/* | ||
/data/wrangle/* | ||
|
||
# notebooks directory | ||
/notebooks/* | ||
# models directory | ||
/models/* | ||
|
||
# directory structure | ||
!.gitkeep | ||
|
||
# presentation files | ||
/presentations/*.html | ||
/presentations/*_files/ |
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 @@ | ||
.PHONY: all venv save load git | ||
|
||
################################################################################# | ||
# COMMANDS # | ||
################################################################################# | ||
|
||
all: venv save git | ||
|
||
venv: | ||
python3 -m venv venv | ||
venv/bin/pip install --upgrade pip | ||
venv/bin/pip install ipykernel | ||
venv/bin/pip install pandas | ||
venv/bin/pip install pathlib | ||
venv/bin/pip install ydata-profiling | ||
|
||
save: | ||
venv/bin/pip freeze > requirements.txt | ||
|
||
load: | ||
venv/bin/pip install -r requirements.txt | ||
|
||
git: | ||
git init | ||
git add --all | ||
git commit -m "initial commit" |
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 @@ | ||
.PHONY: all venv save load git | ||
|
||
################################################################################# | ||
# COMMANDS # | ||
################################################################################# | ||
|
||
all: venv save git | ||
|
||
venv: | ||
Rscript -e 'install.packages("renv", repos = "https://cloud.r-project.org/")' | ||
Rscript -e 'renv::init(bare = TRUE)' | ||
Rscript -e 'renv::install("dlookr")' | ||
Rscript -e 'renv::install("glue")' | ||
Rscript -e 'renv::install("here")' | ||
Rscript -e 'renv::install("readr")' | ||
|
||
save: | ||
Rscript -e 'renv::snapshot()' | ||
|
||
load: | ||
Rscript -e 'renv::restore()' | ||
|
||
git: | ||
git init | ||
git add --all | ||
git commit -m "initial commit" |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
{{cookiecutter.project_directory_name}}/presentations/01-presentation.qmd
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,7 @@ | ||
--- | ||
title: "Presentation" | ||
author: "{{cookiecutter.project_manager_name}}" | ||
format: revealjs | ||
--- | ||
|
||
## Introduction |
Empty file.
22 changes: 22 additions & 0 deletions
22
{{cookiecutter.project_directory_name}}/reports/clean/01-describe.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,22 @@ | ||
# Load Libraries | ||
```{r message=FALSE} | ||
library(dlookr) | ||
library(glue) | ||
library(here) | ||
library(readr) | ||
``` | ||
|
||
# Setup | ||
```{r} | ||
data_name <- "<data-name>" | ||
``` | ||
|
||
# Read Data | ||
```{r} | ||
clean_data <- read_rds(here(glue("data/clean/{data_name}.rds"))) | ||
``` | ||
|
||
# Describe Data | ||
```{r} | ||
diagnose_web_report(clean_data) | ||
``` |
15 changes: 15 additions & 0 deletions
15
{{cookiecutter.project_directory_name}}/reports/clean/01-describe.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,15 @@ | ||
#%% Load Libraries | ||
import pandas | ||
from pathlib import Path | ||
from ydata_profiling import ProfileReport | ||
|
||
#%% Setup | ||
root_path = Path(__file__).parent.parent.parent | ||
data_name = "<data-name>" | ||
|
||
#%% Read Data | ||
clean_data = pandas.read_pickle(root_path / f"data/clean/{data_name}.pkl") | ||
|
||
#%% Describe Datadata | ||
profile = ProfileReport(clean_data, title="Description Report") | ||
profile.to_notebook_iframe() |
10 changes: 0 additions & 10 deletions
10
{{cookiecutter.project_directory_name}}/reports/clean/clean.py
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
22 changes: 22 additions & 0 deletions
22
{{cookiecutter.project_directory_name}}/reports/wrangle/01-explore.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,22 @@ | ||
# Load Libraries | ||
```{r message=FALSE} | ||
library(dlookr) | ||
library(glue) | ||
library(here) | ||
library(readr) | ||
``` | ||
|
||
# Setup | ||
```{r} | ||
data_name <- "<data-name>" | ||
``` | ||
|
||
# Read Data | ||
```{r} | ||
wrangle_data <- read_rds(here(glue("data/wrangle/{data_name}.rds"))) | ||
``` | ||
|
||
# Explore Data | ||
```{r} | ||
eda_web_report(wrangle_data) | ||
``` |
15 changes: 15 additions & 0 deletions
15
{{cookiecutter.project_directory_name}}/reports/wrangle/01-explore.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,15 @@ | ||
#%% Load Libraries | ||
import pandas | ||
from pathlib import Path | ||
from ydata_profiling import ProfileReport | ||
|
||
#%% Setup | ||
root_path = Path(__file__).parent.parent.parent | ||
data_name = "<data-name>" | ||
|
||
#%% Read Data | ||
wrangle_data = pandas.read_pickle(root_path / f"data/wrangle/{data_name}.pkl") | ||
|
||
#%% Explore Data | ||
profile = ProfileReport(wrangle_data, title="Exploration Report") | ||
profile.to_notebook_iframe() |
Oops, something went wrong.