🚧 Created new tree to enable bootstrapping with indices (to avoid making a whole new bootstrapped database per tree)
16 lines
538 B
Python
16 lines
538 B
Python
class Star(object):
|
|
def __init__(self, label, display_name, data, fields):
|
|
self.label = label
|
|
self.name = display_name
|
|
data_list = []
|
|
for field in fields:
|
|
data_list.append(data[field])
|
|
self.data = data_list
|
|
|
|
def __str__(self):
|
|
if len(self.label) > 1:
|
|
classification = ' or '.join(self.label)
|
|
else:
|
|
classification = self.label
|
|
return ("Star {} {} of spectral type {}"
|
|
.format(self.name, self.data, classification))
|