Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create intermediate directories if they don't exist #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nlpgnn/datas/graphloader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! encoding:utf-8
import glob
import os
import pathlib
import pickle as pkl
import sys
from collections import defaultdict
Expand Down Expand Up @@ -664,7 +665,7 @@ def raw_file(self, data):
def download(self):
data_dir = os.path.join(self.data_dir, self.data)
if not os.path.exists(data_dir):
os.mkdir(data_dir)
pathlib.Path(data_dir).mkdir(parents=True, exist_ok=True)
for name in self.raw_file(self.data.lower()):
url = "{}/{}".format(self.url, name)
outpath = "{}/{}".format(data_dir, name)
Expand Down