Skip to content

Commit 03e1740

Browse files
author
Raphael Shirley
committed
Made notebooks run with updated config system
1 parent d5157e7 commit 03e1740

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

examples/cosmos_demo.ipynb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"source": [
5555
"lephare_config = lp.default_cosmos_config\n",
5656
"# For useable science results you must use a denser redshift grid by commenting out the following line which will revert to the config dz of 0.01.\n",
57-
"lephare_config['Z_STEP']= \".1,0.,7.\"\n",
57+
"lephare_config['Z_STEP']= \"0.1,0.,7.\"\n",
5858
"nobj=100 # Increase to run on more objects. Set to -1 to run on all.\n",
5959
"\n",
6060
"lp.data_retrieval.get_auxiliary_data(keymap=lephare_config, additional_files=[\"examples/COSMOS.in\",\"examples/output.para\"])"
@@ -130,11 +130,16 @@
130130
" nondetect_val=np.nan,\n",
131131
" model=\"lephare.pkl\",\n",
132132
" hdf5_groupname=\"\",\n",
133-
" lephare_config=lephare_config,\n",
133+
" **{f\"lephare.{k}\": v for k, v in lephare_config.items()},\n",
134134
" bands=flux_cols,\n",
135135
" err_bands=flux_err_cols,\n",
136136
" ref_band=flux_cols[0],\n",
137137
" do_prepare = True,\n",
138+
"\n",
139+
" # These overwrite the config ZSTEP so must be set\n",
140+
" zmin=float(lephare_config['Z_STEP'].split(',')[1]),\n",
141+
" zmax=float(lephare_config['Z_STEP'].split(',')[2]),\n",
142+
" nzbins=1+float(lephare_config['Z_STEP'].split(',')[2])/float(lephare_config['Z_STEP'].split(',')[0]),\n",
138143
")\n",
139144
"\n"
140145
]
@@ -282,7 +287,7 @@
282287
],
283288
"metadata": {
284289
"kernelspec": {
285-
"display_name": "rail",
290+
"display_name": "Python 3 (ipykernel)",
286291
"language": "python",
287292
"name": "python3"
288293
},
@@ -296,7 +301,7 @@
296301
"name": "python",
297302
"nbconvert_exporter": "python",
298303
"pygments_lexer": "ipython3",
299-
"version": "3.13.2"
304+
"version": "3.10.18"
300305
}
301306
},
302307
"nbformat": 4,

examples/small_demo.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"outputs": [],
6969
"source": [
7070
"lephare_config_file = \"../tests/data/lsst.para\"\n",
71-
"lephare_config = lp.read_config(lephare_config_file)\n",
71+
"lephare_config = lp.keymap_to_string_dict(lp.read_config(lephare_config_file))\n",
7272
"\n",
7373
"lp.data_retrieval.get_auxiliary_data(keymap=lephare_config)"
7474
]
@@ -92,7 +92,7 @@
9292
" model=\"lephare.pkl\",\n",
9393
" hdf5_groupname=\"\",\n",
9494
" # Use a sparse redshift grid to speed up the notebook\n",
95-
" lephare_config=lp.keymap_to_string_dict(lephare_config),\n",
95+
" **{f\"lephare.{k}\": v for k, v in lephare_config.items()},\n",
9696
" zmin=0,\n",
9797
" zmax=5,\n",
9898
" nzbins=51,\n",
@@ -201,7 +201,7 @@
201201
],
202202
"metadata": {
203203
"kernelspec": {
204-
"display_name": "rail",
204+
"display_name": "Python 3 (ipykernel)",
205205
"language": "python",
206206
"name": "python3"
207207
},
@@ -215,7 +215,7 @@
215215
"name": "python",
216216
"nbconvert_exporter": "python",
217217
"pygments_lexer": "ipython3",
218-
"version": "3.13.2"
218+
"version": "3.10.18"
219219
}
220220
},
221221
"nbformat": 4,

0 commit comments

Comments
 (0)