Skip to content

Commit

Permalink
Write to a relative temp dir (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
mccalluc authored Nov 19, 2024
1 parent 57b8ff8 commit 7de7bb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions dp_wizard/tmp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
demo.csv
4 changes: 2 additions & 2 deletions dp_wizard/utils/argparse_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def _get_demo_csv_contrib():
"""
random.seed(0) # So the mock data will be stable across runs.

csv_path = "/tmp/demo.csv"
csv_path = Path(__file__).parent.parent / "tmp" / "demo.csv"
contributions = 10

with open(csv_path, "w", newline="") as demo_handle:
with csv_path.open("w", newline="") as demo_handle:
fields = ["student_id", "class_year", "hw_number", "grade"]
writer = csv.DictWriter(demo_handle, fieldnames=fields)
writer.writeheader()
Expand Down

0 comments on commit 7de7bb5

Please sign in to comment.