-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Removed unnecessary models and NumCosmo run scripts - Introduced new NumCosmo app (0.21.1) with required features - Updated example to remove deprecated variable usage - Removed unused variables from example values.ini - Updated NumCosmo connector to utilize new facilities (0.21.0) for serialization - Updated example ini to use proper Cosmosis configuration - Reorganized examples testing in CI - Added power spectra to NumCosmo conversions - Moved conversion functions to NamedParameters, added unit tests - Updated unit tests for new NumCosmo connector - Conducted more testing for next connector helper functions - Inverted conversion order since bool is int - Tested set/get in NumCosmo likelihoods - Tested empty NumCosmo data objects - Employed cleaner parametrization (omega_b, omega_c) instead of (omega_m, omega_c) - Created new NumCosmo cookbook - Resolved tabs issue in codecov.yml, changed tabs to spaces, removed comments, and linked to documentation - Upgraded codecov-action to v4, added flag to fail CI if upload fails We are passsing this review even though Coveralls is complaining because the changed lines have 100% test coverage, as verified by CodeCov.
- Loading branch information
Showing
31 changed files
with
1,078 additions
and
1,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,38 @@ | ||
# comment: false | ||
# See https://docs.codecov.com/docs/codecovyml-reference for config reference | ||
# To validate: `curl -X POST --data-binary @codecov.yml https://codecov.io/validate` | ||
|
||
comment: | ||
layout: "diff, flags, files" | ||
behavior: default | ||
# if true: only post the comment if coverage changes | ||
require_changes: false | ||
|
||
# [true :: must have a base report to post] | ||
require_base: false | ||
|
||
# [true :: must have a head report to post] | ||
require_head: true | ||
|
||
# [true :: only show coverage on the git diff] | ||
hide_project_coverage: false | ||
|
||
coverage: | ||
|
||
# What precision do you want the coverage value to be | ||
precision: 1 | ||
# Which direction to you want to round the coverage value | ||
round: down | ||
# The value range where you want the value to be green | ||
range: 95..100 | ||
# red below 70, yellow between 70 and 95, green above 95. | ||
range: 70..95 | ||
|
||
status: | ||
# The codecov/patch status only measures lines adjusted | ||
# in the pull request or single commit, if the commit is | ||
# not in a pull request. This status provides an indication | ||
# on how well the pull request is tested. | ||
patch: | ||
default: | ||
# basic | ||
target: 100% | ||
threshold: 0% | ||
|
||
# advanced | ||
branches: | ||
- master | ||
if_ci_failed: error #success, failure, error, ignore | ||
branches: [master] | ||
if_ci_failed: error | ||
only_pulls: false | ||
|
||
# The codecov/project status measures overall project | ||
# coverage and compares it against the base of the pull | ||
# request or parent commit. | ||
project: | ||
default: | ||
# auto will use the coverage from the base commit | ||
# (pull request base or parent commit) coverage to | ||
# compare against. | ||
target: auto | ||
# Allow the coverage to drop by X%, and posting a success status | ||
threshold: 0% | ||
|
||
# advanced settings | ||
branches: | ||
- master | ||
if_ci_failed: error #success, failure, error, ignore | ||
branches: [master] | ||
if_ci_failed: error | ||
only_pulls: false | ||
# These behaviors allows users to specify what should happen | ||
# to the project status in case changes causes overall coverage | ||
# to drop, but are part of good development practices. | ||
removed_code_behavior: fully_covered_patch #off, removals_only, adjust_base", | ||
removed_code_behavior: fully_covered_patch | ||
|
||
github_checks: | ||
annotations: true #,false | ||
annotations: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
======================================= | ||
NumCosmo: Firecrown Likelihood Best Fit | ||
======================================= | ||
|
||
This recipe outlines the process to compute the best fit for Supernova SNIa data using | ||
the Firecrown example with NumCosmo. Ensure that you have already installed | ||
Firecrown, CosmoSIS, and NumCosmo and set the environment variable ``FIRECROWN_DIR`` | ||
to the location of the Firecrown installation. | ||
|
||
.. _convert-configuration-file-sn-srd: | ||
|
||
Convert Configuration File | ||
========================== | ||
|
||
Use the NumCosmo command-line tool to convert the ``sn_srd.ini`` file into a NumCosmo | ||
configuration in a ``yaml`` file. Since this likelihood does not require a | ||
power-spectrum likelihood, you can use the ``from-cosmosis`` command without any extra | ||
flags `--matter-ps eisenstein_hu` nor `--nonlin-matter-ps halofit`. To mute the output | ||
of the consistency cosmosis module, use ``--mute-cosmosis``. | ||
|
||
.. code-block:: bash | ||
cd $FIRECROWN_DIR/examples/srd_sn | ||
numcosmo from-cosmosis sn_srd.ini --mute-cosmosis | ||
This command creates a file called ``sn_srd.yaml``, NumCosmo's experiment file. It | ||
contains cosmological and likelihood parameters, modeling choices, and chosen precision. | ||
|
||
.. _compute-bestfit-sn-srd: | ||
|
||
Run NumCosmo App | ||
================ | ||
|
||
Execute the NumCosmo app with the experiment file to compute the best fit. The | ||
following command saves the output in a new ``yaml`` file. Use the ``--help`` flag for | ||
available options. | ||
|
||
.. code-block:: bash | ||
cd $FIRECROWN_DIR/examples/srd_sn | ||
numcosmo run fit sn_srd.yaml --output sn_srd-bestfit.yaml | ||
The best fit is saved in ``sn_srd-bestfit.yaml``. Inspect the file to view the | ||
best-fitting values. This file serves as the starting point for subsequent runs. | ||
|
||
Restart Minimization Algorithm (Optional) | ||
========================================= | ||
|
||
If dealing with a high-dimensional parameter space or non-converging algorithms, | ||
consider using the `--restart` flag. This restarts the minimization algorithm from the | ||
best-fit found so far. | ||
|
||
.. code-block:: bash | ||
cd $FIRECROWN_DIR/examples/srd_sn | ||
numcosmo run fit sn_srd.yaml --output sn_srd-bestfit.yaml --starting-point sn_srd-bestfit.yaml --restart 1.0e-3 0.0 | ||
The command restarts the minimization algorithm if the absolute change in the | ||
likelihood is less than 1.0e-3 and the relative change is less than 0.0. | ||
|
||
Note: ``sn_srd-bestfit.yaml`` cannot be used as the experiment file for the | ||
``numcosmo`` command-line tool since it lacks data and model information. | ||
|
||
Results Summary | ||
=============== | ||
|
||
* **Starting Point:** | ||
|
||
* m2lnL: 1215 | ||
* Parameters: | ||
|
||
* sn_ddf_sample_M: -19.30 | ||
* Omegac: 0.260 | ||
|
||
* **Best Fit:** | ||
|
||
* m2lnL: 1.70934 | ||
* Parameters: | ||
|
||
* sn_ddf_sample_M: -19.426 | ||
* Omegac: 0.265 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
================================================= | ||
Cookbook using NumCosmo | ||
================================================= | ||
|
||
Recipes for using Firecrown through the NumCosmo connector for cosmological analyses. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: NumCosmo Cookbook | ||
:name: numcosmo_cookbook | ||
|
||
Computing Best-Fit <numcosmo_bestfit.rst> | ||
Computing Fisher Matrix <numcosmo_fisher.rst> | ||
Computing Fisher Bias <numcosmo_fisher_bias.rst> | ||
|
||
|
Oops, something went wrong.