use relative symlinks
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path, PurePath
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import datasets
|
import datasets
|
||||||
@@ -17,12 +17,12 @@ def ensure_matrix_download(dir, mat):
|
|||||||
return
|
return
|
||||||
mat.download(format='MM', destpath=dir, extract=True)
|
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):
|
def ensure_matrix_link(downDir, linkDir, mat):
|
||||||
files = os.listdir(downDir / mat.name)
|
files = os.listdir(downDir / mat.name)
|
||||||
for f in files:
|
for f in files:
|
||||||
if f == mat.name + ".mtx":
|
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")
|
dst = linkDir / (mat.name + ".mtx")
|
||||||
print(f"{src} <- {dst}")
|
print(f"{src} <- {dst}")
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user