esheldon / esutil

A variety of python utilities focusing on numerical, scientific, and astrophysical computing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

segfault if cosmology object is deepcopied

erykoff opened this issue · comments

I suppose this is something that isn't supported, but should probably raise an exception rather than completely segfaulting...(tested on both linux and mac)

In [2]: import copy
In [3]: cosmo=esutil.cosmology.Cosmo()
In [4]: cosmo.Dl(0,1.0)
Out[4]: 4625.360378585448
In [5]: cosmo2=copy.deepcopy(cosmo)
In [6]: cosmo2.Dl(0,1.0)
Segmentation fault

I put in some code so this works, see the copy branch.

It isn't a proper implementation but seems to work.