Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Line Interface and main function #40

Merged
merged 24 commits into from
Jul 11, 2024
Merged

Command Line Interface and main function #40

merged 24 commits into from
Jul 11, 2024

Conversation

arthurmloureiro
Copy link
Contributor

This PR introduces a command line interface to conceal sacc data-vectors directly from the terminal. The method accepts inputs from the command line as well as inputs via a yaml configuration file.

The implementation uses the jsonargparse library which supports the following command to get help:

python -m blinding --help

or the following command to print an example configuration file:

python -m blinding --print_config > example_config.yml
  • Minor bugs in the main Smokescreen class were fixed and unit tests were implemented.
  • Fixed some issues with Github actions by updating the CI.yaml
  • CCL requirements were updated for version 3.0.2 to use the .to_dict() method.
  • Unit test coverage remains at 95% (unit tests included to cover the main function and other new utility functions too.

@arthurmloureiro arthurmloureiro added data-vector blinding Issues related to data-vector blinding SACC SACC file format related issues Github-CI CCL CCL related issues labels Jun 4, 2024
@arthurmloureiro arthurmloureiro self-assigned this Jun 4, 2024
@tilmantroester
Copy link
Collaborator

The --print_config functionality uses some inspection through jsonargparse, I assume?

@arthurmloureiro
Copy link
Contributor Author

arthurmloureiro commented Jul 3, 2024

The --print_config functionality uses some inspection through jsonargparse, I assume?

@tilmantroester Yes! But it does get a bit confused with the ccl cosmology type.

Copy link
Contributor Author

@arthurmloureiro arthurmloureiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes (but I cannot approve my own PR)

Comment on lines +42 to +52
Args:
path_to_sacc (str): Path to the sacc file to blind.
likelihood_path (str): Path to the firecrown likelihood module file.
systematics (dict): Dictionary with fixed values for the firecrown systematics parameters.
shifts_dict (dict): Dictionary with fixed values for the firecrown shifts parameters.
Example: {"Omega_c": (0.20, 0.39), "sigma8": (0.70, 0.90)}
seed (int, str): Seed for the blinding process. Defaults to 2112.
cosmo (Union[CosmologyType, dict]): Cosmology object or dictionary with cosmological parameters you want different than the
VanillaLCDM as reference cosmology.
Defaults to ccl.CosmologyVanillaLCDM().
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this part, it is missing some arguments

@arthurmloureiro arthurmloureiro merged commit ac378a3 into main Jul 11, 2024
4 checks passed
@arthurmloureiro arthurmloureiro deleted the develop branch July 11, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCL CCL related issues data-vector blinding Issues related to data-vector blinding Github-CI SACC SACC file format related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a __main__.py with the functionality of blinding a SACC file
2 participants