From 0d395f82e2a10e4c86a5d2d7d6c5cefee963bbc4 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Mon, 29 Nov 2021 07:34:22 -0800 Subject: [PATCH] use relative symlinks --- download.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/download.py b/download.py index 0e116cc..66966ea 100755 --- a/download.py +++ b/download.py @@ -1,5 +1,5 @@ import os -from pathlib import Path +from pathlib import Path, PurePath import sys import datasets @@ -17,12 +17,12 @@ def ensure_matrix_download(dir, mat): return mat.download(format='MM', destpath=dir, extract=True) -# link matrix in downDir to linkDir +# create a link in linkDir for the matrix in downDir def ensure_matrix_link(downDir, linkDir, mat): files = os.listdir(downDir / mat.name) for f in files: if f == mat.name + ".mtx": - src = downDir / mat.name / f + src = Path(os.path.relpath(downDir, linkDir)) / mat.name / f dst = linkDir / (mat.name + ".mtx") print(f"{src} <- {dst}") try: