Skip to content

Commit

Permalink
Move to storing test narratives in the auspice repo
Browse files Browse the repository at this point in the history
This commit signifies a shift to storing a set of narrative files in this repo, as opposed to obtaining the nextstrain.org narratives via a script.

The Nextstrain.org narratives are still obtainable (they are all stored in their own github repo) and the docs have been updated to show this.

By storing and maintaining "test narratives" in the auspice repo we can both provide examples of the capability of narratives and use them to test functionality and fix bugs. As the are stored in the `narratives` directory, they are available via Nextstrain Community URLs at nextstrain.org/community/narratives/nextstrain/auspice/...
  • Loading branch information
jameshadfield committed Jun 16, 2020
1 parent dd5e458 commit b2a347a
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 43 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run get-data
- run: npm run get-narratives
- run: npm run smoke-test:ci
lint:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ big_flu
/static/
s3/
/local_narratives/
/narratives/
/datasets/
**/__diff_output__

Expand Down
4 changes: 2 additions & 2 deletions DEV_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Run `npm run lint`. If there are issues run `npm run lint:fix`.

> For integration tests to work, you'll need to have `git-lfs` installed (see below) as it stores the images that the snapshot tests will use.
1. Fetch the datasets with `npm run get-data` and `npm run get-narratives`.
1. Fetch the datasets with `npm run get-data`.
2. Ensure you are **not** currently running the site locally, then run `npm run integration-test:ci`.


Expand All @@ -60,7 +60,7 @@ Run `npm run lint`. If there are issues run `npm run lint:fix`.

#### For smoke tests

1. Fetch the datasets with `npm run get-data` and `npm run get-narratives`.
1. Fetch the datasets with `npm run get-data`.
2. Ensure you are **not** currently running the site locally, then run `npm run smoke-test:ci`.


Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,16 @@ If you've installed auspice from source, we have helper scripts to make all the
```bash
# from the auspice src directory
npm run get-data
npm run get-narratives
```

### Obtain narratives to view locally

This repository contains a number of "test narratives" which serve both to provide examples of the capability of narratives, as well as being used to test functionality and fix bugs.
These should work out of the box, assuming you have obtained the necessary datasets via the above script.

