...
  View open merge request
Commits (15)
......@@ -105,7 +105,7 @@ def load_schema(schema_name, version=1):
resolver = jsonschema.RefResolver("file://" + basedir + "/", schema)
# now we load it
return jsonschema.Draft4Validator(schema, resolver=resolver)
return jsonschema.Draft7Validator(schema, resolver=resolver)
def validate(schema_name, data):
......
......@@ -15,11 +15,11 @@
"type": "object",
"properties": {
"schema_version": { "$ref": "common.json#/definitions/schema_version" },
"schema_version": { "$ref": "#/definitions/schema_version" },
"language": { "$ref": "../common/1.json#/definitions/language" },
"description": { "$ref": "../common/1.json#/definitions/description" },
"groups": { "$ref": "common.json#/definitions/block_groups" },
"parameters": { "$ref": "common.json#/definitions/parameters" },
"groups": { "$ref": "#/definitions/block_groups" },
"parameters": { "$ref": "#/definitions/parameters" },
"splittable": { "type": "boolean" },
"uses": { "$ref": "../common/1.json#/definitions/uses" }
},
......@@ -39,12 +39,12 @@
"type": "object",
"properties": {
"schema_version": { "$ref": "common.json#/definitions/schema_version" },
"schema_version": { "$ref": "#/definitions/schema_version" },
"language": { "$ref": "../common/1.json#/definitions/language" },
"description": { "$ref": "../common/1.json#/definitions/description" },
"groups": { "$ref": "common.json#/definitions/analyzer_groups" },
"parameters": { "$ref": "common.json#/definitions/parameters" },
"results": { "$ref": "common.json#/definitions/results" },
"groups": { "$ref": "#/definitions/analyzer_groups" },
"parameters": { "$ref": "#/definitions/parameters" },
"results": { "$ref": "#/definitions/results" },
"uses": { "$ref": "../common/1.json#/definitions/uses" }
},
......@@ -55,8 +55,178 @@
],
"additionalProperties": false
},
"endpoint": {
"type": "object",
"properties": {
"type": { "$ref": "../common/1.json#/definitions/reference" },
"description": { "type": "string" }
},
"required": [
"type"
],
"additionalProperties": false
},
"endpoints": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"$ref": "#/definitions/endpoint"
}
},
"uniqueItems": true,
"minProperties": 1,
"additionalProperties": false
},
"io_group": {
"type": "object",
"properties": {
"name": { "type": "string" },
"inputs": { "$ref": "#/definitions/endpoints" },
"outputs": { "$ref": "#/definitions/endpoints" }
},
"required": [
"inputs",
"outputs"
],
"additionalProperties": false
},
"input_group": {
"type": "object",
"properties": {
"name": { "type": "string" },
"inputs": { "$ref": "#/definitions/endpoints" }
},
"required": [
"inputs"
],
"additionalProperties": false
},
"block_groups": {
"type": "array",
"items": [
{ "$ref": "#/definitions/io_group" }
],
"additionalItems": { "$ref": "#/definitions/input_group" },
"minItems": 1
},
"range": {
"type": "array",
"items": { "$ref": "../common/1.json#/definitions/value" },
"minItems": 2,
"maxItems": 2
},
"choice": {
"type": "array",
"items": { "$ref": "../common/1.json#/definitions/value" },
"minItems": 3
},
"parameter": {
"type": "object",
"properties": {
"type": { "$ref": "../common/1.json#/definitions/basetype" },
"default": { "$ref": "../common/1.json#/definitions/value" },
"description": { "type": "string" }
},
"required": [
"type"
]
},
"range_parameter": {
"allOf": [
{ "$ref": "#/definitions/parameter" },
{
"properties": {
"range": { "$ref": "#/definitions/range" }
},
"required": [
"range"
]
}
],
"additionalProperties": false
},
"choice_parameter": {
"allOf": [
{ "$ref": "#/definitions/parameter" },
{
"properties": {
"range": { "$ref": "#/definitions/choice" }
},
"required": [
"choice"
]
}
],
"additionalProperties": false
},
"parameters": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"oneOf": [
{ "$ref": "#/definitions/parameter" },
{ "$ref": "#/definitions/range_parameter" },
{ "$ref": "#/definitions/choice_parameter" }
]
}
},
"uniqueItems": true,
"additionalProperties": false
},
"analyzer_groups": {
"type": "array",
"items": { "$ref": "#/definitions/input_group" },
"minItems": 1
},
"resulttype": {
"oneOf": [
{ "type": "string", "enum": [ "int32", "float32", "bool", "string" ] },
{ "type": "string", "pattern": "^system/[a-zA-Z0-9_-]+/[0-9]+$" },
{ "type": "string", "pattern": "^plot/[a-zA-Z0-9_-]+/[0-9]+$" }
]
},
"result": {
"type": "object",
"properties": {
"type": { "$ref": "#/definitions/resulttype" },
"display": { "type": "boolean" },
"description": { "type": "string" }
},
"required": [
"type"
],
"additionalProperties": false
},
"results": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"$ref": "#/definitions/result"
}
},
"uniqueItems": true,
"minProperties": 1,
"additionalProperties": false
},
"schema_version": { "$ref": "../common/1.json#/definitions/version" },
"api_version": { "$ref": "../common/1.json#/definitions/version" }
}
}
......@@ -64,16 +64,52 @@
"minItems": 1
},
"range": {
"uint_constraint": { "type": "integer", "minimum": 0 },
"int_constraint": { "type": "integer" },
"float_constraint": { "type": "number" },
"uint_range": {
"type": "array",
"items": { "$ref": "#/definitions/uint_constraint" },
"minItems": 2,
"maxItems": 2
},
"int_range": {
"type": "array",
"items": { "$ref": "../common/1.json#/definitions/value" },
"items": { "$ref": "#/definitions/int_constraint" },
"minItems": 2,
"maxItems": 2
},
"choice": {
"float_range": {
"type": "array",
"items": { "$ref": "#/definitions/float_constraint" },
"minItems": 2,
"maxItems": 2
},
"string_choice": {
"type": "array",
"items": { "type": "string" },
"minItems": 3
},
"uint_choice": {
"type": "array",
"items": { "$ref": "#/definitions/uint_constraint" },
"minItems": 3
},
"int_choice": {
"type": "array",
"items": { "$ref": "../common/1.json#/definitions/value" },
"items": { "$ref": "#/definitions/int_constraint" },
"minItems": 3
},
"float_choice": {
"type": "array",
"items": { "$ref": "#/definitions/float_constraint" },
"minItems": 3
},
......@@ -81,41 +117,139 @@
"type": "object",
"properties": {
"type": { "$ref": "../common/1.json#/definitions/basetype" },
"default": { "$ref": "../common/1.json#/definitions/value" },
"default": true,
"description": { "type": "string" }
},
"required": [
"type"
]
],
"allOf": [
{
"if": { "properties": { "type": { "const": "bool" } } },
"then": { "properties": { "default": { "type": "boolean" } } }
},
{
"if": { "properties": { "type": { "const": "string" } } },
"then": { "properties": { "default": { "type": "string" } } }
},
{
"if": { "properties": { "type": { "$ref": "../common/1.json#/definitions/uint_basetype" } } },
"then": { "properties": { "default": { "$ref": "#/definitions/uint_constraint" } } }
},
{
"if": { "properties": { "type": { "$ref": "../common/1.json#/definitions/int_basetype" } } },
"then": { "properties": { "default": { "$ref": "#/definitions/int_constraint" } } }
},
{
"if": { "properties": { "type": { "$ref": "../common/1.json#/definitions/float_basetype" } } },
"then": { "properties": { "default": { "$ref": "#/definitions/float_constraint" } } }
}
],
"additionalProperties": false
},
"range_parameter": {
"allOf": [
{ "$ref": "#/definitions/parameter" },
{
"type": "object",
"properties": {
"range": { "$ref": "#/definitions/range" }
"type": { "$ref": "../common/1.json#/definitions/basetype" },
"default": true,
"description": { "type": "string" },
"range": true
},
"required": [
"type",
"range"
],
"not": {
"properties": {
"type": {
"type": "string",
"enum": [
"string",
"bool"
]
}
}
},
"allOf": [
{
"if": { "properties": { "type": { "$ref": "../common/1.json#/definitions/uint_basetype" } } },
"then": { "properties": {
"default": { "$ref": "#/definitions/uint_constraint" },
"range": { "$ref": "#/definitions/uint_range" }
} }
},
{
"if": { "properties": { "type": { "$ref": "../common/1.json#/definitions/int_basetype" } } },
"then": { "properties": {
"default": { "$ref": "#/definitions/int_constraint" },
"range": { "$ref": "#/definitions/int_range" }
} }
},
{
"if": { "properties": { "type": { "$ref": "../common/1.json#/definitions/float_basetype" } } },
"then": { "properties": {
"default": { "$ref": "#/definitions/float_constraint" },
"range": { "$ref": "#/definitions/float_range" }
} }
}
],
"additionalProperties": false
},
"choice_parameter": {
"allOf": [
{ "$ref": "#/definitions/parameter" },
{
"type": "object",
"properties": {
"range": { "$ref": "#/definitions/choice" }
"type": { "$ref": "../common/1.json#/definitions/basetype" },
"default": true,
"description": { "type": "string" },
"choice": true
},
"required": [
"type",
"choice"
],
"not": {
"properties": {
"type": {
"type": "string",
"enum": [
"bool"
]
}
}
},
"allOf": [
{
"if": { "properties": { "type": { "const": "string" } } },
"then": { "properties": {
"default": { "type": "string" },
"choice": { "$ref": "#/definitions/string_choice" }
} }
},
{
"if": { "properties": { "type": { "$ref": "../common/1.json#/definitions/uint_basetype" } } },
"then": { "properties": {
"default": { "$ref": "#/definitions/uint_constraint" },
"choice": { "$ref": "#/definitions/uint_choice" }
} }
},
{
"if": { "properties": { "type": { "$ref": "../common/1.json#/definitions/int_basetype" } } },
"then": { "properties": {
"default": { "$ref": "#/definitions/int_constraint" },
"choice": { "$ref": "#/definitions/int_choice" }
} }
},
{
"if": { "properties": { "type": { "$ref": "../common/1.json#/definitions/float_basetype" } } },
"then": { "properties": {
"default": { "$ref": "#/definitions/float_constraint" },
"choice": { "$ref": "#/definitions/float_choice" }
} }
}
],
"additionalProperties": false
},
......
......@@ -10,24 +10,47 @@
"pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*/[a-zA-Z0-9_-]+/[0-9]+$"
},
"basetype": {
"uint_basetype": {
"type": "string",
"enum": [
"int8",
"int16",
"int32",
"int64",
"uint8",
"uint16",
"uint32",
"uint64",
"uint64"
]
},
"int_basetype": {
"type": "string",
"enum": [
"int8",
"int16",
"int32",
"int64"
]
},
"float_basetype": {
"type": "string",
"enum": [
"float32",
"float64",
"complex64",
"complex128",
"float64"
]
},
"basetype": {
"anyOf": [
{ "$ref": "#/definitions/uint_basetype" },
{ "$ref": "#/definitions/int_basetype" },
{ "$ref": "#/definitions/float_basetype" },
{
"type": "string",
"enum": [
"bool",
"string"
]
}
]
},
"value": {
......
......@@ -92,23 +92,9 @@
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"$ref": "#/definitions/parameter_value"
"$ref": "../common/1.json#/definitions/value"
}
}
},
"parameter_value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
}
......
......@@ -15,6 +15,7 @@
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"oneOf": [
{ "$ref": "../common/1.json#/definitions/basetype" },
{ "$ref": "#/definitions/complextype" },
{ "$ref": "#/definitions/array1d" },
{ "$ref": "#/definitions/array2d" },
{ "$ref": "#/definitions/array3d" },
......@@ -29,6 +30,13 @@
"additionalProperties": false,
"definitions": {
"complextype": {
"type": "string",
"enum": [
"complex64",
"complex128"
]
},
"array1d": {
"type": "array",
......@@ -38,6 +46,7 @@
{ "type": "integer" },
{
"oneOf": [
{ "$ref": "#/definitions/complextype" },
{ "$ref": "../common/1.json#/definitions/basetype" },
{ "$ref": "../common/1.json#/definitions/reference" },
{ "$ref": "#" }
......@@ -56,6 +65,7 @@
{ "type": "integer" },
{
"oneOf": [
{ "$ref": "#/definitions/complextype" },
{ "$ref": "../common/1.json#/definitions/basetype" },
{ "$ref": "../common/1.json#/definitions/reference" },
{ "$ref": "#" }
......@@ -75,6 +85,7 @@
{ "type": "integer" },
{
"oneOf": [
{ "$ref": "#/definitions/complextype" },
{ "$ref": "../common/1.json#/definitions/basetype" },
{ "$ref": "../common/1.json#/definitions/reference" },
{ "$ref": "#" }
......@@ -95,6 +106,7 @@
{ "type": "integer" },
{
"oneOf": [
{ "$ref": "#/definitions/complextype" },
{ "$ref": "../common/1.json#/definitions/basetype" },
{ "$ref": "../common/1.json#/definitions/reference" },
{ "$ref": "#" }
......@@ -116,6 +128,7 @@
{ "type": "integer" },
{
"oneOf": [
{ "$ref": "#/definitions/complextype" },
{ "$ref": "../common/1.json#/definitions/basetype" },
{ "$ref": "../common/1.json#/definitions/reference" },
{ "$ref": "#" }
......
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with an invalid choice parameter (needs >=3 choices)",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"choice": [
0
],
"type": "float32"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with an invalid choice parameter (all choices must be the same type)",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"choice": [
0,
1,
"a"
],
"type": "float32"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with an invalid choice parameter (numerical types must have numerical choices)",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"choice": [
"a",
"b",
"c"
],
"type": "float32"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with an invalid choice parameter (string types must have string choices)",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"choice": [
0,
1,
2
],
"type": "string"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with an invalid choice parameter (cannot be boolean type)",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"choice": [
0,
1,
2
],
"type": "bool"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with an invalid choice parameter (choice count needs to be >=3)",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"choice": [
0,
1
],
"type": "float32"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with an invalid choice parameter (uint with float choices)",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"choice": [
0.1,
1.1,
2.1
],
"type": "uint32"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with an invalid choice parameter (uint with negative choices)",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"choice": [
-1,
1,
-3
],
"type": "uint32"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with an invalid choice parameter (int with float choices)",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"choice": [
0.1,
1.1,
2.1
],
"type": "int32"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with a normal, float-typed parameter with an invalid default",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"type": "float64",
"default": "a"
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with a normal, int-typed parameter with an invalid default",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"type": "int16",
"default": -1.1
}
}
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###################################################################################
# #
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, this #
# list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright notice, #
# this list of conditions and the following disclaimer in the documentation #
# and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its contributors #
# may be used to endorse or promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE #
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL #
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
###################################################################################
class Algorithm:
def process(self, inputs, outputs):
return True
{
"api_version": 2,
"schema_version": 3,
"splittable": false,
"type": "sequential",
"uses": {},
"description": "this is an example of an algorithm with a normal, uint-typed parameter with an invalid default",
"groups": [
{
"name": "group",
"inputs": {
"input": {
"type": "user/single_integer/1"
}
},
"outputs": {
"output": {
"type": "user/single_integer/1"
}
}
}
],
"language": "python",
"parameters": {
"testparam": {
"type": "uint8",