xzackli / Bolt.jl

differentiable boltzmann code
MIT License
42 stars 5 forks source link

0.1% accuracy #69

Closed xzackli closed 2 years ago

xzackli commented 2 years ago

This PR includes modifications to the hierarchy which allows Bolt transfer functions to reach 0.1% agreement with CLASS in perturbations like Phi, delta_c, delta_b, and the photon monopole.

This PR also includes a change of units! Previously we were using natural units with a base unit of eV. This is not very useful for cosmology -- we join the rest of the world and use Megaparsecs as the base natural unit.

xzackli commented 2 years ago

reltol = 1e-7 download

marius311 commented 2 years ago

Docs now build Jamie's notebook, see preview here: https://xzackli.github.io/Bolt.jl/previews/PR69/basic_usage/

The notebook is stored in the repo as inputs-only here, and there's a Git precommit hook that strips outputs so you never forget and accidentally check in the outputs. You'll need to pip install nbstripout for this.

marius311 commented 2 years ago

Lemme know if you're good with reducing the number of tests too, just figured there's not really any platform dependent stuff but don't feel strongly about that.

xzackli commented 2 years ago

I totally agree with just the single platform for tests!

marius311 commented 2 years ago

Fwiw @xzackli if you're annoyed by test deps, I would recommend switching to having a test/Project.toml for test dependencies, rather than putting them in the main Project.toml, I think that's the current recommended thing. An added bonus is you can activate the testing environment with using TestEnv; TestEnv.activate() and you'll get the exact environment the tests see. I don't think the current thing works with that.

xzackli commented 2 years ago

Wow -- I hated the way I had to use test deps, this is a nice development. I'll change it over.

codecov-commenter commented 2 years ago

Codecov Report

Merging #69 (05fb6ae) into main (de08e4d) will increase coverage by 24.65%. The diff coverage is 57.77%.

@@             Coverage Diff             @@
##             main      #69       +/-   ##
===========================================
+ Coverage   46.09%   70.74%   +24.65%     
===========================================
  Files           7        7               
  Lines         692      694        +2     
===========================================
+ Hits          319      491      +172     
+ Misses        373      203      -170     
Impacted Files Coverage Δ
src/Bolt.jl 0.00% <0.00%> (-100.00%) :arrow_down:
src/ionization/ionization.jl 20.83% <0.00%> (-3.76%) :arrow_down:
src/spectra.jl 0.00% <0.00%> (ø)
src/background.jl 93.18% <83.33%> (+6.81%) :arrow_up:
src/perturbations.jl 79.26% <90.00%> (+79.26%) :arrow_up:
src/ionization/recfast.jl 91.78% <100.00%> (-0.08%) :arrow_down:
src/util.jl 100.00% <0.00%> (+1.58%) :arrow_up:
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update de08e4d...05fb6ae. Read the comment docs.