Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
run: |
python -m unittest python/snewpy/test/simplerate_integrationtest.py
pytest -m 'snowglobes'
- name: Run notebooks test
run: |
pytest --nbval-lax doc/source/nb
- uses: r-lib/actions/setup-pandoc@v2

- name: Build HTML docs
Expand Down
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
# directories to ignore when looking for source files.
exclude_patterns = ['nb/dev']

nbsphinx_allow_errors = True
Comment thread
JostMigenda marked this conversation as resolved.
Outdated
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
Expand Down
21 changes: 8 additions & 13 deletions doc/source/nb/ccsn/Bollig_2016.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -141,28 +141,23 @@
"\n",
"for i, spec in enumerate([ispec, ospec_nmo]):\n",
" ax = axes[i]\n",
" for flavor in Flavor:\n",
" ax.plot(E, spec[flavor],\n",
" label=flavor.to_tex(),\n",
" color='C0' if flavor.is_electron else 'C1',\n",
" ls='-' if flavor.is_neutrino else ':', lw=2,\n",
" alpha=0.7)\n",
"\n",
" ax.set(xlabel=r'$E$ [{}]'.format(E.unit),\n",
" title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" plt.sca(ax)\n",
" spec.plot('energy')\n",
" \n",
" ax.set(title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" ax.grid()\n",
" ax.legend(loc='upper right', ncol=2, fontsize=16)\n",
"\n",
"ax = axes[0]\n",
"ax.set(ylabel=r'flux [erg$^{-1}$ s$^{-1}$]')\n",
"ax.set(ylabel=r'flux, MeV')\n",
"\n",
"fig.tight_layout();"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "snewpy",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -176,9 +171,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
21 changes: 6 additions & 15 deletions doc/source/nb/ccsn/Fischer_2020.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,15 @@
"\n",
"for i, spec in enumerate([ispec, ospec_nmo]):\n",
" ax = axes[i]\n",
" for flavor in Flavor:\n",
" if flavor.is_electron == True:\n",
" color='C0'\n",
" else:\n",
" color='C1'\n",
" ax.plot(E, spec[flavor],\n",
" label=flavor.to_tex(),\n",
" color=color,\n",
" ls='-' if flavor.is_neutrino else ':', lw=2,\n",
" alpha=0.7)\n",
"\n",
" ax.set(xlabel=r'$E$ [{}]'.format(E.unit),\n",
" title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" plt.sca(ax)\n",
" spec.plot('energy')\n",
" \n",
" ax.set(title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" ax.grid()\n",
" ax.legend(loc='upper right', ncol=2, fontsize=16)\n",
"\n",
"ax = axes[0]\n",
"ax.set(ylabel=r'flux [erg$^{-1}$ s$^{-1}$]')\n",
"ax.set(ylabel=r'flux, MeV')\n",
"\n",
"fig.tight_layout();"
]
Expand All @@ -160,7 +151,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.13.5"
},
"vscode": {
"interpreter": {
Expand Down
21 changes: 8 additions & 13 deletions doc/source/nb/ccsn/Kuroda_2020.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -152,28 +152,23 @@
"\n",
"for i, spec in enumerate([ispec, ospec_nmo]):\n",
" ax = axes[i]\n",
" for flavor in Flavor:\n",
" ax.plot(E, spec[flavor],\n",
" label=flavor.to_tex(),\n",
" color='C0' if flavor.is_electron else 'C1',\n",
" ls='-' if flavor.is_neutrino else ':', lw=2,\n",
" alpha=0.7)\n",
"\n",
" ax.set(xlabel=r'$E$ [{}]'.format(E.unit),\n",
" title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" plt.sca(ax)\n",
" spec.plot('energy')\n",
" \n",
" ax.set(title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" ax.grid()\n",
" ax.legend(loc='upper right', ncol=2, fontsize=16)\n",
"\n",
"ax = axes[0]\n",
"ax.set(ylabel=r'flux [erg$^{-1}$ s$^{-1}$]')\n",
"ax.set(ylabel=r'flux, MeV')\n",
"\n",
"fig.tight_layout();"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.5 ('snews')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -187,7 +182,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.13.5"
},
"vscode": {
"interpreter": {
Expand All @@ -196,5 +191,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
19 changes: 8 additions & 11 deletions doc/source/nb/ccsn/Nakazato_2013.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,17 @@
"\n",
"for i, spec in enumerate([ispec, ospec_nmo]):\n",
" ax = axes[i]\n",
" for flavor in Flavor:\n",
" ax.plot(E, spec[flavor],\n",
" label=flavor.to_tex(),\n",
" color='C0' if flavor.is_electron else 'C1',\n",
" ls='-' if flavor.is_neutrino else ':', lw=2,\n",
" alpha=0.7)\n",
"\n",
" ax.set(xlabel=r'$E$ [{}]'.format(E.unit),\n",
" title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" plt.sca(ax)\n",
" spec.plot('energy')\n",
" \n",
" ax.set(title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" ax.grid()\n",
" ax.legend(loc='upper right', ncol=2, fontsize=16)\n",
"\n",
"ax = axes[0]\n",
"ax.set(ylabel=r'flux [erg$^{-1}$ s$^{-1}$]');"
"ax.set(ylabel=r'flux, MeV')\n",
"\n",
"fig.tight_layout();"
]
}
],
Expand All @@ -198,7 +195,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.13.5"
},
"vscode": {
"interpreter": {
Expand Down
19 changes: 7 additions & 12 deletions doc/source/nb/ccsn/OConnor_2013.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,15 @@
"\n",
"for i, spec in enumerate([ispec, ospec_nmo]):\n",
" ax = axes[i]\n",
" for flavor in Flavor:\n",
" ax.plot(E, spec[flavor],\n",
" label=flavor.to_tex(),\n",
" color='C0' if flavor.is_electron else 'C1',\n",
" ls='-' if flavor.is_neutrino else ':', lw=2,\n",
" alpha=0.7)\n",
"\n",
" ax.set(xlabel=r'$E$ [{}]'.format(E.unit),\n",
" title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" plt.sca(ax)\n",
" spec.plot('energy')\n",
" \n",
" ax.set(title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" ax.grid()\n",
" ax.legend(loc='upper right', ncol=2, fontsize=16)\n",
"\n",
"ax = axes[0]\n",
"ax.set(ylabel=r'flux [erg$^{-1}$ s$^{-1}$]')\n",
"ax.set(ylabel=r'flux, MeV')\n",
"\n",
"fig.tight_layout();"
]
Expand All @@ -181,7 +176,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.13.5"
},
"vscode": {
"interpreter": {
Expand All @@ -190,5 +185,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
21 changes: 8 additions & 13 deletions doc/source/nb/ccsn/OConnor_2015.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -137,28 +137,23 @@
"\n",
"for i, spec in enumerate([ispec, ospec_nmo]):\n",
" ax = axes[i]\n",
" for flavor in Flavor:\n",
" ax.plot(E, spec[flavor],\n",
" label=flavor.to_tex(),\n",
" color='C0' if flavor.is_electron else 'C1',\n",
" ls='-' if flavor.is_neutrino else ':', lw=2,\n",
" alpha=0.7)\n",
"\n",
" ax.set(xlabel=r'$E$ [{}]'.format(E.unit),\n",
" title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" plt.sca(ax)\n",
" spec.plot('energy')\n",
" \n",
" ax.set(title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" ax.grid()\n",
" ax.legend(loc='upper right', ncol=2, fontsize=16)\n",
"\n",
"ax = axes[0]\n",
"ax.set(ylabel=r'flux [erg$^{-1}$ s$^{-1}$]')\n",
"ax.set(ylabel=r'flux, MeV')\n",
"\n",
"fig.tight_layout();"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.5 ('snews')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -172,7 +167,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.13.5"
},
"vscode": {
"interpreter": {
Expand All @@ -181,5 +176,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
21 changes: 8 additions & 13 deletions doc/source/nb/ccsn/Sukhbold_2015.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,23 @@
"\n",
"for i, spec in enumerate([ispec, ospec_nmo]):\n",
" ax = axes[i]\n",
" for flavor in Flavor:\n",
" ax.plot(E, spec[flavor],\n",
" label=flavor.to_tex(),\n",
" color='C0' if flavor.is_electron else 'C1',\n",
" ls='-' if flavor.is_neutrino else ':', lw=2,\n",
" alpha=0.7)\n",
"\n",
" ax.set(xlabel=r'$E$ [{}]'.format(E.unit),\n",
" title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" plt.sca(ax)\n",
" spec.plot('energy')\n",
" \n",
" ax.set(title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" ax.grid()\n",
" ax.legend(loc='upper right', ncol=2, fontsize=16)\n",
"\n",
"ax = axes[0]\n",
"ax.set(ylabel=r'flux [erg$^{-1}$ s$^{-1}$]')\n",
"ax.set(ylabel=r'flux, MeV')\n",
"\n",
"fig.tight_layout();"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.5 ('snews')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -179,7 +174,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.13.5"
},
"vscode": {
"interpreter": {
Expand All @@ -188,5 +183,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
23 changes: 10 additions & 13 deletions doc/source/nb/ccsn/Tamborra_2014.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,23 @@
"\n",
"for i, spec in enumerate([ispec, ospec_nmo]):\n",
" ax = axes[i]\n",
" for flavor in Flavor:\n",
" ax.plot(E, spec[flavor],\n",
" label=flavor.to_tex(),\n",
" color='C0' if flavor.is_electron else 'C1',\n",
" ls='-' if flavor.is_neutrino else ':', lw=2,\n",
" alpha=0.7)\n",
"\n",
" ax.set(xlabel=r'$E$ [{}]'.format(E.unit),\n",
" title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" plt.sca(ax)\n",
" spec.plot('energy')\n",
" \n",
" ax.set(title='Initial Spectra: $t = ${:.1f}'.format(t) if i==0 else 'Oscillated Spectra: $t = ${:.1f}'.format(t))\n",
" ax.grid()\n",
" ax.legend(loc='upper right', ncol=2, fontsize=16)\n",
"\n",
"ax = axes[0]\n",
"ax.set(ylabel=r'flux [erg$^{-1}$ s$^{-1}$]');"
"ax.set(ylabel=r'flux, MeV')\n",
"\n",
"fig.tight_layout();"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.5 ('snews')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -175,7 +172,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.13.5"
},
"vscode": {
"interpreter": {
Expand All @@ -184,5 +181,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading