Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
a4458b17
Commit
a4458b17
authored
Jul 11, 2019
by
Samuel GAIST
Browse files
[test][prefix] Update loop following output update
parent
11d61328
Changes
3
Hide whitespace changes
Inline
Side-by-side
beat/core/test/prefix/algorithms/schema/invalid_loop_output/1.json
View file @
a4458b17
...
...
@@ -11,9 +11,6 @@
}
},
"outputs"
:
{
"out"
:
{
"type"
:
"user/single_integer/1"
}
},
"loop"
:
{
"request"
:
{
...
...
beat/core/test/prefix/algorithms/user/db_input_loop/1.json
View file @
a4458b17
...
...
@@ -10,6 +10,11 @@
"type"
:
"user/single_integer/1"
}
},
"outputs"
:
{
"out"
:
{
"type"
:
"user/single_integer/1"
}
},
"loop"
:
{
"request"
:
{
"type"
:
"user/1d_array_of_integers/1"
...
...
beat/core/test/prefix/algorithms/user/db_input_loop/1.py
View file @
a4458b17
...
...
@@ -41,6 +41,7 @@ class Algorithm:
def
__init__
(
self
):
self
.
threshold
=
None
self
.
max
=
0
self
.
output
=
None
def
setup
(
self
,
parameters
):
self
.
threshold
=
parameters
[
"threshold"
]
...
...
@@ -61,4 +62,8 @@ class Algorithm:
value
=
result
.
value
[
0
]
result
=
value
>
self
.
threshold
and
value
<
self
.
max
delta
=
self
.
max
-
value
self
.
output
=
delta
return
(
result
,
{
"value"
:
np
.
float32
(
delta
)})
def
write
(
self
,
outputs
):
outputs
[
"out"
].
write
({
"value"
:
np
.
int32
(
self
.
output
)})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment