Skip to content

Adds ODEs for structure growth. Makes WCDM and LCDM initialization more uniform. - #45

Open
dforero0896 wants to merge 15 commits into
JuliaAstro:mainfrom
dforero0896:master
Open

Adds ODEs for structure growth. Makes WCDM and LCDM initialization more uniform.#45
dforero0896 wants to merge 15 commits into
JuliaAstro:mainfrom
dforero0896:master

Conversation

@dforero0896

Copy link
Copy Markdown

Hi,
I have taken the liberty to add some functionality by providing a function to compute the growth factor and its first and second derivatives. So far I have not been able to redefine the Cosmology structures so that they allow for a cache in order to avoid re-solving the ODE in each call like fastpm does, for example. I have added tests for this part in the test suite.

I have also modified the Cosmology structures so they are all defined as the WCDM were, within the loop. I think this makes development much easier. Moreover, I made the structures able to accept kwargs instead and changed the relevant parameters for the definition of a cosmology. In particular, OmegaR, and OmegaM are now derived from OmegaC, OmegaB, Neff and T_cmb. Nonetheless, I have left OmegaM and OmegaR kewords in the cosmology function so the tests are still compatible.

Please feel free to check and modify as you please and merge if you find these modifications useful :). Also don;t hesitate to write back if there are any questions.
Thanks!

…ation so LCDM are initialized as WCDM. Separated gamma and reutrino and cdm and baryons. Still supports OmegaM and OmegaR so tests work
…ation so LCDM are initialized as WCDM. Separated gamma and reutrino and cdm and baryons. Still supports OmegaM and OmegaR so tests work
@codecov

codecov Bot commented Sep 12, 2022

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.96%. Comparing base (04b978f) to head (0053248).

Files with missing lines Patch % Lines
src/Cosmology.jl 90.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main      #45      +/-   ##
===========================================
- Coverage   100.00%   93.96%   -6.04%     
===========================================
  Files            1        1              
  Lines           78      116      +38     
===========================================
+ Hits            78      109      +31     
- Misses           0        7       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcobonici

Copy link
Copy Markdown

Is there any update on this PR?
I have implemented in some of my packages a growth factor evaluation using DiffEq, which looks quite similar to the written here. It would be nice to have a single, community tested implementation for this kind of calculation.

@giordano

Copy link
Copy Markdown
Member

Sorry, I personally never had the time to look into this also because I'm not much into this field. However I'd note that DifferentialEquations.jl is a quite heavy dependency which I'd rather not add to such a lightweight package like Cosmology.jl. Is there any possibility of making this feature a package extension, so that it's enabled only if DifferentialEquations.jl is already present in the environment?

@abhro

abhro commented May 6, 2026

Copy link
Copy Markdown
Member

Now that SciML broke up its big packages into smaller components, depending on what's being used, could we change the dependency into OrdinaryDiffEq.jl or something?

@abhro

abhro commented Jun 23, 2026

Copy link
Copy Markdown
Member

Merge conflicts "technically" resolved if you squint, but I'll be making more commits soon to actually get the code correct

@abhro

abhro commented Jun 24, 2026

Copy link
Copy Markdown
Member

To limit the scope of this PR, I'm thinking if the re-definition of the structs should be removed and deferred for a later date, only keeping the ODE and new functions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants