diff --git a/.github/workflows/trigger-replace-links.yaml b/.github/workflows/trigger-replace-links.yaml new file mode 100644 index 00000000..6fff5e23 --- /dev/null +++ b/.github/workflows/trigger-replace-links.yaml @@ -0,0 +1,31 @@ +name: trigger-replace-links + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Find and Replace Repository Name + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "ProjectPythia/cookbook-template" + replace: "${{ github.repository_owner }}/${{ github.event.repository.name }}" + regex: false + exclude: ".github/workflows/trigger-replace-links.yaml" + + - name: Find and Replace Repository ID + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "475509405" + replace: "${{ github.repository_id}}" + regex: false + exclude: ".github/workflows/trigger-replace-links.yaml" + + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/.gitignore b/.gitignore index b68c8596..5a985492 100644 --- a/.gitignore +++ b/.gitignore @@ -131,3 +131,6 @@ dmypy.json # Pyre type checker .pyre/ + +# Ephemeral .nfs files +.nfs* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7aaff117..3993e709 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -10,17 +10,17 @@ repos: - id: double-quote-string-fixer - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.12.1 hooks: - id: black - repo: https://github.com/keewis/blackdoc - rev: v0.3.8 + rev: v0.3.9 hooks: - id: blackdoc - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 7.0.0 hooks: - id: flake8 @@ -28,19 +28,20 @@ repos: rev: v2.2.0 hooks: - id: seed-isort-config + - repo: https://github.com/PyCQA/isort - rev: 5.11.4 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + rev: v3.1.0 hooks: - id: prettier additional_dependencies: [prettier@v2.7.1] - repo: https://github.com/nbQA-dev/nbQA - rev: 1.6.1 + rev: 1.7.1 hooks: - id: nbqa-black additional_dependencies: [black] diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..fe89c55f --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,48 @@ +cff-version: 1.2.0 +message: "If you use this cookbook, please cite it as below." +authors: + # add additional entries for each author -- see https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md + - family-names: Rose + given-names: Brian E. J. + orcid: https://orcid.org/0000-0002-9961-3821 # optional + website: https://github.com/brian-rose # optional + affiliation: University at Albany (State University of New York) # optional + - family-names: Kent + given-names: Julia + orcid: https://orcid.org/0000-0002-5611-8986 + website: https://github.com/jukent + affiliation: UCAR/NCAR + - family-names: Tyle + given-names: Kevin + orcid: https://orcid.org/0000-0001-5249-9665 + website: https://github.com/ktyle + affiliation: University at Albany (State University of New York) + - family-names: Clyne + given-names: John + orcid: https://orcid.org/0000-0003-2788-9017 + website: https://github.com/clyne + affiliation: UCAR/NCAR + - family-names: Camron + given-names: Drew + orcid: https://orcid.org/0000-0001-7246-6502 + website: https://github.com/dcamron + affiliation: UCAR/Unidata + - family-names: Grover + given-names: Maxwell + orcid: https://orcid.org/0000-0002-0370-8974 + website: https://github.com/mgrover1 + affiliation: Argonne National Laboratory + - family-names: Ford + given-names: Robert R. + orcid: https://orcid.org/0000-0001-5483-4965 + website: https://github.com/r-ford + affiliation: University at Albany (State University of New York) + - family-names: Paul + given-names: Kevin + orcid: https://orcid.org/0000-0001-8155-8038 + website: https://github.com/kmpaul + affiliation: NVIDIA + - name: "Cookbook Template contributors" # use the 'name' field to acknowledge organizations + website: "https://github.com/ProjectPythia/cookbook-template/graphs/contributors" +title: "Cookbook Template" +abstract: "A sample cookbook description." diff --git a/README.md b/README.md index 40a3cee1..25029ec6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ # (Replace_with_your_title) Cookbook [![nightly-build](https://github.com/ProjectPythia/cookbook-template/actions/workflows/nightly-build.yaml/badge.svg)](https://github.com/ProjectPythia/cookbook-template/actions/workflows/nightly-build.yaml) -[![Binder](http://binder.mypythia.org/badge_logo.svg)](http://binder.mypythia.org/v2/gh/ProjectPythia/cookbook-template/main?labpath=notebooks) +[![Binder](https://binder.projectpythia.org/badge_logo.svg)](https://binder.projectpythia.org/v2/gh/ProjectPythia/cookbook-template/main?labpath=notebooks) +[![DOI](https://zenodo.org/badge/475509405.svg)](https://zenodo.org/badge/latestdoi/475509405) This Project Pythia Cookbook covers ... (replace `...` with the main subject of your cookbook ... e.g., _working with radar data in Python_) @@ -35,12 +36,12 @@ This Project Pythia Cookbook covers ... (replace `...` with the main subject of ## Running the Notebooks -You can either run the notebook using [Binder](https://mybinder.org/) or on your local machine. +You can either run the notebook using [Binder](https://binder.projectpythia.org/) or on your local machine. ### Running on Binder The simplest way to interact with a Jupyter Notebook is through -[Binder](https://mybinder.org/), which enables the execution of a +[Binder](https://binder.projectpythia.org/), which enables the execution of a [Jupyter Book](https://jupyterbook.org) in the cloud. The details of how this works are not important for now. All you need to know is how to launch a Pythia Cookbooks chapter via Binder. Simply navigate your mouse to diff --git a/_config.yml b/_config.yml index 9317ca5e..cfa687c4 100644 --- a/_config.yml +++ b/_config.yml @@ -4,19 +4,10 @@ title: Project Pythia Cookbook Template author: the Project Pythia Community logo: notebooks/images/logos/pythia_logo-white-rtext.svg -email: projectpythia@ucar.edu -copyright: "2022" - -description: A sample cookbook description. -thumbnail: thumbnail.png -tags: - domains: - - sampledomain - packages: - - samplepackage +copyright: "2024" execute: - # To execute notebooks via a binder instead, replace 'cache' with 'binder' + # To execute notebooks via a Binder instead, replace 'cache' with 'binder' execute_notebooks: cache timeout: 600 allow_errors: False # cells with expected failures must set the `raises-exception` cell tag @@ -36,9 +27,10 @@ parse: sphinx: config: - linkcheck_ignore: ["https://doi.org/*",] + linkcheck_ignore: ["https://doi.org/*", "https://zenodo.org/badge/*"] # don't run link checker on DOI links since they are immutable + nb_execution_raise_on_error: true # raise exception in build if there are notebook errors (this flag is ignored if building on binder) html_favicon: notebooks/images/icons/favicon.ico - html_last_updated_fmt: '%-d %B %Y' + html_last_updated_fmt: "%-d %B %Y" html_theme: sphinx_pythia_theme html_permalinks_icon: '' html_theme_options: @@ -48,7 +40,9 @@ sphinx: use_issues_button: true use_repository_button: true use_edit_page_button: true - google_analytics_id: G-T52X8HNYE8 + use_fullscreen_button: true + analytics: + google_analytics_id: G-T52X8HNYE8 github_url: https://github.com/ProjectPythia twitter_url: https://twitter.com/project_pythia icon_links: @@ -57,13 +51,18 @@ sphinx: icon: fab fa-youtube-square type: fontawesome launch_buttons: - binderhub_url: http://binder.mypythia.org + binderhub_url: https://binder.projectpythia.org notebook_interface: jupyterlab extra_navbar: "" extra_footer: | Theme by Project Pythia. All code in Pythia Cookbooks is licensed under Apache 2.0. All other non-code content is licensed under Creative Commons BY 4.0 (CC BY 4.0). - logo_link: https://projectpythia.org + logo: + link: https://projectpythia.org + navbar_start: + - navbar-logo + navbar_end: + - navbar-icon-links navbar_links: - name: Home url: https://projectpythia.org @@ -76,6 +75,9 @@ sphinx: - name: Community url: https://projectpythia.org/index.html#join-us footer_logos: - NCAR: notebooks/images/logos/NCAR-contemp-logo-blue.svg + NCAR: notebooks/images/logos/NSF-NCAR_Lockup-UCAR-Dark_102523.svg Unidata: notebooks/images/logos/Unidata_logo_horizontal_1200x300.svg UAlbany: notebooks/images/logos/UAlbany-A2-logo-purple-gold.svg + footer_start: + - footer-logos + - footer-info diff --git a/_gallery_info.yml b/_gallery_info.yml new file mode 100644 index 00000000..8764ee4f --- /dev/null +++ b/_gallery_info.yml @@ -0,0 +1,6 @@ +thumbnail: thumbnail.png +tags: + domains: + - sampledomain + packages: + - samplepackage diff --git a/_static/custom.css b/_static/custom.css new file mode 100644 index 00000000..59f43131 --- /dev/null +++ b/_static/custom.css @@ -0,0 +1,6 @@ +.bd-main .bd-content .bd-article-container { + max-width: 100%; /* default is 60em */ +} +.bd-page-width { + max-width: 100%; /* default is 88rem */ +} diff --git a/_toc.yml b/_toc.yml index 2fed654b..995f86b6 100644 --- a/_toc.yml +++ b/_toc.yml @@ -1,6 +1,9 @@ format: jb-book root: README parts: + - caption: Preamble + chapters: + - file: notebooks/how-to-cite - caption: Introduction chapters: - file: notebooks/notebook-template diff --git a/environment.yml b/environment.yml index 3bad2149..c6316426 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,4 @@ channels: dependencies: - jupyter-book - jupyterlab - - jupyter_server<2 - - pip - - pip: - - sphinx-pythia-theme + - sphinx-pythia-theme diff --git a/notebooks/how-to-cite.md b/notebooks/how-to-cite.md new file mode 100644 index 00000000..01390dbc --- /dev/null +++ b/notebooks/how-to-cite.md @@ -0,0 +1,7 @@ +# How to Cite This Cookbook + +The material in this Project Pythia Cookbook is licensed for free and open consumption and reuse. All code is served under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0), while all non-code content is licensed under [Creative Commons BY 4.0 (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/). Effectively, this means you are free to share and adapt this material so long as you give appropriate credit to the Cookbook authors and the Project Pythia community. + +The source code for the book is [released on GitHub](https://github.com/ProjectPythia/cookbook-template) and archived on Zenodo. This DOI will always resolve to the latest release of the book source: + +[![DOI](https://zenodo.org/badge/475509405.svg)](https://zenodo.org/badge/latestdoi/475509405) diff --git a/notebooks/images/logos/NCAR-contemp-logo-blue.svg b/notebooks/images/logos/NCAR-contemp-logo-blue.svg deleted file mode 100644 index 3bcda635..00000000 --- a/notebooks/images/logos/NCAR-contemp-logo-blue.svg +++ /dev/null @@ -1 +0,0 @@ -NCAR-contemp-logo-blue.a diff --git a/notebooks/images/logos/NSF-NCAR_Lockup-UCAR-Dark_102523.svg b/notebooks/images/logos/NSF-NCAR_Lockup-UCAR-Dark_102523.svg new file mode 100644 index 00000000..538f8ec9 --- /dev/null +++ b/notebooks/images/logos/NSF-NCAR_Lockup-UCAR-Dark_102523.svg @@ -0,0 +1 @@ + diff --git a/notebooks/notebook-template.ipynb b/notebooks/notebook-template.ipynb index 4266bdab..dad9f266 100644 --- a/notebooks/notebook-template.ipynb +++ b/notebooks/notebook-template.ipynb @@ -295,7 +295,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.0" + "version": "3.10.8" }, "nbdime-conflicts": { "local_diff": [