LSSTDESC / CCL

DESC Core Cosmology Library: cosmology routines with validated numerical accuracy
BSD 3-Clause "New" or "Revised" License
145 stars 68 forks source link

Add new halo models to convert_concentration #1105

Closed hsinfan1996 closed 1 year ago

hsinfan1996 commented 1 year ago

Add support for the Einasto and Hernquist profiles, although the Einasto profile itself uses the equation for NFW when getting the alpha parameter from cosmology. Now the function is in pure python, and it runs slower. For comparison, converting one concentration value takes 5 μs before vs 270 μs now and converting an array of 10 concentration values takes 6 μs before vs 600 μs now. I will close this PR if this is unacceptably slow.

hsinfan1996 commented 1 year ago

~I cannot seem to fix the tests, but looks like~ it is swig related. In swig-generated ccllib.py, if numpy.shape(c_in) != (nout,): was placed under cosmology_compute_sigma, where it should not be.

FIXED: %feature("pythonprepend") was not added at the end of ccl_musigma.i, which affected the next file after ccl_mass_conversion.i was removed. Not sure if it had been intended.

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 5571318719


Totals Coverage Status
Change from base Build 5553290862: 0.005%
Covered Lines: 5657
Relevant Lines: 5806

💛 - Coveralls
damonge commented 1 year ago

Humm, although this is not something that is currently heavily used, I would rather not replace something in the code by a version that is so much slower. I can see two options:

hsinfan1996 commented 1 year ago

Not planning on touching c-level files. Since CLMM already had this functionality, will close this PR.