Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.DEFAULT_GOAL := all

JSONSCHEMA ?= ./node_modules/@sourcemeta/jsonschema/npm/cli.js
JQ ?= jq
SHELLCHECK ?= shellcheck
MKDIRP ?= mkdir -p
NODE ?= node
NPM ?= npm
TIME ?= time
Expand Down
11 changes: 11 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/arcminute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Arcminute",
"description": "A non-SI unit of plane angle accepted for use with the SI. One arcminute is equal to (1/60) degree or (pi/10800) radians",
"examples": [ 0, 1, 30, 60, -30, 15.5 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "(pi/10800) rad",
"x-symbol": "′",
"type": "number"
}
11 changes: 11 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/arcsecond.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Arcsecond",
"description": "A non-SI unit of plane angle accepted for use with the SI. One arcsecond is equal to (1/60) arcminute or (pi/648000) radians",
"examples": [ 0, 1, 30, 60, -30, 15.5 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "(pi/648000) rad",
"x-symbol": "″",
"type": "number"
}
12 changes: 12 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/astronomical-unit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Astronomical Unit",
"description": "A non-SI unit of length accepted for use with the SI. One astronomical unit is a conventional unit of length approximately equal to the mean Earth-Sun distance. It is defined as exactly 149597870700 metres",
"examples": [ 0, 1, 0.387, 1.524, 5.203, 39.5 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "149597870700 m",
"x-symbol": "au",
"type": "number",
"minimum": 0
}
12 changes: 12 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/dalton.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Dalton",
"description": "A non-SI unit of mass accepted for use with the SI. One dalton is equal to (1/12) of the mass of an unbound neutral carbon-12 atom in its nuclear and electronic ground state. It is approximately 1.660 539 066 60 x 10^-27 kg",
"examples": [ 1, 12, 16, 18, 28, 44, 180.16 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "1.660539066605e-27 kg",
"x-symbol": "Da",
"type": "number",
"minimum": 0
}
12 changes: 12 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/day.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Day",
"description": "A non-SI unit of time accepted for use with the SI. One day is equal to 24 hours or 86400 seconds",
"examples": [ 0, 1, 7, 30, 365, 0.5, 1.5 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "86400 s",
"x-symbol": "d",
"type": "number",
"minimum": 0
}
11 changes: 11 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/degree.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Degree",
"description": "A non-SI unit of plane angle accepted for use with the SI. One degree is equal to (pi/180) radians",
"examples": [ 0, 45, 90, 180, 360, -90, -180, 37.7749 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "(pi/180) rad",
"x-symbol": "°",
"type": "number"
}
12 changes: 12 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/electronvolt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Electronvolt",
"description": "A non-SI unit of energy accepted for use with the SI. One electronvolt is the kinetic energy acquired by an electron in passing through a potential difference of one volt in vacuum. It is equal to approximately 1.602 176 634 x 10^-19 joules",
"examples": [ 0, 1, 13.6, 511000, 1000000, 1e+9 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "1.602176634e-19 J",
"x-symbol": "eV",
"type": "number",
"minimum": 0
}
12 changes: 12 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/hectare.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Hectare",
"description": "A non-SI unit of area accepted for use with the SI. One hectare is equal to 10000 square metres",
"examples": [ 0, 1, 10, 100, 0.5, 2.5 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "10000 m^2",
"x-symbol": "ha",
"type": "number",
"minimum": 0
}
12 changes: 12 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/hour.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Hour",
"description": "A non-SI unit of time accepted for use with the SI. One hour is equal to 60 minutes or 3600 seconds",
"examples": [ 0, 1, 6, 12, 24, 1.5, 0.5 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "3600 s",
"x-symbol": "h",
"type": "number",
"minimum": 0
}
13 changes: 13 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/litre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Litre",
"description": "A non-SI unit of volume accepted for use with the SI. One litre is equal to one cubic decimetre (0.001 cubic metres)",
"examples": [ 0, 1, 0.5, 2, 1.5, 100, 0.25 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "0.001 m^3",
"x-symbol": "l",
"x-symbol-alt": "L",
"type": "number",
"minimum": 0
}
12 changes: 12 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/minute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Minute",
"description": "A non-SI unit of time accepted for use with the SI. One minute is equal to 60 seconds",
"examples": [ 0, 1, 5, 30, 60, 90, 1.5 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "60 s",
"x-symbol": "min",
"type": "number",
"minimum": 0
}
12 changes: 12 additions & 0 deletions schemas/2020-12/bipm/si/2019/non-si/unit/tonne.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Tonne",
"description": "A non-SI unit of mass accepted for use with the SI. One tonne is equal to 1000 kilograms",
"examples": [ 0, 1, 10, 100, 0.5, 2.5 ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.bipm.org/en/publications/si-brochure" ],
"x-si-equivalent": "1000 kg",
"x-symbol": "t",
"type": "number",
"minimum": 0
}
56 changes: 56 additions & 0 deletions test/bipm/si/2019/non-si/unit/arcminute.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/arcminute.json",
"tests": [
{
"description": "Valid - zero",
"data": 0,
"valid": true
},
{
"description": "Valid - one arcminute",
"data": 1,
"valid": true
},
{
"description": "Valid - one degree in arcminutes",
"data": 60,
"valid": true
},
{
"description": "Valid - negative",
"data": -30,
"valid": true
},
{
"description": "Valid - fractional",
"data": 15.5,
"valid": true
},
{
"description": "Invalid type - string",
"data": "30",
"valid": false
},
{
"description": "Invalid type - boolean",
"data": false,
"valid": false
},
{
"description": "Invalid type - null",
"data": null,
"valid": false
},
{
"description": "Invalid type - array",
"data": [],
"valid": false
},
{
"description": "Invalid type - object",
"data": {},
"valid": false
}
]
}
56 changes: 56 additions & 0 deletions test/bipm/si/2019/non-si/unit/arcsecond.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/arcsecond.json",
"tests": [
{
"description": "Valid - zero",
"data": 0,
"valid": true
},
{
"description": "Valid - one arcsecond",
"data": 1,
"valid": true
},
{
"description": "Valid - one arcminute in arcseconds",
"data": 60,
"valid": true
},
{
"description": "Valid - negative",
"data": -30,
"valid": true
},
{
"description": "Valid - fractional",
"data": 15.5,
"valid": true
},
{
"description": "Invalid type - string",
"data": "30",
"valid": false
},
{
"description": "Invalid type - boolean",
"data": false,
"valid": false
},
{
"description": "Invalid type - null",
"data": null,
"valid": false
},
{
"description": "Invalid type - array",
"data": [],
"valid": false
},
{
"description": "Invalid type - object",
"data": {},
"valid": false
}
]
}
61 changes: 61 additions & 0 deletions test/bipm/si/2019/non-si/unit/astronomical-unit.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"target": "../../../../../../schemas/2020-12/bipm/si/2019/non-si/unit/astronomical-unit.json",
"tests": [
{
"description": "Valid - zero",
"data": 0,
"valid": true
},
{
"description": "Valid - Earth-Sun distance",
"data": 1,
"valid": true
},
{
"description": "Valid - Mercury distance",
"data": 0.387,
"valid": true
},
{
"description": "Valid - Mars distance",
"data": 1.524,
"valid": true
},
{
"description": "Valid - Pluto distance",
"data": 39.5,
"valid": true
},
{
"description": "Invalid - negative",
"data": -1,
"valid": false
},
{
"description": "Invalid type - string",
"data": "1",
"valid": false
},
{
"description": "Invalid type - boolean",
"data": false,
"valid": false
},
{
"description": "Invalid type - null",
"data": null,
"valid": false
},
{
"description": "Invalid type - array",
"data": [],
"valid": false
},
{
"description": "Invalid type - object",
"data": {},
"valid": false
}
]
}
Loading