Garbage in Garbage Out
Sensible In, Reasonable Out.
Do some programming
my_vcs commit
Program some more
Realise mistake
my_vcs rollback
Mistake is undone
Sue | James |
---|---|
my_vcs commit |
|
Join the team | |
my_vcs checkout |
|
Do some programming | |
my_vcs commit |
|
my_vcs update |
|
Do some programming | Do some programming |
my_vcs commit |
|
my_vcs update |
|
my_vcs merge |
|
my_vcs commit |
fetch_dataset 53b6
run_model dataset_53b6
Examine_results results_28_02_13_1_53b6_98d2
archive_results latest
create_graphs results_28_02_13_1_53b6_98d2
pandoc_slides=Builder(action='pandoc -t revealjs -s -V theme=night'+
' --css=night.css'+
' --css=slidetheme.css'+
' --mathjax '+
' -V revealjs-url=http://lab.hakim.se/reveal-js/'+
' $SOURCES -o $TARGET')
...
dot_figure_builder=Builder(action='dot -Tpng $SOURCE -o $TARGET',
suffix='.png',
src_suffix='.dot')
# Checkout the repository from GitHub
vcsrepo {"repo-$title":
path => "/opt/gitrepos/$checkout_location",
ensure => 'latest',
owner => 'apache',
user => 'apache',
identity => '/home/ccsprsd/.ssh/id_rsa',
group => 'apache',
provider => 'git',
require => [ Package["git"], File["$service_home/.ssh/id_rsa"], ],
source => "$source",
revision => $branch,
}
#Run Pandoc via scons to produce the Reveal.js presentations
exec { "build-$title":
command => $command,
cwd => "/opt/gitrepos/$checkout_location/$workdir",
require => [Exec["install-pandoc"],
Package["scons"],
Vcsrepo["repo-$title"]]
}
# Copy the C++ course directory into the web folder
file {"install-$title":
path => "$install/$target",
source => "/opt/gitrepos/$checkout_location/$sitedir",
recurse => true,
require => Exec["build-$title"],
notify => Service["httpd"],
owner => 'ccsprsd',
group => 'ccspx0',
}
Know what you want:
def test_range_overlap():
assert range_overlap([ (0.0, 1.0), (5.0, 6.0) ]) == None
assert range_overlap([ (0.0, 1.0) ]) == (0.0, 1.0)
assert range_overlap([ (2.0, 3.0), (2.0, 4.0) ]) == (2.0, 3.0)
assert range_overlap([ (0.0, 1.0), (0.0, 2.0), (-1.0, 1.0) ]) == (0.0, 1.0)
Then make it happen:
def range_overlap(ranges):
'''Return common overlap among a set of [low, high] ranges.'''
highest_min=max([range[0] for range in ranges])
lowest_max=min([range[1] for range in ranges])
if (lowest_max <= highest_min): return None # Note equality
return (highest_min, lowest_max)
assert range_overlap([ (0.0, 1.0), (1.0, 2.0) ]) == None
Tests are Executable Documentation
Testing tells you:
@uclrcsoftdev @jamespjh @uclrits
blogs.ucl.ac.uk/research-software-development
j.hetherington@ucl.ac.uk
And sign up to be notified of the date of the next bootcamp.
``I found the command line intimidating at first, but after a while it felt like I was inside my computer.''
-- A student at the UCL software carpentry event