Skip to content

Commit

Permalink
Added missing docs for Dataset and fixed __add__'s copying.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfournie committed Jul 6, 2013
1 parent 272b46d commit ba646c8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions segeval/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, item_coder_data=None, properties=None,

def __iadd__(self, other, prepend_item=None):
'''
Add one dataset's data to this dataset
Add one dataset's data to this dataset.
'''
# Combine item codings
for item, codings in other.items():
Expand All @@ -80,11 +80,17 @@ def __iadd__(self, other, prepend_item=None):
return self

def __add__(self, other):
dataset = copy.deepcopy(self)
'''
Copy this dataset and add the other dataset to it.
'''
dataset = self.copy()
dataset += other
return dataset

def copy(self):
'''
Create a deep copy of the entire dataset object and properties.
'''
dataset = copy.deepcopy(self)
dataset.coders = copy.deepcopy(self.coders)
dataset.properties = copy.deepcopy(self.properties)
Expand Down

0 comments on commit ba646c8

Please sign in to comment.