Skip to content

Commit

Permalink
add CI test (#379)
Browse files Browse the repository at this point in the history
* * add compound type support
* add uint type
* add titles
* add workflow (#380)
  • Loading branch information
bendichter authored Apr 17, 2020
1 parent 24fba61 commit 25f1312
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 8 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Python application

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install hdmf
run: |
pip install git+https://github.com/hdmf-dev/hdmf.git
- name: Validate schema specification
run: |
validate_hdmf_spec core -m nwb.schema.json
85 changes: 77 additions & 8 deletions nwb.schema.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,64 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "NWB.schema.json",
"$id": "nwb.schema.json",
"title": "Schema for the NWB language specification",
"description": "A schema for validating NWB YAML files",
"description": "A schema for validating NWB YAML files and NWB extensions",
"version": "2.0.2",
"type": "object",
"additionalProperties": false,
"properties": {
"groups": {"$ref": "#/definitions/groups"},
"attributes": {"$ref": "#/definitions/attributes"},
"datasets": {"$ref": "#/definitions/datasets"},
"links": {"$ref": "#/definitions/links"}
"links": {"$ref": "#/definitions/links"},
"namespaces": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"version",
"author",
"contact"
],
"properties": {
"name": {"type": "string"},
"version": {"type": "string", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"},
"doc": {"type": "string"},
"author": {"type": "array", "items": {"type": "string"}},
"contact": {"type": "array", "items": {"type": "string", "format": "email"}},
"full_name": {"type": "string"},
"date": {"type": "string", "format": "date"},
"schema": {
"type": "array",
"items": {
"type": "object",
"oneOf": [
{"required": ["namespace"]},
{"required": ["source"]}
],
"properties": {
"namespace": {"type": "string"},
"doc": {"type": "string"},
"source": {"type": "string"},
"title": {"type": "string"},
"neurodata_types": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
},
"definitions": {
"protectedString": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"quantity": {
Expand All @@ -35,7 +81,7 @@
}
]
},
"dtype": {
"flat_dtype": {
"description": "Required string describing the data type of the attribute",
"anyOf": [
{
Expand All @@ -51,22 +97,28 @@
"int32",
"int16",
"int8",
"uint",
"uint32",
"uint16",
"uint8",
"uint64",
"numeric",
"text",
"utf",
"utf8",
"unt-8",
"utf-8",
"ascii",
"bool",
"isodatetime"
]
},
{
"$ref": "#/definitions/ref_dtype"
}
{"$ref": "#/definitions/ref_dtype"}
]
},
"dtype": {
"anyOf": [
{"$ref": "#/definitions/flat_dtype"},
{"$ref": "#/definitions/compound_dtype"}
]
},
"dims": {
Expand Down Expand Up @@ -107,6 +159,7 @@
}
},
"ref_dtype": {
"type": "object",
"required": ["target_type", "reftype"],
"properties": {
"target_type": {
Expand All @@ -120,10 +173,23 @@
}
}
},
"compound_dtype": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "doc", "dtype"],
"properties": {
"name": {"$ref": "#/definitions/protectedString"},
"doc": {"type": "string"},
"dtype": {"$ref": "#/definitions/flat_dtype"}
}
}
},
"groups": {
"description": "list of groups",
"type": "array",
"items": {
"title": "group",
"type": "object",
"required": ["doc"],
"additionalProperties": false,
Expand All @@ -150,6 +216,7 @@
"attributes": {
"type": "array",
"items": {
"title": "attribute",
"type": "object",
"required": ["doc"],
"additionalProperties": false,
Expand All @@ -168,6 +235,7 @@
"links": {
"type": "array",
"items": {
"title": "link",
"type": "object",
"required": ["target_type", "doc"],
"additionalProperties": false,
Expand All @@ -182,6 +250,7 @@
"datasets": {
"type": "array",
"items": {
"title": "dataset",
"type": "object",
"required": ["doc"],
"additionalProperties": false,
Expand Down

0 comments on commit 25f1312

Please sign in to comment.