Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
04157844
Commit
04157844
authored
Mar 15, 2019
by
Samuel GAIST
Browse files
[algorithm] Decode prototype content if python is older than 3.6
Fixes
#71
parent
884288e6
Pipeline
#28167
passed with stage
in 19 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/core/algorithm.py
View file @
04157844
...
...
@@ -49,6 +49,7 @@ Forward importing from :py:mod:`beat.backend.python.algorithm`
import
os
import
six
import
sys
import
json
import
numpy
import
pkg_resources
...
...
@@ -64,9 +65,12 @@ from beat.backend.python.algorithm import Algorithm as BackendAlgorithm
def
load_algorithm_prototype
(
prefix
):
algorithm_data
=
json
.
loads
(
pkg_resources
.
resource_string
(
__name__
,
"prototypes/algorithm.json"
)
)
prototype_data
=
pkg_resources
.
resource_string
(
__name__
,
"prototypes/algorithm.json"
)
if
sys
.
version_info
<
(
3
,
6
):
prototype_data
=
prototype_data
.
decode
(
"utf-8"
)
algorithm_data
=
json
.
loads
(
prototype_data
)
ref_dataformats
=
[
"integer"
,
"integers"
]
dataformat
=
None
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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