Repository navigation
cosmo: refactor separate rhocrit mixin - #17500
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
Signed-off-by: nstarman <[email protected]>
3915d40 to
08c059d
Compare
critical_density0 is cached, so it’s fine to use the simpler but slower expression. Signed-off-by: nstarman <[email protected]>
08c059d to
03a7921
Compare
Signed-off-by: nstarman <[email protected]>
03a7921 to
2d77caa
Compare
mhvk
left a comment
There was a problem hiding this comment.
I'm still not quite clear of the benefit of splitting the basic methods out into separate classes, but will take your word for it.
That leaves only one question: you state that performance is not critical since values are cached, but that would only be the case if a given cosmology is used multiple times to calculate something. If one is fitting a cosmology and in the process, say, varying H, so that the fits includes creating a new instance every iteration, then performance might still matter.
Though to be honest I doubt it will for the piece that you remove here, so approving.
Part of #17150
In draft mode until #17153 is merged.This PR also simplifies the calculation for critical_density0 since the value is cached and performance is no longer critical.