If you wish to view the [nextstrain-maintained narratives](https://nextstrain.org/docs/contributing/sharing-data), then this can be done by checking out the [nextstrain/narratives github repo](github.com/nextstrain/narratives) and telling `auspice` to look for narratives there via the `--narrativeDir` argument.


### Run auspice

```bash
Expand Down
8 changes: 4 additions & 4 deletions docs-src/docs/introduction/how-to-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ For narratives, please see [Writing a Narrative](narratives/how-to-write.md) for

## Obtaining a Set of Input Files

If you'd like to download the datasets and narratives on [nextstrain.org](https://nextstrain.org) then there are two scripts which allow you to do this:
If you'd like to download the dataset JSONs which are behind the core-datasets shown on [nextstrain.org](https://nextstrain.org), then you can run [this script](https://github.com/nextstrain/auspice/blob/master/scripts/get-data.sh) which will create a `./data` directory for you.

* You can download the dataset JSONs by running [this script](https://github.com/nextstrain/auspice/blob/master/scripts/get-data.sh) which will create a `./data` directory for you.
* You can download the narrative Markdown files by running [this script](https://github.com/nextstrain/auspice/blob/master/scripts/get-narratives.sh) which will create a `./narratives` directory for you.
The nextstrain-maintained narratives are stored in the [nextstrain/narratives github repo](github.com/nextstrain/narratives).
You can obtain these by cloning that repo.

You can then run `auspice view --datasetDir data --narrativeDir narratives` to visualise all of the [nextstrain.org](https://nextstrain.org) datasets locally.
You can then run `auspice view --datasetDir data --narrativeDir <path-to-narratives>` to visualise all of the [nextstrain.org](https://nextstrain.org) datasets locally.
3 changes: 1 addition & 2 deletions docs-src/docs/introduction/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ auspice build
auspice --version
auspice --help

# Obtain datasets & narratives to view locally (optional)
# Obtain nextstrain.org datasets to view locally (optional)
npm run get-data
npm run get-narratives
```

Updating Auspice should only require pulling the new version from GitHub -- it shouldn't require any `npm` commands.
Expand Down
13 changes: 13 additions & 0 deletions narratives/test_parsing-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: "Example of a narrative which can't be parsed"
date: "June 2020"
dataset: "https://nextstrain.org/zika"
abstract: "This narrative in incorrectly parsed by auspice v2.16.0 (and earlier) such that it doesn't even render."
---

# [Summary](https://nextstrain.org/community/andersen-lab/HCoV-19-Genomics-Nextstrain/hCoV-19/usa/sandiego?c=region&d=tree&legend=open&onlyPanels&p=full&sidebar=closed)

The problem is the following lines -- adding a character(s) to each line following the link syntax fixes the problem.

Table of Contents:
1. [Some link](https://nextstrain.org)
34 changes: 34 additions & 0 deletions narratives/test_simultaneous-tree-updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Simultaneous Updates to Tree State
authors:
- James Hadfield
authorLinks:
- https://twitter.com/hamesjadfield
affiliations: "Fred Hutch"
dataset: "http://localhost:4000/flu/seasonal/h3n2/ha/3y?d=tree"
date: June 2020
abstract: "A narrative to explore simultaneous changes to tree state. The aim is both to reveal what's possible, and to prevent future regressions via automated testing."
---


# [P1: Change color-by to num_date]("http://localhost:4000/flu/seasonal/h3n2/ha/3y?d=tree&c=num_date)
Check that both the branches and tips update.

# [P2: Zoom into clade A1]("http://localhost:4000/flu/seasonal/h3n2/ha/3y?d=tree&c=num_date&label=clade:A1)

# [P3: Zoom into clade A1b _and_ change color]("http://localhost:4000/flu/seasonal/h3n2/ha/3y?d=tree&label=clade:A1b)
Check that the coloring of the branches and tips update as we zoom in.

# [P4: Lots of simultaneous changes](http://localhost:4000/flu/seasonal/h3n2/ha/3y?c=lbi&d=tree&dmin=2017-01-01&f_region=North%20America&label=clade:3c2.A&m=div)
* Zoomed out to near the root (clade 3c2.A)
* Changed the horizontal scale to divergence
* Changed the color-by to LBI (and legend should be open)
* Filtered to North American Samples (i.e. the majority of tips are not visible).
* Time slice excludes pre-2017 samples (note that we don't have the grey overlay here since the axis is divergence)

# [P5: Layout change (and others)](http://localhost:4000/flu/seasonal/h3n2/ha/3y?branchLabel=none&d=tree&l=radial&m=div)
Underneath, this uses a different set of d3 calls where instead of transitioning all elements (branches, tips etc), which is too slow, we do a "in-parts" update: we hide the branches, transition the tips, then redraw the branches in their new position.
This slide should
* switch to radial view
* zoom out to show the entire tree, and remove filters so all tips should be shown
* change the coloring to clade
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"lint": "eslint src",
"lint:fix": "eslint --fix src",
"get-data": "env bash ./scripts/get-data.sh",
"get-narratives": "env bash ./scripts/get-narratives.sh",
"heroku-postbuild": "npm run build && npm run get-data && npm run get-narratives",
"heroku-postbuild": "npm run build && npm run get-data",
"rebuild-docker-image": "env bash ./scripts/rebuild-docker-image.sh",
"gzip-and-upload": "env bash ./scripts/gzip-and-upload.sh",
"build-docs": "echo 'see ./docs-src/README.md'",
Expand Down
30 changes: 0 additions & 30 deletions scripts/get-narratives.sh

This file was deleted.

0 comments on commit b2a347a

Please sign in to comment.