Skip to content

Commit 42ebce1

Browse files
committed
chore: use inline figures to save memory
1 parent 296be0d commit 42ebce1

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

.binder/postBuild

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ bash scripts/generate_client.sh
1313

1414
# Pre-fetch the CMIP6 sample data so notebook 04 runs without a download wait.
1515
python -c "from ref_tutorials import fetch_sample_data; fetch_sample_data()"
16+
17+
# Pre-build the matplotlib font cache to save memory
18+
python -c "import matplotlib.pyplot as plt; plt.figure(); plt.text(0, 0, 'warm fonts'); plt.close('all')"

.binder/start

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
# Binder/repo2docker start hook.
3+
# Sourced before the user's notebook server is launched, so any environment variables exported here are inherited by every kernel started in the session.
4+
5+
# Use the non-interactive Agg backend by default to save memory
6+
export MPLBACKEND=Agg

0 commit comments

Comments
 (0)