Skip to content

Commit

Permalink
Intact storages can now be constructed from dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Björling committed Feb 11, 2020
1 parent b5d6443 commit b61034b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ptypy/core/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,13 @@ def __init__(self, container, ID=None, data=None, shape=DEFAULT_SHAPE,
# solution required
# self._origin = None

@classmethod
def _from_dict(cls, dct, container):
obj = super()._from_dict(dct)
obj.owner = container
container._new_ptypy_object(obj)
return obj

@property
def ndim(self):
"""
Expand Down

0 comments on commit b61034b

Please sign in to comment.