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
Daniel Boeckenhoff
tfields
Commits
231f35dc
Commit
231f35dc
authored
May 18, 2020
by
dboe
Browse files
legacy test working on TensorMaps
parent
956ca8e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
tfields/core.py
View file @
231f35dc
...
...
@@ -153,6 +153,7 @@ class AbstractObject(object):
"""
content_dict
=
self
.
_as_dict
()
content_dict
[
'tfields_version'
]
=
tfields
.
__version__
np
.
savez
(
path
,
**
content_dict
)
@
classmethod
...
...
@@ -165,7 +166,9 @@ class AbstractObject(object):
# wheter we could avoid pickling (potential security issue)
load_kwargs
.
setdefault
(
'allow_pickle'
,
True
)
np_file
=
np
.
load
(
path
,
**
load_kwargs
)
return
cls
.
_from_dict
(
dict
(
np_file
))
d
=
dict
(
np_file
)
d
.
pop
(
'tfields_version'
,
None
)
return
cls
.
_from_dict
(
d
)
def
_args
(
self
)
->
tuple
:
return
tuple
()
...
...
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