[PR #1678] [MERGED] fix(mlsysim): replace hardcoded Mac path in interviewer.py with relative Path #17365

Closed
opened 2026-05-24 12:09:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1678
Author: @Shashank-Tripathi-07
Created: 5/5/2026
Status: Merged
Merged: 5/7/2026
Merged by: @profvjreddi

Base: devHead: fix/mlsysim-interviewer-hardcoded-path


📝 Commits (1)

  • b143875 fix(mlsysim): replace hardcoded Mac path in interviewer.py with relative Path

📊 Changes

1 file changed (+3 additions, -1 deletions)

View changed files

📝 mlsysim/mlsysim/cli/interviewer.py (+3 -1)

📄 Description

Bug

mlsysim/mlsysim/cli/interviewer.py line 74 had a hardcoded Mac-specific absolute path in its __main__ smoke-test block:

corpus = InterviewCorpus("/Users/VJ/GitHub/MLSysBook/interviews/corpus.json")

This crashes immediately on any non-Mac machine (Windows, Linux, CI).

Fix

Replaced with a Path(__file__)-relative path that resolves correctly on all platforms:

_repo_root = Path(__file__).resolve().parents[3]
corpus = InterviewCorpus(_repo_root / "interviews" / "corpus.json")

Also added the missing from pathlib import Path import.

interviewer.py is at mlsysim/mlsysim/cli/interviewer.py -- .parents[3] correctly resolves to the repo root.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1678 **Author:** [@Shashank-Tripathi-07](https://github.com/Shashank-Tripathi-07) **Created:** 5/5/2026 **Status:** ✅ Merged **Merged:** 5/7/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `fix/mlsysim-interviewer-hardcoded-path` --- ### 📝 Commits (1) - [`b143875`](https://github.com/harvard-edge/cs249r_book/commit/b143875586ad41a93ecd718c6051e9e63baa492c) fix(mlsysim): replace hardcoded Mac path in interviewer.py with relative Path ### 📊 Changes **1 file changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `mlsysim/mlsysim/cli/interviewer.py` (+3 -1) </details> ### 📄 Description ## Bug `mlsysim/mlsysim/cli/interviewer.py` line 74 had a hardcoded Mac-specific absolute path in its `__main__` smoke-test block: ```python corpus = InterviewCorpus("/Users/VJ/GitHub/MLSysBook/interviews/corpus.json") ``` This crashes immediately on any non-Mac machine (Windows, Linux, CI). ## Fix Replaced with a `Path(__file__)`-relative path that resolves correctly on all platforms: ```python _repo_root = Path(__file__).resolve().parents[3] corpus = InterviewCorpus(_repo_root / "interviews" / "corpus.json") ``` Also added the missing `from pathlib import Path` import. `interviewer.py` is at `mlsysim/mlsysim/cli/interviewer.py` -- `.parents[3]` correctly resolves to the repo root. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-24 12:09:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#17365