Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3046346
Add intro to git course as submodule
jackdfranklin Oct 22, 2026
afae5eb
Switch to nix flake from docs
jackdfranklin Oct 22, 2026
44a3f16
Add intro to git content from ICCS course
jackdfranklin Oct 27, 2026
9df21b6
Move all figures into `images` directory for consistency
jackdfranklin Oct 27, 2026
16b1a94
Add submodules to GH actions
jackdfranklin Oct 27, 2026
25b29af
Add branches content
jackdfranklin Oct 27, 2026
e8159ce
Fix logo size
jackdfranklin Oct 27, 2026
24778e5
Update flake lock
jackdfranklin Oct 27, 2026
dee2126
Add extensions directory to git
jackdfranklin Oct 27, 2026
797d1cd
Add slides on atomic commits
jackdfranklin Oct 29, 2026
5efeb0c
Merge pull request #22 from Cambridge-ICCS/18-expand-on-version-contr…
jackdfranklin Nov 6, 2026
9742200
Add energy balance climate model plot
jackdfranklin Oct 29, 2026
d8ea2df
Add pytest slides
jackdfranklin Nov 4, 2026
471a20a
Add testing exercises
jackdfranklin Nov 4, 2026
fc69a4e
Improve layout of testing slides
jackdfranklin Nov 6, 2026
dbce4fe
Add testing exercises to slides
jackdfranklin Nov 6, 2026
e232abf
Merge pull request #24 from Cambridge-ICCS/19-add-basic-testing-intro
jackdfranklin Nov 6, 2026
51ecb07
Add docstring slides
jackdfranklin Nov 8, 2026
7f7357c
Remove title colour css
jackdfranklin Nov 8, 2026
3a73707
Use correct tag for python code block
jackdfranklin Nov 8, 2026
6af3c81
Revert "Remove title colour css"
jackdfranklin Nov 8, 2026
5a592ab
Reapply "Remove title colour css"
jackdfranklin Nov 8, 2026
9c98197
Revert "Use correct tag for python code block"
jackdfranklin Nov 8, 2026
86a1dfc
Add example flowchart to automation
jackdfranklin Nov 8, 2026
83dba4c
Add slide on workflow engines
jackdfranklin Nov 8, 2026
8966b57
Fix layout of 'unit function' example
jackdfranklin Nov 8, 2026
222b13b
Replace Hacktoberfest slide with Summer School
jackdfranklin Nov 8, 2026
8d781c8
Fix overflow in system deps list
jackdfranklin Nov 8, 2026
eeb42d8
Layout fixing of repro benefits
jackdfranklin Nov 8, 2026
aa077f8
Add pytest logo
jackdfranklin Nov 8, 2026
6319bfe
Shorten Nix/Guix section
jackdfranklin Nov 8, 2026
3b7f206
Put git commands in bash code blocks
jackdfranklin Nov 9, 2026
2bc6c12
Add $ to git worktree command
jackdfranklin Nov 9, 2026
fdb3507
Added ICCS affiliation
jackdfranklin Nov 9, 2026
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
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'

- uses: actions/setup-python@v6
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/Summer-school-Intro-Git"]
path = src/Summer-school-Intro-Git
url = git@github.com:Cambridge-ICCS/Summer-school-Intro-Git.git
2 changes: 0 additions & 2 deletions exercises/dependencies_exercises.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ https://docs.xarray.dev/en/stable/getting-started-guide/installing.html
- lapack library
- blas library
- sqlite
- curl
- glibc
- gcc/gfortran
- mpdecimal
- libffi
- ...
Expand Down
15 changes: 15 additions & 0 deletions exercises/problem/climate_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
solar_constant = 1370
sigma = 5.67e-8 # Stefan-Boltzmann constant

def absorbed_solar_radiation(albedo):
return solar_constant*(1-albedo)/4

def emitted_radiation(emissivity, temperature):
return emissivity * sigma * temperature**4

def energy_balanced_temperature(emissivity, albedo):
# dT/dt = 0 => in = out
return (solar_constant*(1-albedo)/(4*emissivity * sigma))**0.25

def emissivity_given_temp(albedo, temperature):
return solar_constant*(1-albedo)/(4*sigma*temperature**4)
25 changes: 25 additions & 0 deletions exercises/problem/plot4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import climate_model

import xarray
import matplotlib.pyplot as plt

global_ds = xarray.open_dataset("../data/HadCRUT.5.0.0.0_analysis_summary-series_global_annual.nc")

fig, axs = plt.subplots(1, 1, figsize=(10,6), layout='constrained')

# Absolute mean temperature between 1961 and 1990
# https://crudata.uea.ac.uk/cru/data/temperature/abs_glnhsh.txt
absolute_value = 13.974 + 273.5
time = global_ds['time'].data
temperature = global_ds['tas_mean'].data + absolute_value
albedo = 0.3

epsilon = climate_model.emissivity_given_temp(albedo, temperature)

axs.plot(time, epsilon)

