Skip to content

Commit ad69062

Browse files
authored
Merge pull request #68 from LSSTDESC/fix-updated-firecrown
Fix Smokescreen for updated firecrown
2 parents b980606 + c9283a9 commit ad69062

File tree

16 files changed

+726
-155
lines changed

16 files changed

+726
-155
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
max-line-length = 100
2+
max-line-length = 120
33
per-file-ignores =
44
__main__.py: W291, W293
55
conf.py: E303

.github/workflows/CI.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
# Don't quit all jobs if only one job fails.
2424
fail-fast: false
2525
matrix:
26-
python-version: ["3.9"]
27-
os: [ubuntu-20.04, macos-latest]
26+
python-version: ["3.11"]
27+
os: [ubuntu-24.04, macos-latest]
2828
include:
29-
- os: ubuntu-20.04
29+
- os: ubuntu-24.04
3030
INSTALL_DEPS: sudo apt-get update && sudo apt-get -y install gfortran-7 swig libopenmpi-dev openmpi-bin libopenblas-dev && sudo ln -s `which gfortran-7` /usr/local/bin/gfortran
3131
- os: macos-latest
3232
INSTALL_DEPS: brew update-reset && HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install gcc swig libomp open-mpi openblas && if [ ! -f /usr/local/bin/gfortran ]; then ln -s /usr/local/bin/gfortran-$(brew list --versions gcc | awk '{print $2}' | cut -d. -f1) /usr/local/bin/gfortran; fi
@@ -87,7 +87,7 @@ jobs:
8787
- name: flake8
8888
uses: py-actions/flake8@v2
8989
with:
90-
max-line-length: "100"
90+
max-line-length: "120"
9191
# run: |
9292
# conda activate desc_smokescreen
9393
# flake8 src/smokescreen

docs/source/usage.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ You can find an example of a configuration file here:
9393
sigma8: 0.85
9494
keep_original_sacc: true
9595
96+
.. note::
97+
98+
**As of version 1.5.0 of Smokescreen, you no longer need to provide the `systematics` dictionary in the configuration file. The module will automatically extract the systematics from the firecrown likelihood's default values. Of course, you can still provide this dictionary if you want values different than the firecrown defaults**
99+
96100
.. warning::
97101

98102
**By default, the original SACC file is deleted after the encryption. If you want to keep the original SACC file, you can set the `keep_original_sacc` parameter to `true` in the configuration file.**
@@ -131,6 +135,7 @@ The smokescreen module can be used to blind the data-vector measurements. The mo
131135
# load a sacc object with the data vector [FIXME: this is a placeholder, the sacc object should be loaded from the likelihood]
132136
sacc_data = sacc.Sacc.load_fits('path/to/data_vector.sacc')
133137
# create a dictionary of the necessary firecrown nuisance parameters
138+
# from version 1.5.0 of Smokescreen, the systematics dictionary can be optional (more info above)
134139
syst_dict = {
135140
"ia_a_1": 1.0,
136141
"ia_a_2": 0.5,
@@ -142,8 +147,10 @@ The smokescreen module can be used to blind the data-vector measurements. The mo
142147
"src0_delta_z": 0.000,
143148
"lens0_delta_z": 0.000,}
144149
# create the smokescreen object
145-
smoke = ConcealDataVector(cosmo, syst_dict, sacc_data, my_likelihood,
146-
{'Omega_c': (0.22, 0.32), 'sigma8': (0.7, 0.9)}, shift_distr='flat')
150+
smoke = ConcealDataVector(cosmo, sacc_data, my_likelihood,
151+
{'Omega_c': (0.22, 0.32), 'sigma8': (0.7, 0.9)},
152+
syst_dict,
153+
shift_distr='flat')
147154
# conceals (blinds) the data vector
148155
smoke.calculate_concealing_factor()
149156
concealed_dv = smoke.apply_concealing_to_likelihood_datavec()

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
- pytest
1212
- pip
1313
- numcosmo
14-
- firecrown>=1.7.5
14+
- firecrown>=1.8
1515
- fitsio
1616
- pyccl >=3.0.2
1717
- cryptography

examples/cosmic_shear/blind_cosmic_shear_example.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
path_to_sacc: "./cosmicshear_sacc2.fits"
22
likelihood_path: "./cosmicshear_likelihood.py"
3-
systematics:
4-
trc1_delta_z: 0.1
5-
trc0_delta_z: 0.1
63
shifts_dict:
74
Omega_c: [0.18, 0.34]
85
sigma8: [0.67, 0.95]
6+
systematics:
7+
trc1_delta_z: 0.1
8+
trc0_delta_z: 0.1
99
seed: 2112
1010
shift_distribution: "flat"
1111
# only needed if you want a different reference cosmology
Binary file not shown.
0 Bytes
Binary file not shown.

notebooks/test_blinding_prototype.ipynb

Lines changed: 439 additions & 25 deletions
Large diffs are not rendered by default.

notebooks/test_cosmicshear_example.ipynb

Lines changed: 18 additions & 19 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ classifiers = [
1717
"Operating System :: OS Independent",
1818
]
1919
dependencies = [
20-
"numpy>=1.24.0",
20+
"numpy>=2.2.0",
2121
"scipy>=1.9.0",
2222
"astropy>=5.2.0",
2323
"pytest>=7.2.5",
2424
"sacc>=0.12",
25-
"pyccl>=3.0.2",
25+
#"pyccl>=3.0.2",
2626
"jsonargparse[signatures]>=4.0",
2727
"pytest",
2828
"pytest-cov",
@@ -43,7 +43,7 @@ docs = [
4343
where = ["src"]
4444

4545
[tool.flake8]
46-
max-line-length = 100
46+
max-line-length = 120
4747

4848
[project.urls]
4949
Homepage = "https://github.com/LSSTDESC/Smokescreen"

0 commit comments

Comments
 (0)