-
Notifications
You must be signed in to change notification settings - Fork 7
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
Closed
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a24f119
Merge content from main repo using Macro include_files
e-lo 74b02d9
[ actually include the macros ]
e-lo 9db30a9
Add Examples
e-lo 7fdddfe
first hack at creating random example data
e-lo dba9e26
Initial example data.
e-lo eaa009a
Update Based on Comments
e-lo af15c9a
update validate-data workflow to match datapackage.json
e-lo c0acbd1
Merge branch 'main' into issue-40-validate-example-data
e-lo bcc5a0f
Merge upstream into issue-40-validate-example-data
e-lo 3532b15
Clean up merge fails
e-lo 53a05b9
Responses to comments
e-lo 3aadfea
Fix validate CLI call
e-lo 9661da0
Responses to comments
e-lo 5332619
Removed pandas from markdown table writing
e-lo e05cd3c
pre-commit
e-lo 053e986
Delete validate-data.yml
e-lo 7981308
Remove template directory
e-lo b6c52e5
remove template folder
e-lo 20b1a97
Update sample creation instructions to remove template and CI refs
e-lo 12c746c
Add workflows for samples
e-lo 75c7e98
data --> samples
e-lo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,25 @@ | ||
| name: Validate-Samples | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'samples/*/TIDES/*' | ||
| - 'spec/*' | ||
| pull_request: | ||
| paths: | ||
| - 'samples/*/TIDES/*' | ||
| - 'spec/*' | ||
| workflow_dispatch: | ||
| create: | ||
|
|
||
| jobs: | ||
| validate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| - name: Validate sample data | ||
| uses: frictionlessdata/repository@v2 | ||
| with: | ||
| packages: "samples/*/TIDES/datapackage.json" | ||
|
|
||
This file contains hidden or 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,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 |
This file contains hidden or 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 hidden or 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 hidden or 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 +1 @@ | ||
| # Contributors | ||
| # Contributors |
This file contains hidden or 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 +1,3 @@ | ||
| {{ include_file('README.md', downshift_h1= False) }} | ||
| # TIDES Transit Specification Suite | ||
|
|
||
| {{ include_file('README.md', start_line = 2, downshift_h1= False) }} |
This file contains hidden or 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,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') }} |
This file contains hidden or 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 hidden or 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 hidden or 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,2 +1,2 @@ | ||
| -r docs/requirements.txt | ||
| pre-commit | ||
| -r docs/requirements.txt |
This file contains hidden or 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,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. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is there any way to pass
--schema-syncto this action? Otherwise it will fail when option fields are left out of the csvs.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.
looking into it