11"""Functions and utilities for downloading example data for fooof."""
22
33import os
4+ from pathlib import Path
45from urllib .request import urlretrieve
56
67import numpy as np
78
9+ from fooof .core .io import fpath
10+
811###################################################################################################
912###################################################################################################
1013
@@ -15,7 +18,7 @@ def check_data_folder(folder):
1518
1619 Parameters
1720 ----------
18- folder : str
21+ folder : Path or str
1922 Name of the folder to check and create if missing.
2023 """
2124
@@ -30,11 +33,13 @@ def check_data_file(filename, folder, url=DATA_URL):
3033 ----------
3134 filename : str
3235 Name of the data file to check and download if missing.
33- folder : str
36+ folder : Path or str
3437 Name of the folder to save the datafile to.
38+ url : str, optional
39+ The URL to download the data file from.
3540 """
3641
37- filepath = os . path . join (folder , filename )
42+ filepath = fpath (folder , filename )
3843
3944 if not os .path .isfile (filepath ):
4045 urlretrieve (url + filename , filename = filepath )
@@ -47,7 +52,7 @@ def fetch_fooof_data(filename, folder='data', url=DATA_URL):
4752 ----------
4853 filename : str
4954 Name of the data file to download.
50- folder : str, optional
55+ folder : Path or str, optional
5156 Name of the folder to save the datafile to.
5257 url : str, optional
5358 The URL to download the data file from.
@@ -69,7 +74,7 @@ def load_fooof_data(filename, folder='data', url=DATA_URL):
6974 ----------
7075 filename : str
7176 Name of the data file to download.
72- folder : str, optional
77+ folder : Path or str, optional
7378 Name of the folder to save the datafile to.
7479 url : str, optional
7580 The URL to download the data file from.
0 commit comments