-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
197 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Download and extract the data archive from the web. | ||
""" | ||
|
||
import tarfile | ||
import os | ||
from urllib.request import urlretrieve | ||
|
||
data_archive_path = 'data.tar.gz' | ||
data_archive_url = 'http://staff.washington.edu/bmmorris/docs/data.tar.gz' | ||
p = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') | ||
|
||
# Write local copy of the data archive: | ||
print('Downloading (150 MB) and extracting data to "{0}"...'.format(p)) | ||
urlretrieve(data_archive_url, data_archive_path) | ||
|
||
# Extract all files from the gzipped tar archive | ||
with tarfile.open(data_archive_path, 'r|gz') as f: | ||
f.extractall() | ||
|
||
# Remind the user to set an environment variable: | ||
print('Now set an environment variable "MRSPOC_DATA_DIR" to the path to the ' | ||
'data, directory {0}'.format(p)) |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.