Skip to content

Commit 89d4fdd

Browse files
authored
Merge pull request #92 from bsipocz/MAINT_jupyter_cache
CI: adding caching for notebooks
2 parents bd4b1d7 + 485aaf0 commit 89d4fdd

6 files changed

Lines changed: 30 additions & 16 deletions

File tree

.circleci/config.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,38 @@ jobs:
77
- image: cimg/python:3.12
88

99
steps:
10+
- attach_workspace:
11+
at: ~/
12+
1013
- checkout
1114

1215
- run:
1316
name: Install CI dependencies
1417
command: python -m pip install --upgrade tox
1518

19+
- restore_cache:
20+
keys:
21+
- jupyter_ch
22+
1623
- run:
1724
name: Build HTML rendering of notebooks
1825
no_output_timeout: 30m
1926
command: |
2027
python -m tox -e py312-buildhtml
2128
29+
- save_cache:
30+
key: jupyter_ch
31+
paths:
32+
- _build/.jupyter_cache
33+
2234
- store_artifacts:
2335
path: _build/html
2436

37+
- persist_to_workspace:
38+
root: _build
39+
paths:
40+
- html
41+
2542
workflows:
2643
version: 2
2744
default:

conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# -- Project information -----------------------------------------------------
1616

1717
project = 'Caltech/IPAC--IRSA Demo Notebooks'
18-
copyright = '2022-2024, IRSA developers'
18+
copyright = '2022-2025, IRSA developers'
1919
author = 'IRSA developers'
2020

2121

@@ -44,6 +44,7 @@
4444
# MyST-NB configuration
4545
nb_execution_timeout = 1200
4646
nb_merge_streams = True
47+
nb_execution_mode = "cache"
4748

4849
nb_execution_excludepatterns = []
4950

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ commands =
5656
!buildhtml: bash -c 'if [[ $GITHUB_EVENT_NAME == pull_request && -z "$(grep force_run:all_tests ${GITHUB_EVENT_PATH})" ]]; then git fetch origin main --depth=1; git diff origin/main --name-only tutorials | grep .md; else find tutorials -name "*.md"; fi | grep -vf ignore_testing | xargs jupytext --to notebook '
5757

5858
!buildhtml: pytest --nbval-lax -vv --suppress-no-test-exit-code --durations=10 tutorials
59-
buildhtml: sphinx-build -b html . _build/html -D nb_execution_mode=auto -nWT --keep-going
59+
buildhtml: sphinx-build -b html . _build/html -nWT --keep-going
6060
# SED magic to remove the toctree captions from the rendered index page while keeping them in the sidebar TOC
6161
buildhtml: sed -E -i.bak '/caption-text/{N; s/.+caption-text.+\n<ul>/<ul>/; P;D;}' _build/html/index.html
6262
buildhtml: bash -c 'rm _build/html/index.html.bak'

tutorials/euclid_access/2_Euclid_intro_MER_catalog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ plt.title('10k Stars in MER catalog -- IRSA')
155155

156156
## About this Notebook
157157

158-
**Author**: Tiffany Meshkat (IPAC Scientist)
158+
**Author**: Tiffany Meshkat, Anahita Alavi, Anastasia Laity, Andreas Faisst, Brigitta Sipőcz, Dan Masters, Harry Teplitz, Jaladh Singhal, Shoubaneh Hemmati, Vandana Desai
159159

160-
**Updated**: 2025-03-19
160+
**Updated**: 2025-03-31
161161

162162
**Contact:** [the IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or reporting problems.

tutorials/euclid_access/4_Euclid_intro_PHZ_catalog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ fc.show_table(uploaded_table)
437437

438438
## About this Notebook
439439

440-
**Author**: Tiffany Meshkat, Anahita Alavi, Anastasia Laity, Andreas Faisst, Brigitta Sipőcz, Dan Masters, Harry Teplitz, Jaladh Singhal, Shoubaneh Hemmati.
440+
**Author**: Tiffany Meshkat, Anahita Alavi, Anastasia Laity, Andreas Faisst, Brigitta Sipőcz, Dan Masters, Harry Teplitz, Jaladh Singhal, Shoubaneh Hemmati, Vandana Desai
441441

442-
**Updated**: 2025-03-26
442+
**Updated**: 2025-03-31
443443

444444
**Contact:** [the IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or reporting problems.

tutorials/openuniversesims/openuniverse2024_roman_simulated_timedomainsurvey.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.16.2
7+
jupytext_version: 1.16.7
88
kernelspec:
9-
display_name: science_demo
9+
display_name: Python 3 (ipykernel)
1010
language: python
1111
name: python3
1212
---
@@ -52,11 +52,11 @@ from scipy.ndimage import rotate
5252
5353
# Needed to access data in the cloud
5454
import s3fs
55-
s3 = s3fs.S3FileSystem(anon=True) # create an S3 client
55+
s3 = s3fs.S3FileSystem(anon=True) # create an S3 client
5656
5757
# Filter out the FITSFixedWarning, which is consequenceless and gets thrown every time you deal with a WCS
5858
# in a Roman openuniverse simulated image using astropy.
59-
warnings.simplefilter('ignore',category=FITSFixedWarning)
59+
warnings.simplefilter('ignore', category=FITSFixedWarning)
6060
```
6161

6262
## Define a module to get the date (mjd) of a particular pointing.
@@ -86,7 +86,7 @@ def get_mjd(pointing,
8686
## Define a module to create an animated gif from a collection of cutouts.
8787

8888
```{code-cell} ipython3
89-
def animate_stamps(stamps,savepath,no_whitespace=True,
89+
def animate_stamps(stamps, savepath, no_whitespace=True,
9090
labels=[],labelxy=(0.05,0.95),
9191
**kwargs):
9292
"""
@@ -290,13 +290,9 @@ for i, row in enumerate(instances.itertuples()):
290290
```{code-cell} ipython3
291291
savepath = f'SN{oid}.gif'
292292
savepath
293-
animate_stamps(stamps,savepath,labels=mjd)
293+
animate_stamps(stamps, savepath, labels=mjd)
294294
```
295295

296-
![animated gif](SN20000808.gif)
297-
298-
+++
299-
300296
***
301297

302298
## About this notebook

0 commit comments

Comments
 (0)