Follow the transformation
Read inputs from declared locations rather than manually edited in-memory data.
Place transformations in deterministic functions where practical.
Parameterise dates/paths instead of changing source code between runs.
A reproducible analysis script can be rerun from declared inputs to regenerate the same transformations and outputs.
A reproducible analysis script can be rerun from declared inputs to regenerate the same transformations and outputs. It avoids hidden notebook state and manual spreadsheet edits by making paths, parameters, dependencies and execution order explicit.
Learning goal: explain why Reproducible Scripts behaves this way, apply it to a small example, and verify the result independently. Begin by being able to justify this first step: Read inputs from declared locations rather than manually edited in-memory data.
Treat this as a sequence of observable decisions rather than one opaque command. Stage 1: Read inputs from declared locations rather than manually edited in-memory data. Stage 2: Place transformations in deterministic functions where practical. Stage 3: Parameterise dates/paths instead of changing source code between runs. Final checkpoint: Record dependencies and rerun in a clean environment.
Read inputs from declared locations rather than manually edited in-memory data.
Place transformations in deterministic functions where practical.
Parameterise dates/paths instead of changing source code between runs.
Read inputs from declared locations rather than manually edited in-memory data. This is an input-preparation stage for Reproducible Scripts. Verify the relevant type, shape, units, keys, missingness or assumptions before later steps depend on them.
# Step 1 — Define the reusable `main` function; its indented body describes what happens for each call.
def main(input_path, output_path):
# load -> validate -> analyse -> save
# Step 2 — Execute this statement and inspect how it changes the current value, object or program state.
...
# Step 3 — Evaluate this condition and execute the indented branch only when the condition is true.
if __name__ == "__main__":
# Step 4 — Leave this block intentionally empty as a placeholder for later behaviour.
passA single declared entry point makes the execution order explicit; real code would fill in each validated stage.
For Reproducible Scripts, identify exactly what each reported quantity represents, including its units/denominator, and independently recompute one part of the result.
DefinitionThe exact metric/selection/comparison being computed.EvidenceTable, formula or visual that answers the question.AuditIndependent count/total/rule check that can reveal an error.Use Reproducible Scripts when it answers a defined question in Reporting & Reproducibility and its inputs/assumptions match the current data or program state.
Reconsider Reproducible Scripts when the required information is unavailable, the operation would violate a validation/data boundary, or a simpler operation answers the question more transparently.
Construct a tiny example of Reproducible Scripts. First read inputs from declared locations rather than manually edited in-memory data. Then place transformations in deterministic functions where practical. Predict the result before execution and explain one boundary or failure case.
Which approach best demonstrates understanding of Reproducible Scripts?
Step 1Read inputs from declared locations rather than manually edited in-memory data.Step 2Place transformations in deterministic functions where practical.Step 3Parameterise dates/paths instead of changing source code between runs.Step 4Write outputs to known locations with versionable names.