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
9b07eabd
Commit
9b07eabd
authored
Jul 12, 2019
by
Samuel GAIST
Browse files
[test][prefix] Change loop channel dataformats to improve testing
parent
b0d92774
Pipeline
#31844
passed with stage
in 15 minutes and 55 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/core/test/prefix/algorithms/user/db_input_loop/1.json
View file @
9b07eabd
...
...
@@ -12,10 +12,10 @@
},
"loop"
:
{
"request"
:
{
"type"
:
"user/
single
_integer/1"
"type"
:
"user/
1d_array_of
_integer
s
/1"
},
"answer"
:
{
"type"
:
"user/single_
integer
/1"
"type"
:
"user/single_
float
/1"
}
}
}
...
...
beat/core/test/prefix/algorithms/user/db_input_loop/1.py
View file @
9b07eabd
...
...
@@ -58,7 +58,7 @@ class Algorithm:
return
True
def
validate
(
self
,
result
):
value
=
result
.
value
value
=
result
.
value
[
0
]
result
=
value
>
self
.
threshold
and
value
<
self
.
max
delta
=
self
.
max
-
value
return
(
result
,
{
"value"
:
np
.
in
t32
(
delta
)})
return
(
result
,
{
"value"
:
np
.
floa
t32
(
delta
)})
beat/core/test/prefix/algorithms/user/db_input_loop_user/1.json
View file @
9b07eabd
...
...
@@ -18,10 +18,10 @@
},
"loop"
:
{
"request"
:
{
"type"
:
"user/
single
_integer/1"
"type"
:
"user/
1d_array_of
_integer
s
/1"
},
"answer"
:
{
"type"
:
"user/single_
integer
/1"
"type"
:
"user/single_
float
/1"
}
}
}
...
...
beat/core/test/prefix/algorithms/user/db_input_loop_user/1.py
View file @
9b07eabd
...
...
@@ -40,10 +40,10 @@ import numpy as np
class
Algorithm
:
def
process
(
self
,
data_loaders
,
outputs
,
loop_channel
):
cnt
=
1
is_valid
,
delta
=
loop_channel
.
validate
({
"value"
:
np
.
int32
(
cnt
)})
is_valid
,
delta
=
loop_channel
.
validate
({
"value"
:
np
.
full
(
10
,
cnt
)})
while
not
is_valid
:
cnt
=
cnt
+
1
is_valid
,
delta
=
loop_channel
.
validate
({
"value"
:
np
.
int32
(
cnt
)})
is_valid
,
delta
=
loop_channel
.
validate
({
"value"
:
np
.
full
(
10
,
cnt
)})
delta
=
delta
.
value
...
...
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