Skip to content
Snippets Groups Projects
Commit 7949cf16 authored by Philip ABBET's avatar Philip ABBET
Browse files

[tests] Now test experiments with various combination of input sources

parent 3090adeb
No related branches found
No related tags found
No related merge requests found
Showing
with 941 additions and 0 deletions
{
"language": "python",
"splittable": false,
"groups": [
{
"inputs": {
"b": {
"type": "user/single_integer/1"
}
},
"outputs": {
"sum": {
"type": "user/single_integer/1"
}
}
},
{
"name": "other",
"inputs": {
"a": {
"type": "user/single_integer/1"
}
}
}
]
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###############################################################################
# #
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# This file is part of the beat.core module of the BEAT platform. #
# #
# Commercial License Usage #
# Licensees holding valid commercial BEAT licenses may use this file in #
# accordance with the terms contained in a written agreement between you #
# and Idiap. For further information contact tto@idiap.ch #
# #
# Alternatively, this file may be used under the terms of the GNU Affero #
# Public License version 3 as published by the Free Software and appearing #
# in the file LICENSE.AGPL included in the packaging of this file. #
# The BEAT platform is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY #
# or FITNESS FOR A PARTICULAR PURPOSE. #
# #
# You should have received a copy of the GNU Affero Public License along #
# with the BEAT platform. If not, see http://www.gnu.org/licenses/. #
# #
###############################################################################
class Algorithm:
def process(self, inputs, outputs):
a = 0
if inputs['a'].hasMoreData():
inputs['a'].next()
a = inputs['a'].data.value
outputs['sum'].write({
'value': a + inputs['b'].data.value
})
return True
{
"language": "python",
"splittable": false,
"groups": [
{
"inputs": {
"c": {
"type": "user/single_integer/1"
}
},
"outputs": {
"sum": {
"type": "user/single_integer/1"
}
}
},
{
"name": "others",
"inputs": {
"a": {
"type": "user/single_integer/1"
},
"b": {
"type": "user/single_integer/1"
}
}
}
]
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###############################################################################
# #
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# This file is part of the beat.core module of the BEAT platform. #
# #
# Commercial License Usage #
# Licensees holding valid commercial BEAT licenses may use this file in #
# accordance with the terms contained in a written agreement between you #
# and Idiap. For further information contact tto@idiap.ch #
# #
# Alternatively, this file may be used under the terms of the GNU Affero #
# Public License version 3 as published by the Free Software and appearing #
# in the file LICENSE.AGPL included in the packaging of this file. #
# The BEAT platform is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY #
# or FITNESS FOR A PARTICULAR PURPOSE. #
# #
# You should have received a copy of the GNU Affero Public License along #
# with the BEAT platform. If not, see http://www.gnu.org/licenses/. #
# #
###############################################################################
class Algorithm:
def process(self, inputs, outputs):
a = 0
b = 0
if inputs.groupOf('a').hasMoreData():
inputs.groupOf('a').next()
a = inputs['a'].data.value
b = inputs['b'].data.value
outputs['sum'].write({
'value': a + b + inputs['c'].data.value
})
return True
{
"language": "python",
"splittable": false,
"groups": [
{
"inputs": {
"c": {
"type": "user/single_integer/1"
},
"d": {
"type": "user/single_integer/1"
}
},
"outputs": {
"sum": {
"type": "user/single_integer/1"
}
}
},
{
"name": "others",
"inputs": {
"a": {
"type": "user/single_integer/1"
},
"b": {
"type": "user/single_integer/1"
}
}
}
]
}
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###############################################################################
# #
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# This file is part of the beat.core module of the BEAT platform. #
# #
# Commercial License Usage #
# Licensees holding valid commercial BEAT licenses may use this file in #
# accordance with the terms contained in a written agreement between you #
# and Idiap. For further information contact tto@idiap.ch #
# #
# Alternatively, this file may be used under the terms of the GNU Affero #
# Public License version 3 as published by the Free Software and appearing #
# in the file LICENSE.AGPL included in the packaging of this file. #
# The BEAT platform is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY #
# or FITNESS FOR A PARTICULAR PURPOSE. #
# #
# You should have received a copy of the GNU Affero Public License along #
# with the BEAT platform. If not, see http://www.gnu.org/licenses/. #
# #
###############################################################################
class Algorithm:
def process(self, inputs, outputs):
a = 0
b = 0
if inputs.groupOf('a').hasMoreData():
inputs.groupOf('a').next()
a = inputs['a'].data.value
b = inputs['b'].data.value
outputs['sum'].write({
'value': a + b + inputs['c'].data.value + inputs['d'].data.value
})
return True
{
"datasets": {
"integers": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "double"
}
},
"blocks": {
"echo": {
"algorithm": "user/integers_echo/1",
"parameters": {
},
"inputs": {
"in_data": "in"
},
"outputs": {
"out_data": "out"
}
},
"operation": {
"algorithm": "user/sum/1",
"parameters": {
},
"inputs": {
"a": "a",
"b": "b"
},
"outputs": {
"sum": "result"
}
}
},
"analyzers": {
"analysis": {
"algorithm": "user/integers_analysis/1",
"parameters": {
},
"inputs": {
"input": "input"
}
}
},
"globals": {
"environment": {
"name": "environment",
"version": "1"
},
"queue": "queue"
}
}
{
"datasets": {
"integers1": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "double"
},
"integers2": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "triple"
}
},
"blocks": {
"echo": {
"algorithm": "user/integers_echo/1",
"parameters": {
},
"inputs": {
"in_data": "in"
},
"outputs": {
"out_data": "out"
}
},
"operation": {
"algorithm": "user/sum_over_channels/1",
"parameters": {
},
"inputs": {
"a": "a",
"b": "b"
},
"outputs": {
"sum": "result"
}
}
},
"analyzers": {
"analysis": {
"algorithm": "user/integers_analysis/1",
"parameters": {
},
"inputs": {
"input": "input"
}
}
},
"globals": {
"environment": {
"name": "environment",
"version": "1"
},
"queue": "queue"
}
}
{
"datasets": {
"integers1": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "double"
},
"integers2": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "triple"
}
},
"blocks": {
"echo": {
"algorithm": "user/integers_echo/1",
"parameters": {
},
"inputs": {
"in_data": "in"
},
"outputs": {
"out_data": "out"
}
},
"operation": {
"algorithm": "user/sum_over_channels/2",
"parameters": {
},
"inputs": {
"a": "a",
"b": "b",
"c": "c"
},
"outputs": {
"sum": "result"
}
}
},
"analyzers": {
"analysis": {
"algorithm": "user/integers_analysis/1",
"parameters": {
},
"inputs": {
"input": "input"
}
}
},
"globals": {
"environment": {
"name": "environment",
"version": "1"
},
"queue": "queue"
}
}
{
"datasets": {
"integers1": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "double"
},
"integers2": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "triple"
}
},
"blocks": {
"echo": {
"algorithm": "user/integers_add/1",
"parameters": {
},
"inputs": {
"in_data": "in"
},
"outputs": {
"out_data": "out"
}
},
"operation": {
"algorithm": "user/sum_over_channels/2",
"parameters": {
},
"inputs": {
"a": "a",
"b": "b",
"c": "c"
},
"outputs": {
"sum": "result"
}
}
},
"analyzers": {
"analysis": {
"algorithm": "user/integers_analysis/1",
"parameters": {
},
"inputs": {
"input": "input"
}
}
},
"globals": {
"environment": {
"name": "environment",
"version": "1"
},
"queue": "queue"
}
}
{
"datasets": {
"integers1": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "double"
},
"integers2": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "triple"
}
},
"blocks": {
"echo": {
"algorithm": "user/integers_echo/1",
"parameters": {
},
"inputs": {
"in_data": "in"
},
"outputs": {
"out_data": "out"
}
},
"echo2": {
"algorithm": "user/integers_echo/1",
"parameters": {
},
"inputs": {
"in_data": "in"
},
"outputs": {
"out_data": "out"
}
},
"operation": {
"algorithm": "user/sum_over_channels/3",
"parameters": {
},
"inputs": {
"a": "a",
"b": "b",
"c": "c",
"d": "d"
},
"outputs": {
"sum": "result"
}
}
},
"analyzers": {
"analysis": {
"algorithm": "user/integers_analysis/1",
"parameters": {
},
"inputs": {
"input": "input"
}
}
},
"globals": {
"environment": {
"name": "environment",
"version": "1"
},
"queue": "queue"
}
}
{
"datasets": {
"integers1": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "double"
},
"integers2": {
"database": "integers_db/1",
"protocol": "two_sets",
"set": "triple"
}
},
"blocks": {
"echo": {
"algorithm": "user/integers_add/1",
"parameters": {
},
"inputs": {
"in_data": "in"
},
"outputs": {
"out_data": "out"
}
},
"echo2": {
"algorithm": "user/integers_add/1",
"parameters": {
},
"inputs": {
"in_data": "in"
},
"outputs": {
"out_data": "out"
}
},
"operation": {
"algorithm": "user/sum_over_channels/3",
"parameters": {
},
"inputs": {
"a": "a",
"b": "b",
"c": "c",
"d": "d"
},
"outputs": {
"sum": "result"
}
}
},
"analyzers": {
"analysis": {
"algorithm": "user/integers_analysis/1",
"parameters": {
},
"inputs": {
"input": "input"
}
}
},
"globals": {
"environment": {
"name": "environment",
"version": "1"
},
"queue": "queue"
}
}
{
"datasets": [
{
"name": "integers",
"outputs": [
"a",
"b"
]
}
],
"blocks": [
{
"name": "echo",
"inputs": [
"in"
],
"outputs": [
"out"
],
"synchronized_channel": "integers"
},
{
"name": "operation",
"inputs": [
"a",
"b"
],
"outputs": [
"result"
],
"synchronized_channel": "integers"
}
],
"analyzers": [
{
"name": "analysis",
"inputs": [
"input"
],
"synchronized_channel": "integers"
}
],
"connections": [
{
"from": "integers.a",
"to": "echo.in",
"channel": "integers"
},
{
"from": "echo.out",
"to": "operation.a",
"channel": "integers"
},
{
"from": "integers.b",
"to": "operation.b",
"channel": "integers"
},
{
"from": "operation.result",
"to": "analysis.input",
"channel": "integers"
}
],
"representation": {
"connections": {
},
"blocks": {
},
"channel_colors": {
"integers": "#5555ff"
}
}
}
{
"datasets": [
{
"name": "integers1",
"outputs": [
"a",
"b"
]
},
{
"name": "integers2",
"outputs": [
"a",
"b",
"c"
]
}
],
"blocks": [
{
"name": "echo",
"inputs": [
"in"
],
"outputs": [
"out"
],
"synchronized_channel": "integers1"
},
{
"name": "operation",
"inputs": [
"a",
"b"
],
"outputs": [
"result"
],
"synchronized_channel": "integers2"
}
],
"analyzers": [
{
"name": "analysis",
"inputs": [
"input"
],
"synchronized_channel": "integers2"
}
],
"connections": [
{
"from": "integers1.a",
"to": "echo.in",
"channel": "integers1"
},
{
"from": "echo.out",
"to": "operation.a",
"channel": "integers1"
},
{
"from": "integers2.b",
"to": "operation.b",
"channel": "integers2"
},
{
"from": "operation.result",
"to": "analysis.input",
"channel": "integers2"
}
],
"representation": {
"connections": {
},
"blocks": {
},
"channel_colors": {
"integers1": "#5555ff",
"integers2": "#ff5555"
}
}
}
{
"datasets": [
{
"name": "integers1",
"outputs": [
"a",
"b"
]
},
{
"name": "integers2",
"outputs": [
"a",
"b",
"c"
]
}
],
"blocks": [
{
"name": "echo",
"inputs": [
"in"
],
"outputs": [
"out"
],
"synchronized_channel": "integers1"
},
{
"name": "operation",
"inputs": [
"a",
"b",
"c"
],
"outputs": [
"result"
],
"synchronized_channel": "integers2"
}
],
"analyzers": [
{
"name": "analysis",
"inputs": [
"input"
],
"synchronized_channel": "integers2"
}
],
"connections": [
{
"from": "integers1.a",
"to": "echo.in",
"channel": "integers1"
},
{
"from": "echo.out",
"to": "operation.a",
"channel": "integers1"
},
{
"from": "integers1.b",
"to": "operation.b",
"channel": "integers1"
},
{
"from": "integers2.b",
"to": "operation.c",
"channel": "integers2"
},
{
"from": "operation.result",
"to": "analysis.input",
"channel": "integers2"
}
],
"representation": {
"connections": {
},
"blocks": {
},
"channel_colors": {
"integers1": "#5555ff",
"integers2": "#ff5555"
}
}
}
{
"datasets": [
{
"name": "integers1",
"outputs": [
"a",
"b"
]
},
{
"name": "integers2",
"outputs": [
"a",
"b",
"c"
]
}
],
"blocks": [
{
"name": "echo",
"inputs": [
"in"
],
"outputs": [
"out"
],
"synchronized_channel": "integers1"
},
{
"name": "echo2",
"inputs": [
"in"
],
"outputs": [
"out"
],
"synchronized_channel": "integers2"
},
{
"name": "operation",
"inputs": [
"a",
"b",
"c",
"d"
],
"outputs": [
"result"
],
"synchronized_channel": "integers2"
}
],
"analyzers": [
{
"name": "analysis",
"inputs": [
"input"
],
"synchronized_channel": "integers2"
}
],
"connections": [
{
"from": "integers1.a",
"to": "echo.in",
"channel": "integers1"
},
{
"from": "echo.out",
"to": "operation.a",
"channel": "integers1"
},
{
"from": "integers2.a",
"to": "echo2.in",
"channel": "integers2"
},
{
"from": "echo2.out",
"to": "operation.d",
"channel": "integers2"
},
{
"from": "integers1.b",
"to": "operation.b",
"channel": "integers1"
},
{
"from": "integers2.b",
"to": "operation.c",
"channel": "integers2"
},
{
"from": "operation.result",
"to": "analysis.input",
"channel": "integers2"
}
],
"representation": {
"connections": {
},
"blocks": {
},
"channel_colors": {
"integers1": "#5555ff",
"integers2": "#ff5555"
}
}
}
......@@ -237,3 +237,21 @@ class TestExecution(unittest.TestCase):
def test_cxx_double_1(self):
assert self.execute('user/user/double/1/cxx_double', [{'out_data': 42}]) is None
def test_inputs_mix_1(self):
assert self.execute('user/user/inputs_mix/1/test', [{'sum': 12272, 'nb': 10}]) is None
def test_inputs_mix_2(self):
assert self.execute('user/user/inputs_mix/2/test', [{'sum': 13529, 'nb': 10}]) is None
def test_inputs_mix_3(self):
assert self.execute('user/user/inputs_mix/3/test', [{'sum': 19523, 'nb': 10}]) is None
def test_inputs_mix_3b(self):
assert self.execute('user/user/inputs_mix/3/test2', [{'sum': 19533, 'nb': 10}]) is None
def test_inputs_mix_4(self):
assert self.execute('user/user/inputs_mix/4/test', [{'sum': 25150, 'nb': 10}]) is None
def test_inputs_mix_4b(self):
assert self.execute('user/user/inputs_mix/4/test2', [{'sum': 25170, 'nb': 10}]) is None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment