Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ jobs:
# docs/_build/html/_downloads/<hash>/<example-name>.ipynb.
# These links seemingly cannot be accessed when writing the scripts themselves, so the workaround is to
# - Move the generated notebooks to a more convenient location.
# - Within the notebooks themselves, hard-code the link to the GH-pages deployment for that notebook.
# - Within the notebooks themselves, hard-code the link to that notebook on the colab-notebooks branch.
# The loop below performs the necessary copying.
# The the source files are assumed to have the hard-coded links already set correctly.
# The source files are assumed to have the hard-coded links already set correctly.
- name: Build documentation
run: |
cd docs
Expand All @@ -70,6 +70,43 @@ jobs:
path: docs/_build/html
retention-days: 30

- name: Upload Colab notebooks as artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: colab-notebooks
path: docs/_build/html/_colab_notebooks/*.ipynb

# Colab opens notebooks only from a GitHub repository, not from the deployed site, so the
# generated notebooks are force-pushed as a single commit to the root of the orphan
# colab-notebooks branch, which the Open in Colab badges in the tutorials link to.
publish-colab-notebooks:
name: Publish Colab notebooks
permissions:
contents: write # required to push the colab-notebooks branch
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Download Colab notebooks artifact
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: colab-notebooks
path: colab-notebooks

- name: Push Colab notebooks to colab-notebooks branch
working-directory: colab-notebooks
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
git init --initial-branch colab-notebooks
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Colab notebooks from ${GITHUB_SHA}"
git push --force \
"https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" \
colab-notebooks

deploy:
name: Deploy documentation to GitHub pages
environment:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![PyPI package](https://badge.fury.io/py/s2fft.svg)](https://badge.fury.io/py/s2fft)
[![arXiv](http://img.shields.io/badge/arXiv-2311.14670-orange.svg?style=flat)](https://arxiv.org/abs/2311.14670)
![All Contributors](https://img.shields.io/github/all-contributors/astro-informatics/s2fft?color=ee8449&style=flat-square)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/astro-informatics/s2fft/blob/main/notebooks/spherical_harmonic_transform.ipynb)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/spherical_harmonic_transform.ipynb)
[![Linter](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/JAX_HEALPix_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:align: center
:alt: Open in Google Colab
:target: https://colab.research.google.com/github/astro-informatics/s2fft/tree/gh-pages/_colab_notebooks/JAX_HEALPix_frontend.ipynb
:target: https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/JAX_HEALPix_frontend.ipynb

If you are working on this notebook in Google Colab, you will need to have Google Colab install ``s2fft`` and ``healpy``.
You can do this by adding a cell to the top of the notebook with the following content:
Expand Down
2 changes: 1 addition & 1 deletion examples/JAX_SSHT_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:align: center
:alt: Open in Google Colab
:target: https://colab.research.google.com/github/astro-informatics/s2fft/tree/gh-pages/_colab_notebooks/JAX_SSHT_frontend.ipynb
:target: https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/JAX_SSHT_frontend.ipynb

If you are working on this notebook in Google Colab, you will need to have Google Coab install ``s2fft`` and ``pyssht``.
You can do this by adding a cell to the top of the notebook with the following content:
Expand Down
2 changes: 1 addition & 1 deletion examples/spherical_harmonic_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:align: center
:alt: Open in Google Colab
:target: https://colab.research.google.com/github/astro-informatics/s2fft/tree/gh-pages/_colab_notebooks/spherical_harmonic_transform.ipynb
:target: https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/spherical_harmonic_transform.ipynb

If you are working on this notebook in Google Colab; you will need to have Google Colab install ``cartopy``, ``s2fft`` and ``pyssht``, as well as fetch the data we'll be using.
You can do this by adding a cell to the top of the notebook with the following content:
Expand Down
2 changes: 1 addition & 1 deletion examples/spherical_harmonics_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:align: center
:alt: Open in Google Colab
:target: https://colab.research.google.com/github/astro-informatics/s2fft/tree/gh-pages/_colab_notebooks/spherical_harmonics_basis.ipynb
:target: https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/spherical_harmonics_basis.ipynb

If you are working on this notebook in Google Colab, you will need to have Google Colab install ``s2fft``.
You can do this by adding a cell to the top of the notebook with the following content:
Expand Down
2 changes: 1 addition & 1 deletion examples/spherical_poisson_equation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:align: center
:alt: Open in Google Colab
:target: https://colab.research.google.com/github/astro-informatics/s2fft/tree/gh-pages/_colab_notebooks/spherical_poisson_equation.ipynb
:target: https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/spherical_poisson_equation.ipynb

If you are working on this notebook in Google Colab, you will need to have Google Colab install
``cartopy`` and ``s2fft``. You can do this by adding a cell to the top of the notebook with the
Expand Down
2 changes: 1 addition & 1 deletion examples/spherical_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:align: center
:alt: Open in Google Colab
:target: https://colab.research.google.com/github/astro-informatics/s2fft/tree/gh-pages/_colab_notebooks/spherical_rotation.ipynb
:target: https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/spherical_rotation.ipynb

If you are working on this notebook in Google Colab, you will need to have Google Colab install ``s2fft``.
You can do this by adding a cell to the top of the notebook with the following content:
Expand Down
2 changes: 1 addition & 1 deletion examples/spherical_signal_derivatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:align: center
:alt: Open in Google Colab
:target: https://colab.research.google.com/github/astro-informatics/s2fft/tree/gh-pages/_colab_notebooks/spherical_signal_derivatives.ipynb
:target: https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/spherical_signal_derivatives.ipynb

If you are working on this notebook in Google Colab, you will need to have Google Colab install ``s2fft``.
You can do this by adding a cell to the top of the notebook with the following content:
Expand Down
2 changes: 1 addition & 1 deletion examples/torch_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:align: center
:alt: Open in Google Colab
:target: https://colab.research.google.com/github/astro-informatics/s2fft/tree/gh-pages/_colab_notebooks/spherical_rotation.ipynb
:target: https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/torch_frontend.ipynb

If you are working on this notebook in Google Colab, you will need to have Google Colab install ``s2fft``.
You can do this by adding a cell to the top of the notebook with the following content:
Expand Down
2 changes: 1 addition & 1 deletion examples/wigner_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:align: center
:alt: Open in Google Colab
:target: https://colab.research.google.com/github/astro-informatics/s2fft/tree/gh-pages/_colab_notebooks/spherical_rotation.ipynb
:target: https://colab.research.google.com/github/astro-informatics/s2fft/blob/colab-notebooks/wigner_transform.ipynb

If you are working on this notebook in Google Colab, you will need to have Google Colab install ``s2fft``.
You can do this by adding a cell to the top of the notebook with the following content:
Expand Down