11"""
2- Stores module level information like the API key, cache director, private
3- directory and the server.
2+ Stores module level information like the API key, cache directory and the server.
43"""
54import os
65import sys
1110 format = '[%(levelname)s] [%(asctime)s:%(name)s] %('
1211 'message)s' , datefmt = '%H:%M:%S' )
1312
14- server = "http ://www.openml.org/api/v1/xml"
13+ server = "https ://www.openml.org/api/v1/xml"
1514apikey = ""
1615cachedir = ""
17- privatedir = ""
1816
1917
2018if sys .version_info [0 ] < 3 :
@@ -47,57 +45,35 @@ def _setup():
4745 config = _parse_config ()
4846 apikey = config .get ('FAKE_SECTION' , 'apikey' )
4947 server = config .get ('FAKE_SECTION' , 'server' )
50- private_dir = config .get ('FAKE_SECTION' , 'private_directory' )
5148 cache_dir = config .get ('FAKE_SECTION' , 'cachedir' )
52- set_cache_directory (cache_dir , private_dir )
49+ set_cache_directory (cache_dir )
5350
5451
55- def set_cache_directory (cachedir , privatedir = None ):
52+ def set_cache_directory (cachedir ):
5653 """Set module-wide cache directory.
5754
5855 Sets the cache directory into which to download datasets, tasks etc.
59- Also sets the private directory for storing local datasets.
6056
6157 Parameters
6258 ----------
6359 cachedir : string
6460 Path to use as cache directory.
6561
66- privatedir : string
67- Path containing private datasets, tasks, etc.
68-
6962 See also
7063 --------
7164 get_cache_directory
72- get_private_directory
7365 """
74- if privatedir is None :
75- privatedir = cachedir
7666
7767 global _cachedir
78- global _privatedir
7968 _cachedir = cachedir
80- _privatedir = privatedir
8169
8270 # Set up the cache directories
8371 dataset_cache_dir = os .path .join (cachedir , "datasets" )
8472 task_cache_dir = os .path .join (cachedir , "tasks" )
8573 run_cache_dir = os .path .join (cachedir , 'runs' )
8674
87- # Set up the private directory
88- _private_directory_datasets = os .path .join (
89- privatedir , "datasets" )
90- _private_directory_tasks = os .path .join (
91- privatedir , "tasks" )
92- _private_directory_runs = os .path .join (
93- privatedir , "runs" )
94-
95- for dir_ in [cachedir , dataset_cache_dir ,
96- task_cache_dir , run_cache_dir ,
97- privatedir ,
98- _private_directory_datasets ,
99- _private_directory_tasks ,
100- _private_directory_runs ]:
75+
76+ for dir_ in [cachedir , dataset_cache_dir , task_cache_dir , run_cache_dir ]:
10177 if not os .path .exists (dir_ ) and not os .path .isdir (dir_ ):
10278 os .mkdir (dir_ )
10379
@@ -108,8 +84,7 @@ def _parse_config():
10884 defaults = {'apikey' : apikey ,
10985 'server' : server ,
11086 'verbosity' : 0 ,
111- 'cachedir' : os .path .expanduser ('~/.openml/cache' ),
112- 'private_directory' : os .path .expanduser ('~/.openml/private' )}
87+ 'cachedir' : os .path .expanduser ('~/.openml/cache' )}
11388
11489 config_file = os .path .expanduser ('~/.openml/config' )
11590 config = configparser .RawConfigParser (defaults = defaults )
@@ -147,26 +122,10 @@ def get_cache_directory():
147122 See also
148123 --------
149124 set_cache_directory
150- get_private_directory
151125 """
152126 return _cachedir
153127
154128
155- def get_private_directory ():
156- """Get the current private directory.
157-
158- Returns
159- -------
160- privatecir : string
161- The current private directory.
162-
163- See also
164- --------
165- set_cache_directory
166- get_cache_directory
167- """
168- return _privatedir
169-
170- __all__ = ["set_cache_directory" , 'get_cache_directory' , 'get_private_directory' ]
129+ __all__ = ["set_cache_directory" , 'get_cache_directory' ]
171130
172131_setup ()
0 commit comments