From 756c096f56b87b00bcf4a9a727c6d8b8df1e14cb Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 8 Jul 2023 12:52:59 +0200 Subject: [PATCH] Inform user about unconsumed config --- slate/slate.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/slate/slate.py b/slate/slate.py index 5ee69a4..3d10a8a 100644 --- a/slate/slate.py +++ b/slate/slate.py @@ -223,7 +223,12 @@ class Slate(): ) as run: runner(self, run, config) - assert not REQUIRE_CONFIG_CONSUMED or config == {}, ('Config was not completely consumed: ', config) + if config != {}: + msg = ('Config was not completely consumed: ', config) + if REQUIRE_CONFIG_CONSUMED: + raise Exception(msg) + else: + print(msg) orig_config = config def _run_from_sweep(self, orig_config, p_ind): @@ -240,7 +245,12 @@ class Slate(): self.deep_update(config, wandb.config) runner(self, run, config) - assert config == {}, ('Config was not completely consumed: ', config) + if config != {}: + msg = ('Config was not completely consumed: ', config) + if REQUIRE_CONFIG_CONSUMED: + raise Exception(msg) + else: + print(msg) orig_config = config def from_args(self):