-
Notifications
You must be signed in to change notification settings - Fork 8
Pr2 sample data add workflow #101
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
Changes from 20 commits
a24f119
74b02d9
9db30a9
7fdddfe
dba9e26
eaa009a
af15c9a
c0acbd1
bcc5a0f
3532b15
53a05b9
3aadfea
9661da0
5332619
e05cd3c
053e986
7981308
b6c52e5
20b1a97
12c746c
75c7e98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Validate-Samples | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'data/*/TIDES/*' | ||
| - 'spec/*' | ||
| pull_request: | ||
| paths: | ||
| - 'data/*/TIDES/*' | ||
| - 'spec/*' | ||
| workflow_dispatch: | ||
| create: | ||
|
|
||
| jobs: | ||
| validate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| - name: Validate data | ||
| uses: frictionlessdata/repository@v2 | ||
|
Contributor
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. Is there any way to pass
Contributor
Author
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. looking into it |
||
| with: | ||
| packages: "data/*/TIDES/datapackage.json" | ||
|
Contributor
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.
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| .DS_Store* | ||
| .vscode* | ||
| /__pycache__/* | ||
| .env | ||
| /venv* | ||
| /site | ||
| /__pycache__ | ||
| /site/* | ||
| # pages that are copied in from main repo | ||
| /docs/CONTRIBUTING.md | ||
| /docs/CODE_OF_CONDUCT.md | ||
| /docs/README.md | ||
| # pages that are generated from templates | ||
| /docs/tables.md | ||
| /docs/architecture.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| # Contributors | ||
| # Contributors |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| {{ include_file('README.md', downshift_h1= False) }} | ||
| # TIDES Transit Specification Suite | ||
|
|
||
| {{ include_file('README.md', start_line = 2, downshift_h1= False) }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Sample Data | ||
|
|
||
| Sample data can be found in the `/samples` directory, with one directory for each data sample. | ||
|
|
||
| {{ include_file('samples/README.md')}} | ||
|
|
||
| ## Data List | ||
|
|
||
| {{ list_samples('samples') }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| -r docs/requirements.txt | ||
| pre-commit | ||
| -r docs/requirements.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Data Directory Organization | ||
|
|
||
| Each TIDES Data Package example should follow the following directory structure, consistent with the structure of the [Frictionless Data Package specification](https://specs.frictionlessdata.io/data-package/), including: | ||
|
|
||
| ``` | ||
| unique-example-name | ||
| \TIDES # Required. Data to be validated against the TIDES specification | ||
| \datapackage.json # Required. Data package metadata per https://specs.frictionlessdata.io/data-package/ | ||
| \raw # Optional. Data which the agency uses to create TIDES data | ||
| \scripts # Optional. Scripts used to transform raw --> TIDES | ||
| ``` | ||
|
|
||
| ## Adding Examples | ||
|
|
||
| We encourage the addition of examples, but please follow the following guidelines: | ||
|
|
||
| 1. *No large files* This isn't the place to store your data, rather to document some minimal examples. The recommended size is 100-1000 records per file, more if absolutely required to reproduce an issue with the spec. All individual files should be well under 50 MB. | ||
| 2. *Include Metadata* as specified in [`datapackage.json`](#data-package). | ||
| 3. *Include a README.md* in the base folder of your example with an overview so that it can be included in the documentation. | ||
|
|
||
| ## Data Package | ||
|
|
||
| TIDES data packages must include a [`datapackage.json`](https://specs.frictionlessdata.io/data-package/). Key information to include in [`datapackage.json`](https://specs.frictionlessdata.io/data-package/) includes: | ||
|
|
||
| | **Field** | **Description** | **Required** | | ||
| | --------- | --------------- | ------------ | | ||
| | `title` | A human-readable title. | Required | | ||
| | `name` | Identifier string as a URL-friendly slug. | Required | | ||
| | `description` | Short description of data package. | Recommended | | ||
| | `agency` | Transit agency name. | Recommended | | ||
| | `ntd_id` | ID for the National Transit Database. | Recommended | | ||
| | `profile` | Should be `tabular-data-package` | Required | | ||
| | `licenses` | Should be `[{"name": "Apache-2.0"}]` to be consistent with this repository | Required | | ||
| | `contributors` | Array of data contributors `[{"title": "My Name", "github": "my_handle", "email": "me@myself.com"}]` | Recommended | | ||
| | `maintainers` | Array of data maintainers `[{"title": "My Name", "github": "my_handle", "email": "me@myself.com"}]` | Recommended | | ||
| | `resources` | Array of data files included in your package, formated as a [`tabular-data-resource`](#data-resource)| Required | | ||
|
|
||
| ### Data Resource | ||
|
|
||
| Key fields for each [`tabular-data-resource`](https://specs.frictionlessdata.io/tabular-data-resource/) are as follows: | ||
|
|
||
| | **Field** | **Description** | **Required** | | ||
| | --------- | --------------- | ------------ | | ||
| | `name` | Short sluggable name used to refer to data in this file. | Required | | ||
| | `path` | Path of the data resource file relative to the `datapackage.json` | Required | | ||
| | `schema` | Data schema to use to valdiate the data resource to | Required | | ||
| | `sources` | Array of data sources formatted as a [`source`](#data-source) | Recommended | | ||
|
|
||
| ### Data Source | ||
|
|
||
| | **Field** | **Description** | **Required** | | ||
| | --------- | --------------- | ------------ | | ||
| | `title` | Description of the data source. | Required | | ||
| | `component` | What technology component was used to generate this data (directly or indirectly)? Examples include `AVL`, `APC`, `AFC`, etc. | Recommended | | ||
| | `product` | What product was used to generate this data (directly or indirectly)? | Recommended | | ||
| | `vendor` | What company makes this product? | Recommended | | ||
|
|
||
| ## Data validation | ||
|
|
||
| Data with a valid [`datapackage.json`](#data-package) can be easily validated using the [frictionless framework](https://framework.frictionlessdata.io/), which can be installed and invoke as follows: | ||
|
|
||
| ```bash | ||
| pip install frictionless | ||
| frictionless validate path/to/your/datapackage.json | ||
| ``` | ||
|
|
||
| ### Specific files | ||
|
|
||
| Specific files can be validated by running the frictionless framework against them and their corresponding schemas as follows: | ||
|
|
||
| ```sh | ||
| frictionless validate vehicles.csv --schema https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicles.schema.json | ||
| ``` | ||
| ### Continuous Data Validation | ||
|
|
||
| Example data in the `\TIDES` subdirectories is validated upon a push action to the main repository according to the `TIDES` schema posted to the `main` branch. |
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.
I think
data/*/TIDES/*needs to besamples/*/TIDES/*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.
Not sure why? this is just tiering off of other files that are already there - shouldn't be adding anything else.
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.
This PR makes changes also proposed in #100, but should be independent or "stacked" on that PR, otherwise you'll be resolving merge conflicts when trying to merge this PR. Additionally, all files except
validate_samples.ymlare irrelevant to the purpose of this PR!