Commit da5b1e5c authored by Médéric Boquien's avatar Médéric Boquien
Browse files

Setters and getters are nice but they come with a significant overhead....

Setters and getters are nice but they come with a significant overhead. Because we initialise class members to None anyway, they should not be needed at all. I leave the setter/getter for the sfh as it is actually doing something more. It now accounts for a non negligible fraction of the runtime though.
parent 28df40ce
......@@ -89,33 +89,6 @@ class SED(object):
True, True)
self.add_info("age", np.max(sfh_time), False, True)
@property
def wavelength_grid(self):
""" Return a copy of the wavelength grid
"""
if self._wavelength_grid is None:
return None
else:
return np.copy(self._wavelength_grid)
@wavelength_grid.setter
def wavelength_grid(self, value):
self._wavelength_grid = value
@property
def luminosities(self):
""" Return a copy of the luminosity contributions
"""
if self._luminosities is None:
return None
else:
return np.copy(self._luminosities)
@luminosities.setter
def luminosities(self, value):
self._luminosities = value
@property
def fnu(self):
"""Total Fν flux density of the SED
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment