Module 12: Large Language Models — How LLMs work, prompting, APIs
This course is currently open to students at Sciences Po. If you are not a Sciences Po student but would like access, please email me to request an invite token.
Incorrect password. Please try again.
9 Git & GitHub
~8 hoursVersion ControlBeginner-Intermediate
Learning Objectives
Understand why version control is essential for research
# Create and switch to branch
$ git checkout -b feature-new-analysis# Make commits on branch...
$ git add . && git commit -m"Add new analysis"# Switch back to main
$ git checkout main# Merge branch into main
$ git merge feature-new-analysis# Delete branch after merge
$ git branch -d feature-new-analysis
Terminal Output
$ git checkout -b feature-new-analysis
Switched to a new branch 'feature-new-analysis'
$ git add . && git commit -m "Add new analysis"
[feature-new-analysis b2c3d4e] Add new analysis
2 files changed, 45 insertions(+)
create mode 100644 code/new_analysis.py
create mode 100644 output/new_results.csv
$ git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
$ git merge feature-new-analysis
Updating a1b2c3d..b2c3d4e
Fast-forward
code/new_analysis.py | 35 +++++++++++++++++++++++++++++++++++
output/new_results.csv | 10 ++++++++++
2 files changed, 45 insertions(+)
create mode 100644 code/new_analysis.py
create mode 100644 output/new_results.csv
$ git branch -d feature-new-analysis
Deleted branch feature-new-analysis (was b2c3d4e).
8.5 Collaboration Workflows
Pull Requests
Pull requests (PRs) are GitHub's way of proposing changes. The workflow:
Create a branch for your feature
Push branch to GitHub
Open a Pull Request
Request review
Merge when approved
8.6 Best Practices for Research
The .gitignore File
# .gitignore for research projects# Data files (often too large or sensitive)data/raw/*.csvdata/raw/*.dta*.xlsx# Output (can be regenerated)output/figures/*output/tables/*# Environment.env__pycache__/*.pyc.Rhistory# OS files.DS_StoreThumbs.db
Git Status After .gitignore
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged ..." to unstage)
new file: .gitignore
Untracked files not listed (use -u option to show untracked files)
# The following files are now being ignored:
# data/raw/survey_2019.csv (ignored by data/raw/*.csv)
# data/raw/panel_data.dta (ignored by data/raw/*.dta)
# results.xlsx (ignored by *.xlsx)
# output/figures/figure1.pdf (ignored by output/figures/*)
# output/tables/table1.tex (ignored by output/tables/*)
# .env (ignored by .env)
# __pycache__/ (ignored by __pycache__/)
# .DS_Store (ignored by .DS_Store)
$ git check-ignore -v data/raw/survey.csv
.gitignore:4:data/raw/*.csv data/raw/survey.csv
GitHub Features for Researchers
Releases: Tag versions of your code (v1.0, v2.0)
Issues: Track bugs and tasks
GitHub Pages: Host project websites for free
Actions: Automate testing and deployment
Zenodo integration: Get a DOI for your code
ProTools ER1 Assistant
Hello! I'm the ProTools ER1 course assistant. I can help you with questions about Python, Stata, R, causal inference methods, or any of the course material. How can I assist you today?