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

Prepare for 0.5.6 release #188

Merged
merged 11 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Install this version of ScopeSim. Otherwise the PyPI version of
# ScopeSim will be installed when the github_actions requirements
# are installed, because ScopeSim is a dependency of
# ScopeSim_Templates.
pip install .
pip install -r requirements.github_actions.txt
- name: Run Pytest
run: pytest
- name: Run notebooks
run: ./runnotebooks.sh
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include README.md
include LICENCE
include scopesim/defaults.yaml
include scopesim/vega.fits
recursive-include scopesim/data *

prune *OLD_*
prune *docs_to_be_sorted*
Expand Down
6 changes: 3 additions & 3 deletions docs/source/5_liners/source_point_source_arrays.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"import astropy.table as table\n",
"from astropy import units as u\n",
"\n",
"import scopesim as sim\n",
"import scopesim\n",
"\n",
"# how many stars\n",
"n = 200\n",
Expand All @@ -35,7 +35,7 @@
"weight = 10**(-0.4*np.linspace(10, 20, n))\n",
"\n",
"# Note: The Pyckles and SpeXtra libraries contain many more stellar and galactic spectra\n",
"vega = sim.source.source_templates.vega_spectrum(mag=20)"
"vega = scopesim.source.source_templates.vega_spectrum(mag=20)"
]
},
{
Expand Down Expand Up @@ -103,7 +103,7 @@
}
],
"source": [
"point_source = sim.Source(spectra=[vega], x=x, y=y, ref=ref, weight=weight)\n",
"point_source = scopesim.Source(spectra=[vega], x=x, y=y, ref=ref, weight=weight)\n",
"\n",
"point_source.plot()"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/1_scopesim_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
],
"source": [
"plt.figure(figsize=(10,8))\n",
"plt.imshow(hdus[0][1].data, norm=LogNorm(), vmax=3E4, vmin=3E3, cmap=\"hot\")\n",
"plt.imshow(hdus[0][1].data, norm=LogNorm(vmax=3E4, vmin=3E3), cmap=\"hot\")\n",
"plt.colorbar()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/2_multiple_telescopes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"plt.title(\"1.5m LFOA\")\n",
"\n",
"plt.subplot(122)\n",
"plt.imshow(hdus_micado[0][1].data, norm=LogNorm(), origin=\"lower\", vmax=1E6, vmin=1e5)\n",
"plt.imshow(hdus_micado[0][1].data, norm=LogNorm(vmax=1E6, vmin=1e5), origin=\"lower\")\n",
"plt.colorbar()\n",
"plt.title(\"39m ELT\")"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"hdulist = opt.readout()[0]\n",
"\n",
"plt.figure(figsize=(10,8))\n",
"plt.imshow(hdulist[1].data, norm=LogNorm(), vmin=1)\n",
"plt.imshow(hdulist[1].data, norm=LogNorm(vmin=1))\n",
"plt.colorbar()"
]
},
Expand Down
1 change: 1 addition & 0 deletions requirements.github_actions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ scipy
astropy
matplotlib
jupyter
jupytext

docutils
requests
Expand Down
22 changes: 22 additions & 0 deletions runnotebooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# https://github.com/koalaman/shellcheck/wiki/SC2044
find . -iname "*.ipynb" -print0 | while IFS= read -r -d '' fnnotebook
do
echo "Testing ${fnnotebook}"
fnpy="${fnnotebook%.ipynb}.py"

# Convert .ipynb file to .py.
jupytext --to py "${fnnotebook}"

# Run the python script and quit on first error.
python "${fnpy}" || exit 1

# Delete generated files if --delete is specified.
# By default do not delete any files.
if [ "x$1" = "x--delete" ]
then
rm "${fnpy}"
fi

done
Loading