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

[pull] main from ProjectPythia:main #54

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion .github/workflows/nightly-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/publish-book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ jobs:
deploy:
needs: build
uses: ProjectPythia/cookbook-actions/.github/workflows/deploy-book.yaml@main
with:
cname: foundations.projectpythia.org
3 changes: 1 addition & 2 deletions .github/workflows/trigger-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -20,7 +20,7 @@ repos:
- id: blackdoc

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8

Expand All @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Pythia Foundations
author: the <a href="https://projectpythia.org/">Project Pythia</a> Community
logo: images/logos/pythia_logo-white-rtext.svg
email: projectpythia@ucar.edu
copyright: '2024'
copyright: "2024"

exclude_patterns:
- README.md
Expand Down Expand Up @@ -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: '<i class="fas fa-link"></i>'
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)
Expand Down
3 changes: 1 addition & 2 deletions core/data-formats/netcdf-cf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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/)"
Expand Down Expand Up @@ -1013,7 +1012,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions core/datetime/datetime.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -554,7 +554,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion core/xarray.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions foundations/conda.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
20 changes: 13 additions & 7 deletions foundations/jupyter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -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.

<div class="admonition alert alert-info">
<p class="admonition-title" style="font-weight:bold">Info</p>
There are a few code-syntax differences between running Python in a Jupyter notebook and a script:
<ul>
<li>In a Python script, to print a variable to the terminal, you need to call <code>print([THING YOU WANT TO PRINT])</code>, whereas in Jupyter, you can simply have the last line of a code cell be <code>[THING YOU WANT TO PRINT]</code>.</li>
<li>Similarly with plots, in Python, you have to call <code>plt.show()</code> to display your plot, but plots are shown automatically in Jupyter.</li>
</ul>
</div>

## Saving your notebook and exiting

When you are done with your work, it is time to save and exit.
Expand Down Expand Up @@ -112,4 +117,5 @@ Jupyter notebooks are a free, open-source, interactive tool running inside a web

## Resources and References

- [Anaconda](https://www.anaconda.com/products/distribution)
- [conda-forge](https://conda-forge.org)
- [Miniforge Releases](https://conda-forge.org/miniforge/)
2 changes: 1 addition & 1 deletion foundations/terminal.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You'd like to learn to run Python in the terminal. Here we will cover:

## Installing Python in the Terminal

If you are running Python in the terminal, it is best to install Miniconda. You can do that by following the [instructions for your machine](https://docs.conda.io/en/latest/miniconda.html).
If you are running Python in the terminal, it is best to install Miniforge. You can do that by following the [instructions for your machine](https://github.com/conda-forge/miniforge).

[Learn more about Conda here](conda.md)

Expand Down
2 changes: 1 addition & 1 deletion preamble/how-to-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ can be done with two commands from the terminal, one to create the
environment and one to activate it:

```
conda env create --force -f https://raw.githubusercontent.com/ProjectPythia/pythia-foundations/main/environment.yml
conda env create --yes -f https://raw.githubusercontent.com/ProjectPythia/pythia-foundations/main/environment.yml
conda activate pythia-book-dev
```

Expand Down