Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
45f8bc76
Commit
45f8bc76
authored
7 years ago
by
Jose Borreguero
Browse files
Options
Downloads
Patches
Plain Diff
Refs #21335 jsonify out of the conditional
parent
0d3ed23a
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/PythonInterface/plugins/algorithms/BASISReduction.py
+7
-8
7 additions, 8 deletions
...work/PythonInterface/plugins/algorithms/BASISReduction.py
with
7 additions
and
8 deletions
Framework/PythonInterface/plugins/algorithms/BASISReduction.py
+
7
−
8
View file @
45f8bc76
...
@@ -635,15 +635,14 @@ class BASISReduction(PythonAlgorithm):
...
@@ -635,15 +635,14 @@ class BASISReduction(PythonAlgorithm):
ws_name: str
ws_name: str
Name of the workspace from which to retrieve and modify the logs
Name of the workspace from which to retrieve and modify the logs
"""
"""
def
jsonify
(
value
):
r
"""
Cast non-standard objects to their closest standard
representation to enable JSON serialiation
"""
if
isinstance
(
value
,
np
.
ndarray
):
return
value
.
tolist
()
return
value
if
self
.
_as_json
is
None
:
if
self
.
_as_json
is
None
:
self
.
_as_json
=
{
'
properties
'
:
{}}
self
.
_as_json
=
json
.
loads
(
str
(
self
))
#self._as_json = json.loads(str(self))
def
jsonify
(
value
):
r
"""
Cast non-standard objects to their closest standard
representation to enable JSON serialiation
"""
if
isinstance
(
value
,
np
.
ndarray
):
return
value
.
tolist
()
return
value
# Force serialization of the following properties even if having
# Force serialization of the following properties even if having
# their default values
# their default values
forced
=
{
name
:
jsonify
(
self
.
getProperty
(
name
).
value
)
forced
=
{
name
:
jsonify
(
self
.
getProperty
(
name
).
value
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment