Week 1: Getting Started

Goals

  • Set up a modern development environment
  • Understand how to work on the command-line
  • Learn about the uv package managers
  • Learn our pull request workflow using git
  • Make your first pull request (and deal with a merge conflict!)
  • Complete ethics training

Sam drafted these pages super quickly, so there are probably lots of details that he left out! Feel free to send a pull request for any page of these guides.

Development Environment

This is just one recommended setup, feel free to customize as much as you’d like.

macOS-specific:

  • Install brew for CLI tools

Watch a tutorial on using VSCode productively, e.g.: https://youtu.be/ifTF3ags0XI?si=MDWD-K34sOrKuaVk.

Follow this guide to set up VSCode / Cursor for Python development: https://medium.com/ordinaryindustries/the-ultimate-vs-code-setup-for-python-538026b34d94

Now, check your knowledge:

  1. What is the difference between Cmd+Shift+P and Cmd+P in VSCode?
  2. What do brew (macOS) or apt-get (WSL/Linux) do? What is different about these tools vs. downloading and installing an app on your laptop?
  3. What are pros and cons of using a GUI like VSCode over a command-line editor like nano or vim?

Working on the Command-Line

Walk through each of these lessons of the Missing Semester. Complete the exercises.

  1. https://missing.csail.mit.edu/2020/course-shell/
  2. https://missing.csail.mit.edu/2020/shell-tools/
  3. https://missing.csail.mit.edu/2020/command-line/
  4. https://missing.csail.mit.edu/2020/version-control/
  5. https://missing.csail.mit.edu/2020/potpourri/ (No exercises for this one.)

Optional, but recommended: install and set up fish as your default shell instead of bash.

Rationale:

Now, check your knowledge:

  1. What do ~, ., and .. mean in paths? What is the difference between an absolute path and a relative path?
  2. What does the $PATH environment variable control? How would you add a directory to it for just this session vs. permanently?
  3. What is the difference between >, >>, |, and 2>?
  4. What is the difference between stopping a program with Ctrl-C and suspending it with Ctrl-Z? How do you resume a suspended job in the foreground and in the background?
  5. What does the permission string -rwxr-x--- mean? How do you make a script executable and run it from the current directory?
  6. In git, what is the difference between the working directory, the staging area, and a commit? What is the difference between git commit and git push?
  7. How can you quickly search your command history? What does history do and how do you trigger reverse search?

uv

Now, check your knowledge:

  1. In one sentence, why do we prefer uv over pip?
  2. What does a lockfile provide, and where does uv write it in a project?
  3. How do you add a runtime dependency vs. a dev dependency with uv?
  4. How do you run a module or script through uv without activating the venv?
  5. How do you activate the venv? What does activating the venv do?
  6. Start a new uv project targeting Python 3.13. Add jupyterlab and babypandas==1.0.0.dev1. Launch JupyterLab, create a notebook, import babypandas as bpd, build a tiny DataFrame (e.g., names and ages), sort it by age, and confirm it works.

git workflow: making pull requests

Now, check your knowledge:

  1. Clone our lab webpage https://github.com/dstl-lab/dstl-lab.github.io
  2. Run the lab webpage locally by following the instructions in the repo README.
  3. Checkout to a new branch with your name in the branch name (e.g. Sam would create a branch like sam-add-picture).
  4. Add your name and picture to the lab homepage. Make sure your picture loads locally.
  5. Commit, then make a pull request to our homepage repo.
  6. Request a code review from someone else on your team.
  7. When the other person approves the PR, merge the PR.
  8. Verify that the build works correctly, then see your updated picture at https://dstl.ucsd.edu/!

CITI training

As research who work with human subjects, we are required to do ethics training.

Go to: https://about.citiprogram.org/

  • Create a login using your main @ucsd address (not an alias)
  • This is how campus tracks compliance

  • Add University of California, San Diego as your institution

Add a course

  • Check boxes Human Subjects Research and Responsible Conduct of Research
  • Check boxes Social & Behavioral Research Investigators and Social & Behavioral Research Investigators Refresher
  • Check single radial button Social and Behavioral Responsible Conduct of Research Course
  • Check none at this time for webinars

You should be assigned

  • Social & Behavioral Research - Basic/Refresher
  • Social and Behavioral Responsible Conduct of Research
  • Complete and add certificate (not completion report) URL to our lab roster