axs.set_xlabel("Year")
axs.set_ylabel("Effective emissivity of Earth")

plt.show()

13 changes: 13 additions & 0 deletions exercises/testing_exercises.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Exercises

In the example repository, there is a file called 'climate_model.py'.
This file contains some functions that are used in 'plot4.py'

Task:

1. Write some basic tests for these functions (think about inputs that give known
outputs)
2. Think about what properties/behaviours these functions should have, and write
tests for them
3. Look at the other python files, and see if any functions can be extracted and
tested
49 changes: 9 additions & 40 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 37 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
{
description = "Reproducibility in Scientific Software environment";

inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
devShells.default = import ./shell.nix { inherit pkgs; };
}
);
inputs = {
nixpkgs.url = "github:Nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
myPythonPackages = ps: with ps; [
pandas
numpy
matplotlib
jupyter
jupyter-cache
];
pythonEnv = pkgs.python3.withPackages myPythonPackages;
in
{
devShells.${system}.default = pkgs.mkShell {
packages = [
((pkgs.quarto.override {
extraPythonPackages = myPythonPackages;
}).overrideAttrs (oldAttrs: {
# Remove this overrideAttrs patch when fixed.
# See https://github.com/NixOS/nixpkgs/issues/519484#issuecomment-4667477454
postPatch = (oldAttrs.postPatch or "") + ''
substituteInPlace bin/quarto.js \
--replace-fail "syntax-highlighting" "highlight-style"
'';
}))
pythonEnv
];
shellHook = ''
echo "Quarto Environment Active (Pure Flake)"
echo "Quickstart: run 'quarto render document.qmd'"
'';
};
};
}
14 changes: 0 additions & 14 deletions shell.nix

This file was deleted.

1 change: 1 addition & 0 deletions src/Summer-school-Intro-Git
14 changes: 14 additions & 0 deletions src/_extensions/quarto-ext/attribution/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: Attribution
author: Roland Schmehl
version: 0.1.1
quarto-required: ">=1.2.198"
contributes:
revealjs-plugins:
- name: RevealAttribution
script:
- attribution.js
stylesheet:
- attribution.css



19 changes: 19 additions & 0 deletions src/_extensions/quarto-ext/attribution/attribution.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Attribution plugin: text along the right edge of the viewport */
.attribution{
position: absolute;
top: 50%;
bottom: auto;
left: 50%;
right: auto;
font-size: 0.4em;
pointer-events: none;
text-align: center;
writing-mode: vertical-lr;
transform: translate( -50%, -50% ) scale( 100% ) rotate(-180deg);
text-orientation: sideways;
}

/* Attribution plugin: activate pointer events for attribution text only */
.attribution .content{
pointer-events: auto;
}
75 changes: 75 additions & 0 deletions src/_extensions/quarto-ext/attribution/attribution.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*****************************************************************
** Author: Roland Schmehl, r.schmehl@tudelft.nl
**
** A plugin for displaying attribution texts sideways along the right
** edge of the viewport. When resizing the viewport or toggling full
** screen mode, the attribution text sticks persistently to the right
** edge of the viewport.
**
** The dynamic scaling of the attribution text via CSS transform
** is adopted from the fullscreen plugin.
**
** Version: 1.0
**
** License: MIT license (see file LICENSE)
**
******************************************************************/

window.RevealAttribution = window.RevealAttribution || {
id: 'RevealAttribution',
init: function(deck) {
initAttribution(deck);
}
};

const initAttribution = function(Reveal){

var ready = false;
var resize = false;
var scale = 1;

window.addEventListener( 'ready', function( event ) {

var content;

// Remove configured margin of the presentation
var attribution = document.getElementsByClassName("attribution");
var width = window.innerWidth;
var configuredWidth = Reveal.getConfig().width;
var configuredHeight = Reveal.getConfig().height;

scale = 1/(1-Reveal.getConfig().margin);

for (var i = 0; i < attribution.length; i++) {
content = attribution[i].innerHTML;
attribution[i].style.width = configuredWidth + "px";
attribution[i].style.height = configuredHeight + "px";
attribution[i].innerHTML = "<span class='content'>" + content + "</span>";
attribution[i].style.transform = 'translate( -50%, -50% ) scale( ' + scale*100 + '% ) rotate(-180deg)';
}

// Scale with cover class to mimic backgroundSize cover
resizeCover();

});

window.addEventListener( 'resize', resizeCover );

function resizeCover() {

// Scale to mimic backgroundSize cover
var attribution = document.getElementsByClassName("attribution");
var xScale = window.innerWidth / Reveal.getConfig().width;
var yScale = window.innerHeight / Reveal.getConfig().height;
var s = 1;

if (xScale > yScale) {
// The div fits perfectly in x axis, stretched in y
s = xScale/yScale;
}
for (var i = 0; i < attribution.length; i++) {
attribution[i].style.transform = 'translate( -50%, -50% ) scale( ' + s*scale*100 + '% ) rotate(-180deg)';
}
}

};
Loading
Loading