-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add targets for uploading to S3 + repo cleanup #46
Changes from 7 commits
c3e8e22
cf0cf51
8944c58
77b6898
0c7e2b6
a66fe5d
c053514
ec07eff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
# gw-conditions | ||
Similar to gage-conditions-gif but for groundwater! | ||
|
||
### DISCLAIMER: | ||
Show groundwater conditions as little peaks above or below their normal values. | ||
|
||
THE ANALYSIS IN THIS VIZ REPO (AS IT CURRENTLY STANDS 12/23/2020) IS NOT MEANT TO BE FINAL. JUST USED AS AN EXAMPLE OF HOW TO BUILD A VIDEO-BASED DATAVIZ USING SCIPIPER | ||
## Generate the data behind the visualization and push to S3 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a little more context here, like: |
||
This step is not needed to build the visualization locally since the data files are available through a public S3 bucket and can be accessed from `labs.waterdata.usgs.gov/visualizations/data/[FILENAME]`. Run this code if you need to update the data or base SVG behind the visualization. | ||
|
||
### Build the historic data | ||
|
||
The historic data pipeline (`0_historic.yml`) is decoupled from the rest of the pipeline. It will build only when you run `scmake(remake_file = "0_historic.yml")`. Otherwise, the `1_fetch.yml` part of the pipeline will assume the historic data is on S3 ready to use and will download the data using the filepaths described in `0_config.yml`. | ||
The historic data pipeline (`0_historic.yml`) is decoupled from the rest of the pipeline. It will build only when you run `scmake(remake_file = "0_historic.yml")`. Otherwise, the `1_fetch.yml` part of the pipeline will assume the historic data is on S3 ready to use and will download the data using the filepaths described in `0_config.yml`. The historic data is being stored on the developer VPC in the `vizlab-data` bucket but should be moved for public access later if we do a data release. | ||
|
||
### How to build the data behind the viz: | ||
|
||
### How to build the viz: | ||
If you plan to be able to push the final data to S3, you need to have the appropriate S3 configs prepared. The file `lib/cfg/s3_config_viz.yml` expects you to have credentials labeled `[prod]` in your `~/.aws/credentials` file (rather than `[default]`). Also note that any of the targets that call `scipiper::s3_put()` will require you to be on the USGS Network (VPN). If you want to build the data pipeline but don't need to (or can't) push to S3, you can run `options(scipiper.dry_put = TRUE)` and then the code listed below. This will skip the upload step. | ||
|
||
To build, check the `start_date` and `end_date` in `0_config.yml`. Then, run the following and look in your `4_animate/out` folder for the video. | ||
Once your configurations are set up, run the following to generate the data needed by the visualization. | ||
|
||
```r | ||
library(scipiper) | ||
scmake() | ||
``` | ||
|
||
### How to get Climate Response Network data: | ||
In the end the following targets should have been built successfully (because they are what is pushed to S3 and used by the Vue code): | ||
|
||
```r | ||
library(scipiper) | ||
scmake("1_fetch/out/gw_crn_data.rds") | ||
crn_data <- readRDS("1_fetch/out/gw_crn_data.rds") | ||
- `visualizations/data/gw-conditions-time-labels.csv.ind` | ||
- `visualizations/data/gw-conditions-peaks-map.svg` | ||
- `visualizations/data/gw-conditions-wy20.csv.ind` | ||
- `visualizations/data/gw-conditions-site-coords.csv.ind` | ||
- `visualizations/data/gw-conditions-daily-proportions.csv.ind` | ||
|
||
If you change the `viz_start_date` and `viz_end_date` values in `0_config.yml`, you should also change the name of the `visualizations/data/gw-conditions-wy20.csv.ind` file to reflect your new time period. In the future, we would like to do this automatically, but for now it is a manual step. The Vue code that reads that file would also need to be changed. | ||
|
||
## Build the visualization locally | ||
|
||
The data (all CSVs and SVGs) needed for this visualization are already publicly available through `labs.waterdata.usgs.gov/visualizations/data/[FILENAME]`. You should be able open this repo, run the following code chunk, and see the visualization locally (http://localhost:8080/) without needed to build the data pipeline: | ||
|
||
``` | ||
npm install | ||
npm run serve | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and then move this up before we get into how to build the data? I suggest that because it is simpler, but the data part might be what people visiting the repo are more interested in. |
||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: 991b0a39bf0916d45c3e883dba0ab760 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: 5f41027b53594a6cff5007cfe775811a | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: 159c709725092b140fe0b8f3eb37d845 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: 48114fcc5818e5c82ba45c06f0174308 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: aab93b170f7889cbcf92f201b4b47165 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
profile: 'prod' | ||
|
||
bucket: 'water-visualizations-prod-website' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: fe67227f86088061aa01362b2238aae2 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: 002b9812891b9ae2a029fdc2d2c27c5b | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: 45b4cde69f2a691c0e7e92aceab4f0b2 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: 6d325b86933a2852bbbba5e5f7d5ceff | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hash: af9704ef7f518845ef58553900e4ae4e | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dcast
has been one of my most used functions, I'm resistant to the changeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can still use
dcast()
but has to be from thedata.table
package notrehsape2
. The warning I got said the next update would turn it into an error!