Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Book

Lab 3 — Building a Reproducible Open Science Project

Introduction

This laboratory introduces the principles of reproducible research through the development of an open science project based on the dataset selected and published on Borealis in Lab 2. You will organize a repository following community best practices, manage a reproducible computational environment, and build a documented data analysis workflow using Git and GitHub.


GitHub Environment

Repository

Create a repository. Refer to the GitHub Quickstart for repositories for an introduction to repository creation and management.

README.md file

The README.md file is the entry point to your project. It provides the information needed for others to understand your work, reproduce your results, and reuse your repository.

You may use the following template as a starting point:

Template: World Bank README template

The README.md should be updated throughout the lab as you build your project.

License

A license defines how others are allowed to use, modify, and share your project.

Code of Conduct

A Code of Conduct establishes clear expectations for respectful and inclusive collaboration within your project.

CONTRIBUTING.md file

A CONTRIBUTING.md file explains how others can participate in your project. It defines clear guidelines for submitting changes, reporting issues, and following project conventions.

AI_Prompts file

Create an AI_Prompts.md file that documents the AI model used during the assignment and the most useful prompt you used. Sharing an effective prompt can help others learn from your experience and apply similar techniques in their own work.

When writing your prompts, pay particular attention to the Description component of the 4D Framework, as providing clear context is essential for obtaining useful and reproducible results. To learn more about effective prompting, you are encouraged to explore Anthropic’s free AI Fluency Framework Foundations course.

Branch protection rules

Branch protection rules help maintain the integrity of your repository by preventing direct or unreviewed changes to critical branches.

Protect main

The main branch should always remain stable and represent a working version of the project. Direct pushes to this branch must be prevented so that all changes go through a controlled review process.

Pull requests required with at least one review

All changes must be submitted through pull requests and reviewed by at least one other team member. This ensures that no one approves their own changes and promotes collaborative validation of the work.

Branch naming convention

A consistent branch naming convention must be followed to keep the project history clear and readable. This helps avoid confusion and makes it easier to understand the purpose of each branch.

Issues

You must use GitHub Issues to structure and track the work of your project. Each issue should represent a clear task or objective, and the work should be distributed across the team.

You need:

Collaborative Git workflow

Throughout the lab, use the collaborative Git workflow introduced in Lab 1. Organize your work into issues, develop changes on appropriately named branches, write meaningful commit messages, and submit pull requests for review before merging them into main.

Keep your repository documentation up to date as the project evolves, and ensure that your commit history reflects the progression of your work.


Code environment

Folder structure

A clear folder structure separates raw data, processed data, code, results, and documentation in a consistent way, making the workflow easier to understand and navigate.

For example:

project-root/
│
├── README.md
├── environment.yml
├── .gitignore
├── data/
│   ├── raw/
│   └── processed/
├── scripts/
│   ├── download_data.py
│   └── analyze.py
├── notebooks/
├── figures/
└── results/

Virtual environment

Create a virtual environment to isolate project dependencies and ensure a reproducible computational setup. This prevents conflicts with other projects and avoids polluting your global environment.

Choose one of the following options to create your virtual environment:

Download the data

Create a script that retrieves the dataset from Borealis. This step ensures that data acquisition is automated and reproducible, rather than performed manually.

Preprocess the data

Create a preprocessing script to clean and standardize the raw data before analysis. This may include:

Analyze your data

Create a script that performs the data analysis and generates the results. The script should compute summary metrics and produce visualizations that help answer your research question. The use of Pandas, NumPy, and Matplotlib is recommended.

Compute 2–3 metrics

Compute at least two or three meaningful metrics from your dataset. Typical examples include:

Produce 1–2 visualizations

Produce one or two visualizations that communicate your results effectively. Each visualization must:

Examples include:

Comment your code

Write clear, readable code and include comments where they improve understanding. Comments should explain the purpose or reasoning behind the code rather than restating what individual statements do. Refer to the MIT Communication Lab guidelines on coding and comment style for recommendations.

Report

Create a report in Markdown (.md) format that presents your project and communicates the results of your analysis. The report should briefly introduce the research question, describe the dataset, summarize the methodology, and discuss the main findings.

Include the figures generated by your analysis and explain what they show. Each figure should be referenced in the text and accompanied by a short interpretation that relates it to your research question.

Virtual environment export

Export your virtual environment and its dependencies to a file that can be used to recreate the same computational environment. This file captures the project’s required packages and versions, allowing others to reproduce your analysis in a consistent environment.

Depending on your chosen environment management tool, export your dependencies using the appropriate format:

.gitignore file

The .gitignore file specifies which files and directories should not be tracked by Git. It is commonly used to exclude temporary files, caches, virtual environments, and large or generated data files that should not be stored in the repository. Keeping these files out of version control helps maintain a clean and reproducible project.

You may use the GitHub .gitignore template as a starting point. As your project evolves, remember to update your .gitignore and other repository files as needed to reflect changes to your project structure and workflow.


Bonus — Continuous Integration (CI)

Continuous Integration (CI) is commonly used in open science projects to automatically verify that a project remains reproducible as it evolves.

Using GitHub Actions, implement at least one automated workflow for your repository.

Possible examples include:

Requirements


Evaluation

CriterionWeightDescription
README.md15%The README.md contains all required sections and clearly documents the project.
License5%An appropriate open-source license is included in the repository.
Code of Conduct5%A complete Code of Conduct is provided.
CONTRIBUTING.md5%A complete CONTRIBUTING.md file defines contribution guidelines.
Branch Protection Rules3%Branch protection rules are configured according to the assignment requirements.
Issues6%GitHub Issues are used to plan and track project work according to the assignment requirements.
Folder Structure3%The repository follows the required project organization.
Virtual Environment3%A reproducible Conda environment is provided and documented.
Scripts15%Download, preprocessing, and analysis scripts are complete, functional, and well written.
Report10%The report clearly presents the project, methodology, and analysis results.
.gitignore5%The repository excludes unnecessary files from version control.
Development Workflow20%Appropriate use of branches, commits, pull requests, reviews, and repository maintenance practices.
AI Prompt Documentation5%AI usage is transparently documented through an AI_Prompts.md file.