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

Optimise the copy of a SED object. First, use direct references to the time...

Optimise the copy of a SED object. First, use direct references to the time grid and SFH rather than copies as they will never change. Then, directly assign self._sfh, bypassing the slow setter.
parent 579f37e7
......@@ -346,7 +346,7 @@ class SED(object):
def copy(self):
sed = SED()
sed.sfh = (self._sfh[0].copy(), self._sfh[1].copy())
sed._sfh = (self._sfh[0], self._sfh[1])
sed.modules = self.modules[:]
if self.wavelength_grid is not None:
sed.wavelength_grid = self.wavelength_grid.copy()
......
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