Week 7: Medium-sized Data and Working with Remotes#
- The Collaborative Report and Style Guides
- GitHub Issues and Pull Requests: Enhancing Collaborative Development
- Data Sources Overview
- Cleaning TRACE Corporate Bond Data: A Walkthrough
- Strategies for Medium-Sized Data
- Polars Exercises: Code Snippets
- Remote Machines and High-Performance Computing
- Exercise: Jupyter Notebook on Midway via SSH
- Optional Lab: Clean TRACE on Midway
- Study Guide: Week 7
We start by finishing week 6: the pins demo, HW 4 from claim to merge, and the report’s style guides. Then one dataset carries the rest of the day.
TRACE records every U.S. corporate bond trade. The raw feed is full of cancellations, corrections, and reversals, and the full history is tens of gigabytes. Cleaning it takes hours. That makes it a medium-data problem first: Parquet, Polars, and reading only the columns and rows you need. Then it is a remote-machine problem: the work runs on Midway3, the university’s cluster, which you reach over SSH and edit with VS Code in a browser. Last, it is a scheduling problem. On a shared cluster you do not start a long job yourself. You ask the scheduler, SLURM, for a machine, and it runs the job when one is free.
Announcements#
HW 3 is due today at 9:30 am, the start of class.
HW 4, the class report, has more time. It is now due Tuesday, November 24, at 9:30 am, and your pull request should be open by Tuesday, November 17, the week 8 session, so your two reviewers have a week. If you have not accepted your invite to the report repository, do it today: the invites sent on November 9 expire around November 16. If yours never arrived, tell me in class.
You should have access to UChicago RCC To access the RCC clusters, you need your CNetID password and Duo. Your account is on the course allocation; if
ssh <cnetid>@midway3.rcc.uchicago.edufails, we fix it after class.The exam is Tuesday, December 1, covering weeks 0 through 8, today included. See Exam Preparation.
Project consultations end this week, on Friday, November 13. If your group has not had one, book it today: Microsoft Bookings.
Objectives#
Take an exhibit for HW 4 from claim to merge: branch, pin, pull request, two reviews, and the report’s style guides.
Explain the major judgment calls in cleaning TRACE and why careful researchers produce different “clean” datasets.
Choose a strategy for data between 1 GB and 100 GB: use less of it, stream it, or move to a bigger machine. Explain lazy evaluation, predicate and projection pushdown, and Hive partitioning in Polars.
Connect to Midway3 and the WRDS Cloud over SSH, keep an SSH config, and move files with
rsync.Describe a cluster: login nodes, compute nodes, home, project, and scratch storage, and why you never compute on a login node.
Run VS Code against a remote machine:
scodeon Midway3, and a VS Code tunnel to a machine you control.Submit, monitor, and cancel SLURM jobs, interactive and batch, including a job array, and say what the same commands are called under Grid Engine on the WRDS Cloud.
Agenda#
Finishing week 6: the pins demo (walkthrough): hashes by hand, a live git dependency,
pinversusupdate, and rebuilding an upstream on a later day to get a different hash.HW 4 from claim to merge (HW 4, Issues and Pull Requests): claim an issue, branch, pin, open the pull request with
fixes #N, two reviews, and whymainis protected.The report’s style guides (The Collaborative Report and Style Guides): the code, the write-up, and the chart, and the published reports they borrow from.
The case study: cleaning TRACE (Data Sources Overview, Cleaning TRACE). Cancellations, corrections, and reversals; agency double counts; prices that cannot be right. Each filter is a judgment call. Dickerson, Robotti, and Rossetti (2026) show that corporate bond factor results move with those calls. When “clean” is a convention, the defense is a convention that is documented, tested, and rerunnable.
Medium data, on TRACE (Medium-Sized Data Strategies, Polars Exercises): the three escapes; Parquet as a columnar format; Polars lazy scans and query plans; the Hive-partitioned layout the TRACE pipeline writes.
Remote machines (Remote Machines and HPC): SSH and Duo, an SSH config, login versus compute nodes, home versus project versus scratch,
rsyncto bring results back, and the WRDS Cloud.VS Code on someone else’s machine:
scodeon Midway3, which runs VS Code on a compute node and reaches it through an SSH tunnel (exercise); then a VS Code tunnel to a machine you control.SLURM (Remote Machines and HPC): who asks for it in job postings; partitions;
sinteractive,sbatch,squeue,scancel; a job array everyone submits; then the TRACE pipeline as a batch job (optional lab).
Next week: packaging, CI, and code quality, and the paper of Bernanke and Kuttner (2005).