Skip to content

Commit

Permalink
Unit test for multiple TOML
Browse files Browse the repository at this point in the history
See #19
  • Loading branch information
zonca committed Dec 2, 2020
1 parent 0c69569 commit cbc9921
Showing 1 changed file with 60 additions and 1 deletion.
61 changes: 60 additions & 1 deletion 05_cli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,71 @@
"hp.mollview(output_map[2], min=-1e-5, max=1e-5, unit=\"K\", title=\"Total U\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Test multiple TOML files "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%file only_CMB_scalar.toml\n",
"[sky_emission]\n",
"foreground_emission = 0\n",
"CMB_unlensed = 1\n",
"CMB_lensing_signal = 1\n",
"CMB_tensor_to_scalar_ratio = 0"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sim2 = S4RefSimTool([\"s4_reference_design.toml\", \"only_CMB_scalar.toml\"])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"assert sim2.config[\"sky_emission\"][\"foreground_emission\"] == 0"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"assert sim2.config[\"sky_emission\"][\"CMB_tensor_to_scalar_ratio\"] == 0"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"assert sim.config[\"telescopes\"] == sim2.config[\"telescopes\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"!rm only_CMB_scalar.toml"
]
}
],
"metadata": {
Expand Down

0 comments on commit cbc9921

Please sign in to comment.