Skip to content

Commit

Permalink
Remove strict requirement for valid axis units
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Feb 2, 2022
1 parent 40a15df commit 95c20ed
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 40 deletions.
40 changes: 1 addition & 39 deletions 0.4/schemas/image.schema
Original file line number Diff line number Diff line change
Expand Up @@ -137,45 +137,7 @@
},
"type": {
"type": "string",
"enum": ["space"]
},
"units": {
"type": "string",
"enum": [
"angstrom", "attometer", "centimeter", "decimeter", "exameter", "femtometer", "foot", "gigameter", "hectometer", "inch", "kilometer", "megameter", "meter", "micrometer", "mile", "millimeter", "nanometer", "parsec", "petameter", "picometer", "terameter", "yard", "yoctometer", "yottameter", "zeptometer", "zettameter"
]
}
},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["time"]
},
"units": {
"type": "string",
"enum": [
"attosecond", "centisecond", "day", "decisecond", "exasecond", "femtosecond", "gigasecond", "hectosecond", "hour", "kilosecond", "megasecond", "microsecond", "millisecond", "minute", "nanosecond", "petasecond", "picosecond", "second", "terasecond", "yoctosecond", "yottasecond", "zeptosecond", "zettasecond"
]
}
},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["channel"]
"enum": ["channel", "time", "space"]
}
},
"required": ["name", "type"]
Expand Down
3 changes: 2 additions & 1 deletion 0.4/tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

def files():
return list(glob.glob(f"examples/valid/*.json")) + \
list(glob.glob(f"examples/valid_if_not_strict/*.json")) + \
list(glob.glob(f"examples/invalid/*.json"))

def ids():
Expand All @@ -18,7 +19,7 @@ def ids():
@pytest.mark.parametrize("testfile", files(), ids=ids())
def test_json(testfile):

if "invalid" in testfile:
if "examples/invalid/" in testfile:
with pytest.raises(ValidationError):
json_schema(testfile)
else:
Expand Down

0 comments on commit 95c20ed

Please sign in to comment.