Skip to content
GitLab
Menu
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
70ce1646
Commit
70ce1646
authored
Mar 20, 2019
by
Samuel GAIST
Browse files
[execution][base] Import simplejson as json to make it easy to swap
parent
0e362bc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/core/execution/base.py
View file @
70ce1646
...
...
@@ -47,7 +47,7 @@ import os
import
glob
import
collections
import
logging
import
simplejson
import
simplejson
as
json
from
..
import
schema
from
..
import
database
...
...
@@ -417,7 +417,7 @@ class BaseExecutor(object):
return
stats
.
io_statistics
(
self
.
data
,
self
.
input_list
,
self
.
output_list
)
def
__str__
(
self
):
return
simple
json
.
dumps
(
self
.
data
,
indent
=
4
)
return
json
.
dumps
(
self
.
data
,
indent
=
4
)
def
write
(
self
,
path
):
"""Writes contents to precise filesystem location"""
...
...
@@ -431,7 +431,7 @@ class BaseExecutor(object):
data
=
convert_experiment_configuration_to_container
(
self
.
data
)
with
open
(
os
.
path
.
join
(
directory
,
"configuration.json"
),
"wb"
)
as
f
:
json_data
=
simple
json
.
dumps
(
data
,
indent
=
2
)
json_data
=
json
.
dumps
(
data
,
indent
=
2
)
f
.
write
(
json_data
.
encode
(
"utf-8"
))
tmp_prefix
=
os
.
path
.
join
(
directory
,
"prefix"
)
...
...
@@ -447,7 +447,7 @@ class BaseExecutor(object):
"""Exports contents useful for a backend runner to run the algorithm"""
with
open
(
os
.
path
.
join
(
directory
,
"configuration.json"
),
"wb"
)
as
f
:
json_data
=
simple
json
.
dumps
(
self
.
data
,
indent
=
2
)
json_data
=
json
.
dumps
(
self
.
data
,
indent
=
2
)
f
.
write
(
json_data
.
encode
(
"utf-8"
))
tmp_prefix
=
os
.
path
.
join
(
directory
,
"prefix"
)
...
...
Write
Preview
Supports
Markdown
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