From 330bdc6bb1190de46edcdfbb2ab9f5ed859ef189 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Tue, 18 Jan 2022 09:22:21 -0500 Subject: [PATCH 1/6] add pre-commit config --- .pre-commit-config.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..40defc0f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files +- repo: https://github.com/kynan/nbstripout + rev: 0.5.0 + hooks: + - id: nbstripout + args: ["--extra-keys='metadata.kernelspec metadata.language_info.version metadata.toc'"] From 09ce9e73c6a10333a0961848586cc6dbc2618468 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Tue, 18 Jan 2022 09:24:46 -0500 Subject: [PATCH 2/6] Run nbstripout on all notebook files --- tutorials/FITS-cubes/FITS-cubes.ipynb | 21 +---- tutorials/FITS-header/FITS-header.ipynb | 12 +-- tutorials/FITS-images/FITS-images.ipynb | 8 +- tutorials/FITS-tables/FITS-tables.ipynb | 40 +++------- .../Models-Quick-Fit/Models-Quick-Fit.ipynb | 80 +++++-------------- tutorials/UVES/UVES.ipynb | 21 +---- .../User-Defined-Model.ipynb | 5 -- .../1-Coordinates-Intro.ipynb | 21 +---- .../2-Coordinates-Transforms.ipynb | 21 +---- .../3-Coordinates-Velocities.ipynb | 21 +---- .../4-Coordinates-Crossmatch.ipynb | 21 +---- tutorials/color-excess/color-excess.ipynb | 21 +---- .../gaia-galactic-orbits.ipynb | 5 -- tutorials/plot-catalog/plot-catalog.ipynb | 5 -- tutorials/quantities/quantities.ipynb | 5 +- tutorials/redshift-plot/redshift-plot.ipynb | 5 -- .../synthetic-images/synthetic-images.ipynb | 5 -- .../units-and-integration.ipynb | 5 -- tutorials/vo/conesearch.ipynb | 8 +- .../celestial_coords1.ipynb | 21 +---- 20 files changed, 42 insertions(+), 309 deletions(-) diff --git a/tutorials/FITS-cubes/FITS-cubes.ipynb b/tutorials/FITS-cubes/FITS-cubes.ipynb index 33a7be74..78665c14 100755 --- a/tutorials/FITS-cubes/FITS-cubes.ipynb +++ b/tutorials/FITS-cubes/FITS-cubes.ipynb @@ -825,11 +825,6 @@ } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -839,21 +834,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.3" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/FITS-header/FITS-header.ipynb b/tutorials/FITS-header/FITS-header.ipynb index c6b35665..4293ed81 100755 --- a/tutorials/FITS-header/FITS-header.ipynb +++ b/tutorials/FITS-header/FITS-header.ipynb @@ -64,9 +64,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [], "source": [ "hdu_number = 0 # HDU means header data unit\n", @@ -244,11 +242,6 @@ "name": "", "published": true }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -258,8 +251,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.7" + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/FITS-images/FITS-images.ipynb b/tutorials/FITS-images/FITS-images.ipynb index ccbcc5d3..8ce293fd 100755 --- a/tutorials/FITS-images/FITS-images.ipynb +++ b/tutorials/FITS-images/FITS-images.ipynb @@ -451,11 +451,6 @@ "name": "", "published": true }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -465,8 +460,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.7" + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/FITS-tables/FITS-tables.ipynb b/tutorials/FITS-tables/FITS-tables.ipynb index e68526e7..beeee957 100755 --- a/tutorials/FITS-tables/FITS-tables.ipynb +++ b/tutorials/FITS-tables/FITS-tables.ipynb @@ -27,9 +27,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -52,9 +50,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "from astropy.utils.data import download_file" @@ -96,9 +92,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "hdu_list = fits.open(event_filename, memmap=True)" @@ -146,9 +140,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "evt_data = Table(hdu_list[1].data)" @@ -293,9 +285,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "hdu_list.close()" @@ -318,9 +308,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [] }, @@ -334,9 +322,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [] }, @@ -350,9 +336,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [] } @@ -366,11 +350,6 @@ "name": "", "published": true }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -380,8 +359,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.9" + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb b/tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb index 9efa38ab..364c879c 100755 --- a/tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb +++ b/tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb @@ -34,9 +34,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -67,9 +65,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "catalog = Vizier.get_catalogs('J/A+A/605/A100')" @@ -85,9 +81,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "period = np.array(catalog[0]['Period']) \n", @@ -184,9 +178,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "model = models.Linear1D()" @@ -209,9 +201,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "fitter = fitting.LinearLSQFitter() " @@ -234,9 +224,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [], "source": [ "best_fit = fitter(model, log_period, k_mag, weights=1.0/k_mag_err**2)\n", @@ -294,9 +282,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [] }, @@ -317,9 +303,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "N = 100\n", @@ -359,9 +343,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "model_poly = models.Polynomial1D(degree=3)\n", @@ -436,9 +418,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "def calc_reduced_chi_square(fit, x, y, yerr, N, n_free):\n", @@ -520,9 +500,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "mu, sigma, amplitude = 0.0, 10.0, 10.0\n", @@ -555,9 +533,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "model_gauss = models.Gaussian1D()\n", @@ -610,9 +586,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [], "source": [ "print('Amplitude: {} +\\- {}'.format(best_fit_gauss.amplitude.value, np.sqrt(cov_diag[0])))\n", @@ -630,9 +604,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "def f(x,a,b,c):\n", @@ -642,9 +614,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "p_opt, p_cov = scipy.optimize.curve_fit(f,x2, y2, sigma=y1_err)\n", @@ -765,9 +735,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "N3 = 100\n", @@ -781,9 +749,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": true - }, + "metadata": {}, "outputs": [], "source": [ "plt.errorbar(x3, y3, yerr=y3_err, fmt='k.')\n", @@ -794,19 +760,12 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [] } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -816,8 +775,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.2" + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/UVES/UVES.ipynb b/tutorials/UVES/UVES.ipynb index 353de599..5a706e15 100644 --- a/tutorials/UVES/UVES.ipynb +++ b/tutorials/UVES/UVES.ipynb @@ -1327,11 +1327,6 @@ "name": "", "published": true }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -1341,21 +1336,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.3" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/User-Defined-Model/User-Defined-Model.ipynb b/tutorials/User-Defined-Model/User-Defined-Model.ipynb index 4b245846..9aa554ea 100644 --- a/tutorials/User-Defined-Model/User-Defined-Model.ipynb +++ b/tutorials/User-Defined-Model/User-Defined-Model.ipynb @@ -882,11 +882,6 @@ } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython" diff --git a/tutorials/astropy-coordinates/1-Coordinates-Intro.ipynb b/tutorials/astropy-coordinates/1-Coordinates-Intro.ipynb index 3e3dff2a..7a686a59 100644 --- a/tutorials/astropy-coordinates/1-Coordinates-Intro.ipynb +++ b/tutorials/astropy-coordinates/1-Coordinates-Intro.ipynb @@ -600,11 +600,6 @@ } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -614,21 +609,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.3" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/astropy-coordinates/2-Coordinates-Transforms.ipynb b/tutorials/astropy-coordinates/2-Coordinates-Transforms.ipynb index e5fd4fca..2a9421d5 100644 --- a/tutorials/astropy-coordinates/2-Coordinates-Transforms.ipynb +++ b/tutorials/astropy-coordinates/2-Coordinates-Transforms.ipynb @@ -719,11 +719,6 @@ } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -733,21 +728,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.3" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/astropy-coordinates/3-Coordinates-Velocities.ipynb b/tutorials/astropy-coordinates/3-Coordinates-Velocities.ipynb index 626e1c37..cebd34b7 100644 --- a/tutorials/astropy-coordinates/3-Coordinates-Velocities.ipynb +++ b/tutorials/astropy-coordinates/3-Coordinates-Velocities.ipynb @@ -457,11 +457,6 @@ } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -471,21 +466,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.3" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/astropy-coordinates/4-Coordinates-Crossmatch.ipynb b/tutorials/astropy-coordinates/4-Coordinates-Crossmatch.ipynb index 6c35e13c..ad81dc05 100644 --- a/tutorials/astropy-coordinates/4-Coordinates-Crossmatch.ipynb +++ b/tutorials/astropy-coordinates/4-Coordinates-Crossmatch.ipynb @@ -378,11 +378,6 @@ } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -392,21 +387,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.3" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/color-excess/color-excess.ipynb b/tutorials/color-excess/color-excess.ipynb index 9bf8d527..37222b24 100644 --- a/tutorials/color-excess/color-excess.ipynb +++ b/tutorials/color-excess/color-excess.ipynb @@ -869,11 +869,6 @@ "toc_visible": true, "version": "0.3.2" }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -883,21 +878,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.3" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/gaia-galactic-orbits/gaia-galactic-orbits.ipynb b/tutorials/gaia-galactic-orbits/gaia-galactic-orbits.ipynb index 13620319..d336799d 100644 --- a/tutorials/gaia-galactic-orbits/gaia-galactic-orbits.ipynb +++ b/tutorials/gaia-galactic-orbits/gaia-galactic-orbits.ipynb @@ -934,11 +934,6 @@ "provenance": [], "version": "0.3.2" }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython" diff --git a/tutorials/plot-catalog/plot-catalog.ipynb b/tutorials/plot-catalog/plot-catalog.ipynb index cb2834d8..0f9281a2 100755 --- a/tutorials/plot-catalog/plot-catalog.ipynb +++ b/tutorials/plot-catalog/plot-catalog.ipynb @@ -445,11 +445,6 @@ "name": "", "published": true }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython" diff --git a/tutorials/quantities/quantities.ipynb b/tutorials/quantities/quantities.ipynb index a8c66423..209eac2c 100755 --- a/tutorials/quantities/quantities.ipynb +++ b/tutorials/quantities/quantities.ipynb @@ -1101,10 +1101,9 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.6" + "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/tutorials/redshift-plot/redshift-plot.ipynb b/tutorials/redshift-plot/redshift-plot.ipynb index 26ccc190..dc2f3048 100755 --- a/tutorials/redshift-plot/redshift-plot.ipynb +++ b/tutorials/redshift-plot/redshift-plot.ipynb @@ -325,11 +325,6 @@ "name": "Making a plot with both redshift and universe age axes", "published": true }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython" diff --git a/tutorials/synthetic-images/synthetic-images.ipynb b/tutorials/synthetic-images/synthetic-images.ipynb index 6bdbf190..d4c9b362 100755 --- a/tutorials/synthetic-images/synthetic-images.ipynb +++ b/tutorials/synthetic-images/synthetic-images.ipynb @@ -555,11 +555,6 @@ } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython" diff --git a/tutorials/units-and-integration/units-and-integration.ipynb b/tutorials/units-and-integration/units-and-integration.ipynb index 18606d5e..2b39a27b 100755 --- a/tutorials/units-and-integration/units-and-integration.ipynb +++ b/tutorials/units-and-integration/units-and-integration.ipynb @@ -346,11 +346,6 @@ } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython" diff --git a/tutorials/vo/conesearch.ipynb b/tutorials/vo/conesearch.ipynb index 3e3ddf62..90719d5e 100755 --- a/tutorials/vo/conesearch.ipynb +++ b/tutorials/vo/conesearch.ipynb @@ -517,11 +517,6 @@ "name": "", "published": false }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -531,8 +526,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/tutorials/wcs-celestial-coords1/celestial_coords1.ipynb b/tutorials/wcs-celestial-coords1/celestial_coords1.ipynb index 7c1f80a3..60858366 100644 --- a/tutorials/wcs-celestial-coords1/celestial_coords1.ipynb +++ b/tutorials/wcs-celestial-coords1/celestial_coords1.ipynb @@ -591,11 +591,6 @@ } ], "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -605,21 +600,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.3" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false + "pygments_lexer": "ipython3" } }, "nbformat": 4, From 99664c85d9cedfdd2e20fe3fa10fe438207867ba Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Tue, 18 Jan 2022 09:53:17 -0500 Subject: [PATCH 3/6] dont run on fits or csv files --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 40defc0f..80cc9fc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,8 @@ repos: hooks: - id: trailing-whitespace - id: end-of-file-fixer + exclude_types: [csv] + exclude: '.*\.fits$' - id: check-yaml - id: check-added-large-files - repo: https://github.com/kynan/nbstripout From 70909dfe5592090cf7acd0375c03b9b54dc0ca4c Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Tue, 18 Jan 2022 09:58:42 -0500 Subject: [PATCH 4/6] exclude fits from trailing whitespace --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 80cc9fc2..2e020ce5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ repos: rev: v3.2.0 hooks: - id: trailing-whitespace + exclude: '.*\.fits$' - id: end-of-file-fixer exclude_types: [csv] exclude: '.*\.fits$' From 42d8a1564426b8458012adc0437996e9c7e83499 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 18 Jan 2022 15:03:33 +0000 Subject: [PATCH 5/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/dependabot.yml | 2 +- Makefile | 2 +- templates/index.tpl | 2 +- tutorials/redshift-plot/requirements.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 120c6893..5ace4600 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,4 +3,4 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" \ No newline at end of file + interval: "weekly" diff --git a/Makefile b/Makefile index 6ab7cb2e..cd420132 100644 --- a/Makefile +++ b/Makefile @@ -27,4 +27,4 @@ convertall: clean: rm -rf _build -.PHONY: all clean execute convert executeall convertall build buildall \ No newline at end of file +.PHONY: all clean execute convert executeall convertall build buildall diff --git a/templates/index.tpl b/templates/index.tpl index 11291a72..e4c780fb 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -11,4 +11,4 @@ {% endfor %} - \ No newline at end of file + diff --git a/tutorials/redshift-plot/requirements.txt b/tutorials/redshift-plot/requirements.txt index 2ac325e0..b2f8f140 100644 --- a/tutorials/redshift-plot/requirements.txt +++ b/tutorials/redshift-plot/requirements.txt @@ -1,4 +1,4 @@ astropy IPython matplotlib -numpy \ No newline at end of file +numpy From 0df12107acca30c1cd72851bf6b932a2a5623cec Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Tue, 18 Jan 2022 11:56:02 -0500 Subject: [PATCH 6/6] add new requirements-dev file and Make init command --- .github/workflows/build.yml | 3 +-- .github/workflows/prs.yml | 4 +--- Makefile | 6 +++++- requirements-dev.txt | 4 ++++ 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 requirements-dev.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 580773bb..068300c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,8 +25,7 @@ jobs: run: | sudo apt-get install pandoc python -m pip install -U pip - python -m pip install -r requirements.txt - python -m pip install git+https://github.com/astropy/nbcollection + python -m pip install -r requirements-dev.txt - name: Execute the notebooks run: | diff --git a/.github/workflows/prs.yml b/.github/workflows/prs.yml index ae5bd65c..18356226 100644 --- a/.github/workflows/prs.yml +++ b/.github/workflows/prs.yml @@ -29,9 +29,7 @@ jobs: run: | sudo apt-get install pandoc python -m pip install -U pip - python -m pip install -r requirements.txt - python -m pip install gitpython - python -m pip install git+https://github.com/astropy/nbcollection + python -m pip install -r requirements-dev.txt # Run all tutorials if the label is present - name: Run all tutorials diff --git a/Makefile b/Makefile index cd420132..0d7d5a2a 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ MODIFIED := $(shell python .github/get_modified_tutorials.py --main-branch $(TUT FLAGS = --flatten --build-path=. -v CONVERTFLAGS = --make-index --preprocessors=nbconvert.preprocessors.ExtractOutputPreprocessor --index-template=templates/index.tpl +init: + python -m pip install -U -r requirements-dev.txt + pre-commit install + build: envcheck execute convert buildall: envcheck executeall convertall @@ -27,4 +31,4 @@ convertall: clean: rm -rf _build -.PHONY: all clean execute convert executeall convertall build buildall +.PHONY: init all clean execute convert executeall convertall build buildall diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..cc97ed37 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,4 @@ +-r requirements.txt +gitpython +git+https://github.com/astropy/nbcollection +pre-commit