Skip to content

Commit d2d3682

Browse files
authored
Switch to ~/.cache for storing repo artifacts (#102)
1 parent 2016166 commit d2d3682

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

tabrepo/contexts/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,12 @@ def construct_context(
573573
BenchmarkContext object that is able to load the data.
574574
"""
575575
if local_prefix_is_relative:
576-
path_context = str(Paths.results_root / local_prefix) + os.sep
576+
path_context = str(Paths.results_root_cache / local_prefix) + os.sep
577577
else:
578578
path_context = str(Path(local_prefix)) + os.sep
579579

580580
if local_prefix_is_relative:
581-
data_root = Paths.data_root
581+
data_root = Paths.data_root_cache
582582
else:
583583
data_root = Path(path_context).parent
584584

tabrepo/loaders/__init__.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@
1010
class Paths:
1111
project_root: Path = Path(__file__).parent.parent.parent
1212
data_root: Path = project_root / 'data'
13-
results_root: Path = data_root / 'results'
14-
all_v3_results_root: Path = results_root / "all_v3"
15-
bagged_results_root: Path = results_root / "bagged"
16-
bagged_208_results_root: Path = results_root / "bagged_208"
17-
bagged_289_results_root: Path = results_root / "bagged_289"
18-
bagged_2023_07_25_results_root: Path = results_root / "2023_07_25"
19-
automl_289_results_root: Path = results_root / "automl_289"
13+
data_root_cache: Path = Path.home() / ".cache" / "tabrepo" / "data"
14+
results_root_cache: Path = data_root_cache / "results"
2015

2116
@staticmethod
2217
def abs_to_rel(path: str, relative_to: Path = project_root) -> str:

tabrepo/repository/evaluation_repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ def _construct_config_scorer(self,
186186
raise ValueError(f'Invalid config_scorer_type: {config_scorer_type}')
187187

188188
@classmethod
189-
def from_context(cls, version: str = None, cache: bool = False, prediction_format: str = "memmap") -> Self:
190-
return load_repository(version=version, cache=cache, prediction_format=prediction_format)
189+
def from_context(cls, version: str = None, cache: bool = False, load_predictions: bool = True, prediction_format: str = "memmap", use_s3: bool = True) -> Self:
190+
return load_repository(version=version, cache=cache, load_predictions=load_predictions, prediction_format=prediction_format, use_s3=use_s3)
191191

192192
# TODO: 1. Cleanup results_lst_simulation_artifacts, 2. Make context work with tasks instead of datasets x folds
193193
# TODO: Get raw data from repo method (X, y)

tabrepo/utils/result_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from pathlib import Path
2-
import tabrepo
32
from autogluon.common.loaders import load_pd
43
from autogluon.common.savers import save_pd
4+
from tabrepo.loaders import Paths
55

6-
def results_path():
7-
res = Path(tabrepo.__path__[0]).parent / "data/results/"
6+
7+
def results_path() -> Path:
8+
res = Paths.results_root_cache
89
if not res.exists():
910
res.mkdir(parents=True, exist_ok=True)
1011
return res

0 commit comments

Comments
 (0)