Skip to content

Commit

Permalink
Add __repr__ for AstronomicalObject
Browse files Browse the repository at this point in the history
  • Loading branch information
kboone committed Apr 23, 2019
1 parent d93981e commit 9bc126a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions avocado/astronomical_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ def plot_light_curve(self, data_only=False):
plt.xlabel('Time (days)')
plt.ylabel('Flux')
plt.tight_layout()

def __repr__(self):
return "AstronomicalObject(object_id=%s)" % self.metadata['object_id']

1 change: 1 addition & 0 deletions avocado/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(self, name, metadata, observations=None):
observations.groupby('object_id'):
meta_index = self.metadata.index.get_loc(object_id)
object_metadata = meta_dicts[meta_index]
object_metadata['object_id'] = object_id
new_object = AstronomicalObject(object_metadata,
object_observations)
objects.append(new_object)
Expand Down

0 comments on commit 9bc126a

Please sign in to comment.