Download the Data

Download the Data

# First, import the necessary modules and functions
import os

from repo2data.repo2data import Repo2Data

# Install the data if running locally, or points to cached data if running on neurolibre
DATA_REQ_FILE = os.path.abspath("../binder/data_requirement.json")
repo2data = Repo2Data(DATA_REQ_FILE)
data_path = repo2data.install()
data_path = os.path.join(data_path[0], "data")
print(f"Data are located at {data_path}")
---- repo2data starting ----
/srv/conda/envs/notebook/lib/python3.7/site-packages/repo2data
Config from file :
/home/jovyan/binder/data_requirement.json
Destination:
./../data/nimare-paper

Info : ./../data/nimare-paper already downloaded
Data are located at ./../data/nimare-paper/data

We will also create a directory in which to save files that are generated within the book.

os.makedirs("../outputs/", exist_ok=True)
print(f"Files generated by the book will be saved to {os.path.abspath('../outputs/')}")
Files generated by the book will be saved to /home/jovyan/outputs