Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tabular dataset kwargs #5

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tableshift/core/getters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import copy
import logging
from typing import Optional, Dict, Any, Union

Expand Down Expand Up @@ -40,7 +41,7 @@ def get_dataset(name: str, cache_dir: str = "tmp",

expt_config = EXPERIMENT_CONFIGS[name]
dataset_config = DatasetConfig(cache_dir=cache_dir)
tabular_dataset_kwargs = expt_config.tabular_dataset_kwargs
tabular_dataset_kwargs = copy.copy(expt_config.tabular_dataset_kwargs)
if "name" not in tabular_dataset_kwargs:
tabular_dataset_kwargs["name"] = name

Expand Down Expand Up @@ -109,7 +110,7 @@ def get_iid_dataset(name: str, cache_dir: str = "tmp",
expt_config = EXPERIMENT_CONFIGS[name]
dataset_config = DatasetConfig(cache_dir=cache_dir)

_tabular_dataset_kwargs = expt_config.tabular_dataset_kwargs
_tabular_dataset_kwargs = copy.copy(expt_config.tabular_dataset_kwargs)
if tabular_dataset_kwargs:
_tabular_dataset_kwargs.update(tabular_dataset_kwargs)
if "name" not in _tabular_dataset_kwargs:
Expand Down