Changed save_session to serialize_session

This commit is contained in:
Rob McMullen 2019-03-17 14:12:41 -07:00
parent cb9f592762
commit ce66a0c8b0
2 changed files with 4 additions and 4 deletions

View File

@ -553,7 +553,7 @@ class DefaultSegment:
r = r.get_indexed[other.order]
return r
def save_session(self, mdict):
def serialize_session(self, mdict):
"""Save extra metadata to a dict so that it can be serialized
This is not saved by __getstate__ because child segments will point to

View File

@ -47,15 +47,15 @@ class TestSegment:
s.set_user_data([r], 4, 99)
out = dict()
s.serialize_extra_to_dict(out)
s.serialize_session(out)
print("saved", out)
data = np.ones([4000], dtype=np.uint8)
r = SegmentData(data)
s2 = DefaultSegment(r, 0)
s2.restore_extra_from_dict(out)
s2.restore_session(out)
out2 = dict()
s2.serialize_extra_to_dict(out2)
s2.serialize_session(out2)
print("loaded", out2)
assert out == out2