diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b4b3fa44f..a0481954d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,8 +4,8 @@ updates: # directory: "/" # schedule: # interval: daily - - package-ecosystem: 'github-actions' - directory: '/' + - package-ecosystem: "github-actions" + directory: "/" schedule: # Check for updates once a week - interval: 'weekly' + interval: "weekly" diff --git a/.github/workflows/nightly-build.yaml b/.github/workflows/nightly-build.yaml index a294afb17..0ce6b9241 100644 --- a/.github/workflows/nightly-build.yaml +++ b/.github/workflows/nightly-build.yaml @@ -3,7 +3,7 @@ name: nightly-build on: workflow_dispatch: schedule: - - cron: '0 0 * * *' # Daily “At 00:00” + - cron: "0 0 * * *" # Daily “At 00:00” jobs: build: diff --git a/.github/workflows/publish-book.yaml b/.github/workflows/publish-book.yaml index 2e8fc19d6..71a5ee208 100644 --- a/.github/workflows/publish-book.yaml +++ b/.github/workflows/publish-book.yaml @@ -16,5 +16,3 @@ jobs: deploy: needs: build uses: ProjectPythia/cookbook-actions/.github/workflows/deploy-book.yaml@main - with: - cname: foundations.projectpythia.org diff --git a/.github/workflows/trigger-preview.yaml b/.github/workflows/trigger-preview.yaml index 76da9637e..049b5d0bd 100644 --- a/.github/workflows/trigger-preview.yaml +++ b/.github/workflows/trigger-preview.yaml @@ -17,8 +17,7 @@ jobs: with: artifact_name: book-zip-${{ needs.find-pull-request.outputs.number }} destination_dir: _preview/${{ needs.find-pull-request.outputs.number }} # deploy to subdirectory labeled with PR number - is_preview: 'true' - cname: foundations.projectpythia.org + is_preview: "true" preview-comment: needs: find-pull-request diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 57608d0f4..6df5976e8 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.5.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -10,7 +10,7 @@ repos: - id: double-quote-string-fixer - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.10.0 hooks: - id: black @@ -20,7 +20,7 @@ repos: - id: blackdoc - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.1.1 hooks: - id: flake8 @@ -34,12 +34,12 @@ repos: - id: isort - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + rev: v4.0.0-alpha.8 hooks: - id: prettier - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.1 + rev: 1.9.1 hooks: - id: nbqa-black additional_dependencies: [black] diff --git a/CITATION.cff b/CITATION.cff index b1429e19d..878cd6d0e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,5 +1,5 @@ cff-version: 1.2.0 -message: 'If you use this resource, please cite it as below.' +message: "If you use this resource, please cite it as below." authors: - family-names: Rose given-names: Brian E. J. @@ -69,6 +69,6 @@ authors: orcid: https://orcid.org/0000-0002-2666-8493 website: https://github.com/anissa111 affiliation: UCAR/NCAR -title: 'Pythia Foundations' +title: "Pythia Foundations" version: v2023.05.01 doi: 10.5281/zenodo.7884571 diff --git a/_config.yml b/_config.yml index fabae92c4..a5c38a794 100644 --- a/_config.yml +++ b/_config.yml @@ -5,7 +5,7 @@ title: Pythia Foundations author: the Project Pythia Community logo: images/logos/pythia_logo-white-rtext.svg email: projectpythia@ucar.edu -copyright: '2024' +copyright: "2024" exclude_patterns: - README.md @@ -91,15 +91,15 @@ sphinx: config: nb_execution_raise_on_error: true # raise exception in build if there are notebook errors (this flag is ignored if building on binder) linkcheck_request_headers: - 'https://docs.github.com/': + "https://docs.github.com/": User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0 html_favicon: 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: analytics: - google_analytics_id: 'G-G57FLM9M46' + google_analytics_id: "G-G57FLM9M46" home_page_in_toc: true repository_url: https://github.com/ProjectPythia/pythia-foundations # Online location of your book repository_branch: main # Which branch of the repository should be used when creating links (optional) diff --git a/core/data-formats/netcdf-cf.ipynb b/core/data-formats/netcdf-cf.ipynb index 2abb46f88..d69d572a2 100644 --- a/core/data-formats/netcdf-cf.ipynb +++ b/core/data-formats/netcdf-cf.ipynb @@ -983,7 +983,6 @@ "\n", "- [CF Conventions doc (1.7)](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/cf-conventions.html)\n", "- [Jonathan Gregory's old CF presentation](http://cfconventions.org/Data/cf-documents/overview/viewgraphs.pdf)\n", - "- [NASA ESDS \"Dataset Interoperability Recommendations for Earth Science\"](https://earthdata.nasa.gov/user-resources/standards-and-references/dataset-interoperability-recommendations-for-earth-science)\n", "- [CF Data Model (cfdm) python package tutorial](https://ncas-cms.github.io/cfdm/tutorial.html)\n", "- [Tim Whiteaker's cfgeom python package (GitHub repo)](https://github.com/twhiteaker/CFGeom) and [(tutorial)]( https://twhiteaker.github.io/CFGeom/tutorial.html)\n", "- [netCDF4 Documentation](https://unidata.github.io/netcdf4-python/)" @@ -1013,7 +1012,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.11.9" } }, "nbformat": 4, diff --git a/core/datetime/datetime.ipynb b/core/datetime/datetime.ipynb index 4ce443e78..400f4d153 100644 --- a/core/datetime/datetime.ipynb +++ b/core/datetime/datetime.ipynb @@ -351,7 +351,7 @@ "\n", "In these examples, we will look at current data pertaining to coastal tides during a [tropical cyclone storm surge](http://www.nhc.noaa.gov/surge/).\n", "\n", - "The [lunar day](http://oceanservice.noaa.gov/education/kits/tides/media/supp_tide05.html) is 24 hours and 50 minutes; there are two low tides and two high tides in that time duration. If we know the time of the current high tide, we can easily calculate the occurrence of the next low and high tides by using the [timedelta class](https://docs.python.org/3/library/datetime.html#timedelta-objects). (In reality, the *exact time* of tides is influenced by local coastal effects, in addition to the laws of celestial mechanics, but we will ignore that fact for this exercise.)\n", + "The [lunar day](https://tidesandcurrents.noaa.gov/glossary.html#lunarday) is 24 hours and 50 minutes; there are two low tides and two high tides in that time duration. If we know the time of the current high tide, we can easily calculate the occurrence of the next low and high tides by using the [timedelta class](https://docs.python.org/3/library/datetime.html#timedelta-objects). (In reality, the *exact time* of tides is influenced by local coastal effects, in addition to the laws of celestial mechanics, but we will ignore that fact for this exercise.)\n", "\n", "The `timedelta` class is initialized by supplying time duration, usually supplied with [keyword arguments](https://docs.python.org/3/glossary.html#term-argument), to clearly express the length of time. The `timedelta` class allows you to perform arithmetic with dates and times using standard operators (i.e., `+`, `-`, `*`, `/`). You can use these operators with a `timedelta` object, and either another `timedelta` object, a datetime object, or a numeric literal, to obtain objects representing new dates and times.\n", "\n", @@ -554,7 +554,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.11.9" } }, "nbformat": 4, diff --git a/core/xarray.md b/core/xarray.md index 77be7c8dd..27e827cc0 100644 --- a/core/xarray.md +++ b/core/xarray.md @@ -1,4 +1,4 @@ -![xarray Logo](https://docs.xarray.dev/en/stable/_static/Xarray_Logo_RGB_Final.svg 'xarray Logo') +![xarray Logo](https://docs.xarray.dev/en/stable/_static/Xarray_Logo_RGB_Final.svg "xarray Logo") # Xarray diff --git a/environment.yml b/environment.yml index d84da15af..b0cf4723e 100644 --- a/environment.yml +++ b/environment.yml @@ -13,11 +13,11 @@ dependencies: - dask - pyproj - pythia-datasets - - python + - python<3.12 # Waiting on https://github.com/jupyter/jupyter_events/issues/99 - scipy - ffmpeg - xarray - python-graphviz - graphviz - - setuptools>=69.0.3 + - setuptools - sphinx-pythia-theme diff --git a/foundations/conda.md b/foundations/conda.md index 5d4174f68..6fc98f944 100644 --- a/foundations/conda.md +++ b/foundations/conda.md @@ -31,16 +31,17 @@ Package management is useful because you may want to update a package for one of ## Installing Conda -We recommend you install Miniconda. You can do that by following the [instructions for your machine](https://docs.conda.io/en/latest/miniconda.html). +We recommend you install Miniforge. You can do that by following the [instructions for your machine](https://github.com/conda-forge/miniforge). -Miniconda only comes with the `conda` package management system; it is a pared-down version of the full Anaconda Python distribution. +Miniforge uses the `conda` package management system and is based on Miniconda, which is a pared-down version of the full Anaconda Python distribution. [Installing Anaconda](https://docs.anaconda.com/anaconda/install/) takes longer and uses up more disk space, but provides you with more functionality, including Spyder (a Python-specific integrated development environment or IDE) and Jupyter, in addition to other immediately installed packages. Also, the interface of Anaconda is great if you are uncomfortable with the terminal. -We recommend Miniconda for two reasons: +We recommend Miniforge for these reasons: 1. It's quicker and takes up less disk space. 2. It encourages you to install only the packages you need in reproducible isolated environments for specific projects. This is generally a more robust way to work with open source tools. +3. It uses `conda-forge` as the default channel for packages, which is our recommended way to get up-to-date, interoperable packages.. Once you have `conda` via the Miniconda installer, the next step is to create an environment and install packages. diff --git a/foundations/jupyter.md b/foundations/jupyter.md index 9fd45a415..8211d6e62 100644 --- a/foundations/jupyter.md +++ b/foundations/jupyter.md @@ -24,7 +24,7 @@ You'd like to learn to run Python in a Jupyter session. Here we will cover: To run a Jupyter session, you will need to install some necessary packages into your Conda environment. -Install `miniconda` by following the [instructions for your machine](https://docs.conda.io/en/latest/miniconda.html). +Install `miniforge` by following the [instructions for your machine](https://github.com/conda-forge/miniforge). [Learn more about Conda here](conda.md) @@ -41,11 +41,7 @@ $ conda activate pythia_foundations_env $ jupyter lab ``` -Or you can install the full [Anaconda](https://www.anaconda.com/products/distribution), and select **LAUNCH** under the Jupyter panel in the GUI. - -![Anaconda Navigator](../images/Anaconda.png) - -In both methods, a new window should open automatically in your default browser. You can change the browser when launching from the terminal with (for example): +A new window should open automatically in your default browser. You can change the browser when launching from the terminal with (for example): ``` jupyter lab —browser=chrome @@ -81,6 +77,15 @@ jupyter lab —browser=chrome **Congratulations!** You have just set up your first Python environment and run your first Python code in a Jupyter notebook. +
Info
+ There are a few code-syntax differences between running Python in a Jupyter notebook and a script: +print([THING YOU WANT TO PRINT])
, whereas in Jupyter, you can simply have the last line of a code cell be [THING YOU WANT TO PRINT]
.plt.show()
to display your plot, but plots are shown automatically in Jupyter.