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
6ec44d8a
Commit
6ec44d8a
authored
May 08, 2020
by
dboe
Browse files
test_core should work on master already?
parent
f17a7d97
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/test_core.py
View file @
6ec44d8a
...
...
@@ -25,11 +25,18 @@ class AbstractNdarray_Check(object):
out_file
=
NamedTemporaryFile
(
suffix
=
'.npz'
)
self
.
_inst
.
save
(
out_file
.
name
)
_
=
out_file
.
seek
(
0
)
# this is only necessary in the test
load_inst
=
self
.
_inst
.
__class__
.
load
(
out_file
.
name
)
load_inst
=
type
(
self
.
_inst
)
.
load
(
out_file
.
name
)
# allow_pickle=True) ?
self
.
demand_equal
(
load_inst
)
def
test_dict
(
self
):
d
=
self
.
_inst
.
_as_dict
()
print
(
"DONE"
)
print
(
d
)
other
=
type
(
self
.
_inst
).
_from_dict
(
**
d
)
self
.
demand_equal
(
other
)
def
tearDown
(
self
):
del
self
.
_inst
...
...
tfields/core.py
View file @
6ec44d8a
...
...
@@ -430,7 +430,7 @@ class AbstractNdarray(np.ndarray):
"{attr}::{i}::{part_attr}"
.
format
(
**
locals
())
]
=
part_value
continue
if
isinstance
(
value
,
AbstractNdarray
):
el
if
isinstance
(
value
,
AbstractNdarray
):
value
=
value
.
_as_dict
()
d
[
attr
]
=
value
return
d
...
...
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