The Analyst's Path

Phase 12 · Finance Plus, AI and the quant-code track · free

Command Line, Environments & Reproducible Projects

CS2.01 · 13,826 words

This node is the twelve hours where you stop being a guest in someone else's sandbox and start being responsible for the room the code lives in.

Learning objectives

By the end you can:

  1. Navigate and manipulate a filesystem entirely from a command-line shell, the working directory, absolute versus relative paths, and the core verb set (list, change directory, make a directory, copy, move, remove), without ever opening a file browser.
  2. Compose small, single-purpose tools into a pipeline using pipes and redirection (|, >, >>, <), and explain the three-stream model (stdin, stdout, stderr) that makes that composition possible.
  3. Explain precisely what an environment variable is and how a shell resolves a bare command name via the PATH variable, including exactly what happens, and in which order, when two versions of the same tool are both "on the path."
  4. Build, activate, and reason about an isolated Python virtual environment (venv); explain why environment isolation exists by naming the specific failure mode ("it works on my machine") it defeats.
  5. Read and write dependency version constraints in a requirements.txt (==, >=, ~=, unpinned), and explain (with a concrete example) exactly how an unpinned dependency silently breaks reproducibility weeks or months after it was written.
  6. Lay out a small project directory the way a real research repository is organized (a place for source, data, notebooks, tests, and a documented entrypoint), and state precisely what belongs in version control versus what must be excluded and regenerated.
  7. Run a Jupyter notebook the way it is meant to be run for anything you intend to trust; name the "hidden state" failure mode caused by out-of-order or repeated cell execution, and apply the "Restart & Run All" discipline that defeats it.
  8. Define reproducibility precisely, the same code, the same pinned environment, the same data snapshot, and the same seed must produce the same result, and build a small run that survives being deleted and rebuilt from scratch on a different machine.
  9. Read and set file permissions (chmod, symbolic and octal notation) and a shebang line well enough to diagnose a "permission denied" error on sight, and predict which commands in an && / || / ; chain actually execute given a set of exit codes.
  10. (Productivity objective: R10 duality.) Use an AI copilot to accelerate the unglamorous parts of environment work, drafting a shell one-liner, a requirements.txt skeleton, or a diagnosis of a cryptic error message, while applying the three-law Copilot Discipline: understand the by-hand version first, then accelerate, then always review before anything touches a real filesystem.

The duality, stated once (R10). This module carries two objectives at once, as every module in this program does. The understanding objective (items 1–9) is what the mastery gate rewards; you earn the pass by explaining the mechanism and by getting the graded code-pack exercises' hidden tests to go green, not by having watched someone else do it. The productivity objective (item 10) is the payoff you keep afterward: knowing when a copilot can safely draft a shell command or a dependency file for you, and knowing exactly what "review it first" has to mean when the thing you're about to run can delete real files. A tool can never buy you a pass on the gate, and it must never run unread against anything you can't afford to lose.


Prerequisites & connections

Builds on. CS1.01 through CS1.05, you can already write correct, idiomatic Python and reason about data structures and algorithms. Every one of those modules ran your code inside this program's own sandboxed runner, which quietly handled the interpreter, the packages, and the working directory for you. This node is the branch's sequential next step after the CS1.05 crown (Data Structures & Algorithms): it does not ask you to write cleverer logic, it asks you to take the logic you already know how to write and make it run, correctly, the same way twice, on a real machine that isn't managing any of this for you. If a term below (function, loop, dictionary) is unfamiliar rather than just "phrased differently," that is a CS1.01–CS1.05 gap, not a CS2.01 one.

This page is an excerpt

The full module runs to 13,826 words and carries the worked examples, the tables, the quiz that gates the next module and the spaced-repetition deck built from it. All of it is free and none of it needs an account.