Skip to content

Commit

Permalink
Avoid clobbering env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
greenape committed Jan 24, 2023
1 parent 5739442 commit 70007c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- Quickstart script now supports arbitrary countries via `COUNTRY` env var. [#5796](https://github.com/Flowminder/FlowKit/issues/5796)
- Quickstart script now supports arbitrary countries via `EXAMPLE_COUNTRY` env var. [#5796](https://github.com/Flowminder/FlowKit/issues/5796)

## 1.18.0

Expand Down
6 changes: 3 additions & 3 deletions docs/source/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ bash <(curl -s https://raw.githubusercontent.com/Flowminder/FlowKit/master/quick

to get the examples with the larger dataset (the one used when producing this documentation).

You can also explore FlowKit using synthetic data for other countries, by setting the `COUNTRY` environment variable to a three-level ISO country code, for example to simulate data for the UK with a crisis in Greater London:
You can also explore FlowKit using synthetic data for other countries, by setting the `EXAMPLE_COUNTRY` environment variable to a three-level ISO country code, for example to simulate data for the UK with a crisis in Greater London:

```bash
COUNTRY=GBR DISASTER_REGION_PCOD=GBR.1.36_1 bash <(curl -s https://raw.githubusercontent.com/Flowminder/FlowKit/master/quick_start.sh) examples
EXAMPLE_COUNTRY=GBR EXAMPLE_DISASTER_REGION_PCOD=GBR.1.36_1 bash <(curl -s https://raw.githubusercontent.com/Flowminder/FlowKit/master/quick_start.sh) examples
```

Available countries are those with boundaries in the [GADM 3.6](https://gadm.org/download_country36.html) dataset. Possible values for `DISASTER_REGION_PCOD` are any admin2 region for the corresponding country, based on the `GID_2` field in the GADM 3.6 shapefile for that country.
Available countries are those with boundaries in the [GADM 3.6](https://gadm.org/download_country36.html) dataset. Possible values for `EXAMPLE_DISASTER_REGION_PCOD` are any admin2 region for the corresponding country, based on the `GID_2` field in the GADM 3.6 shapefile for that country.

!!! info
The small dataset is sufficient for most of the worked examples, but the larger dataset is required for the [Flows Above Normal](analyst/worked_examples/flows-above-normal.ipynb) example because this uses data for dates outside the range included in the small dataset.
Expand Down
2 changes: 2 additions & 0 deletions quick_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ then
$DOCKER_COMPOSE down -v
else
source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/Flowminder/FlowKit/${GIT_REVISION}/development_environment)"
export COUNTRY=${EXAMPLE_COUNTRY:-$COUNTRY}
export DISASTER_REGION_PCODE=${EXAMPLE_DISASTER_REGION_PCODE:-$DISASTER_REGION_PCODE}
echo "Starting containers (this may take a few minutes)"
RUNNING=`$DOCKER_COMPOSE ps -q flowdb flowapi flowmachine flowauth flowmachine_query_locker $WORKED_EXAMPLES`
if [[ "$RUNNING" != "" ]]; then
Expand Down

0 comments on commit 70007c5

Please sign in to comment.