Skip to content

Commit

Permalink
fix(batch): improve config handling
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jul 4, 2023
1 parent 6e84c4e commit ec03733
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hyfi/task/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ class BatchTaskConfig(TaskConfig):
_config_group_: str = "task"

batch_name: str = "demo"
batch: BatchConfig = None # type: ignore
batch: Optional[BatchConfig] = None

_property_set_methods_ = {
"task_name": "set_task_name",
"task_root": "set_task_root",
"batch_name": "set_batch_name",
"batch_num": "set_batch_num",
}
_subconfigs_ = {"batch": BatchConfig}

def set_batch_name(self, val):
if not self.batch_name or self.batch_name != val:
Expand Down Expand Up @@ -187,7 +188,8 @@ def load_config(
logger.info("Updating config with config_kwargs: %s", config_kwargs)
cfg = XC.update(XC.to_dict(cfg), config_kwargs)

# TODO: initialize self with the config
# initialize self with the config
self.__init__(**cfg)

return self.model_dump()

Expand Down

0 comments on commit ec03733

Please sign in to comment.