Skip to content

Commit

Permalink
Merge pull request #188 from AstarVienna/dev_master
Browse files Browse the repository at this point in the history
Prepare for 0.5.6 release
  • Loading branch information
hugobuddel committed Mar 13, 2023
2 parents 3d8770c + c00a067 commit 2fd61cf
Show file tree
Hide file tree
Showing 101 changed files with 101,789 additions and 14 deletions.
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

0 comments on commit 2fd61cf

Please sign in to comment.