hydraflow 0.11.1__py3-none-any.whl → 0.12.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ from dataclasses import dataclass, field
7
7
  class Step:
8
8
  batch: str = ""
9
9
  args: str = ""
10
- configs: str = ""
10
+ with_: str = ""
11
11
 
12
12
 
13
13
  @dataclass
@@ -15,7 +15,7 @@ class Job:
15
15
  name: str = ""
16
16
  run: str = ""
17
17
  call: str = ""
18
- configs: str = ""
18
+ with_: str = ""
19
19
  steps: list[Step] = field(default_factory=list)
20
20
 
21
21
 
hydraflow/executor/io.py CHANGED
@@ -5,7 +5,7 @@ from __future__ import annotations
5
5
  from pathlib import Path
6
6
  from typing import TYPE_CHECKING
7
7
 
8
- from omegaconf import OmegaConf
8
+ from omegaconf import DictConfig, ListConfig, OmegaConf
9
9
 
10
10
  from .conf import HydraflowConf
11
11
 
@@ -35,7 +35,26 @@ def load_config() -> HydraflowConf:
35
35
 
36
36
  cfg = OmegaConf.load(path)
37
37
 
38
- return OmegaConf.merge(schema, cfg) # type: ignore
38
+ if not isinstance(cfg, DictConfig):
39
+ return schema
40
+
41
+ rename_with(cfg)
42
+
43
+ return OmegaConf.merge(schema, cfg) # type: ignore[return-value]
44
+
45
+
46
+ def rename_with(cfg: DictConfig) -> None:
47
+ """Rename the `with` field to `with_`."""
48
+ if "with" in cfg:
49
+ cfg["with_"] = cfg.pop("with")
50
+
51
+ for key in list(cfg.keys()):
52
+ if isinstance(cfg[key], DictConfig):
53
+ rename_with(cfg[key])
54
+ elif isinstance(cfg[key], ListConfig):
55
+ for item in cfg[key]:
56
+ if isinstance(item, DictConfig):
57
+ rename_with(item)
39
58
 
40
59
 
41
60
  def get_job(name: str) -> Job:
hydraflow/executor/job.py CHANGED
@@ -69,10 +69,10 @@ def iter_batches(job: Job) -> Iterator[list[str]]:
69
69
 
70
70
  """
71
71
  job_name = f"hydra.job.name={job.name}"
72
- job_configs = shlex.split(job.configs)
72
+ job_configs = shlex.split(job.with_)
73
73
 
74
74
  for step in job.steps:
75
- configs = shlex.split(step.configs) or job_configs
75
+ configs = shlex.split(step.with_) or job_configs
76
76
 
77
77
  for args in iter_args(step.batch, step.args):
78
78
  sweep_dir = f"hydra.sweep.dir=multirun/{ulid.ULID()}"
@@ -389,7 +389,7 @@ def split_arg(arg: str) -> tuple[str, str, str]:
389
389
  key, value = arg.split("=")
390
390
 
391
391
  if "/" in key:
392
- key, suffix = key.split("/", 1)
392
+ key, suffix = key.split("/")
393
393
  return key, suffix, value
394
394
 
395
395
  return key, "", value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hydraflow
3
- Version: 0.11.1
3
+ Version: 0.12.0
4
4
  Summary: Hydraflow integrates Hydra and MLflow to manage and track machine learning experiments.
5
5
  Project-URL: Documentation, https://daizutabi.github.io/hydraflow/
6
6
  Project-URL: Source, https://github.com/daizutabi/hydraflow
@@ -13,12 +13,12 @@ hydraflow/entities/run_collection.py,sha256=E8IRBgxCnJE_IPCaSmS2mc9GtDXXLBfc7GHv
13
13
  hydraflow/entities/run_data.py,sha256=Y2_Lc-BdQ7nXhcEIjdHGHIkLrXsmAktOftESEwYOY8o,1602
14
14
  hydraflow/entities/run_info.py,sha256=FRC6ICOlzB2u_xi_33Qs-YZLt677UotuNbYqI7XSmHY,1017
15
15
  hydraflow/executor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- hydraflow/executor/conf.py,sha256=SJNiQ87MXMlpDfdm0POcv55MY3GS5FUh5wT7u3XU3oU,406
17
- hydraflow/executor/io.py,sha256=xV3m-nV9eKbu9Fb7u04J2bfmR_Ky3jTEJjq4QC2m6V4,954
18
- hydraflow/executor/job.py,sha256=yiVbAYgsZZtSTRER-H5pUopULeygzPNzKlSkl27yFI4,4856
19
- hydraflow/executor/parser.py,sha256=6oqMlAZWykukZWLpRuFUaXXqROxIyqSEacDtNOxBCjw,11894
20
- hydraflow-0.11.1.dist-info/METADATA,sha256=iPCvp7q_NK3wwRSfvE3HzxBUfJ5kQW9r9kAd3hdazGc,4549
21
- hydraflow-0.11.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
- hydraflow-0.11.1.dist-info/entry_points.txt,sha256=XI0khPbpCIUo9UPqkNEpgh-kqK3Jy8T7L2VCWOdkbSM,48
23
- hydraflow-0.11.1.dist-info/licenses/LICENSE,sha256=IGdDrBPqz1O0v_UwCW-NJlbX9Hy9b3uJ11t28y2srmY,1062
24
- hydraflow-0.11.1.dist-info/RECORD,,
16
+ hydraflow/executor/conf.py,sha256=2dv6_PlsynRmia-fGZlmBEVt8GopT0f32N13qY7tYnM,402
17
+ hydraflow/executor/io.py,sha256=yZMcBVmAbPZZ82cAXhgiJfj9p8WvHmzOCMBg_vtEVek,1509
18
+ hydraflow/executor/job.py,sha256=IL7ek0Vwa3Bl_gANq0wCbldNCUclo8YBckeEeO6W6xg,4852
19
+ hydraflow/executor/parser.py,sha256=llbv6BLPyO5UlExeRibkYI0vaxZbqS4q3uPZ1NnkIDM,11891
20
+ hydraflow-0.12.0.dist-info/METADATA,sha256=-CLwckmFxrCb9GEyhoz1ZaSaChVQU5_pQ0zkCCqfUMw,4549
21
+ hydraflow-0.12.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
+ hydraflow-0.12.0.dist-info/entry_points.txt,sha256=XI0khPbpCIUo9UPqkNEpgh-kqK3Jy8T7L2VCWOdkbSM,48
23
+ hydraflow-0.12.0.dist-info/licenses/LICENSE,sha256=IGdDrBPqz1O0v_UwCW-NJlbX9Hy9b3uJ11t28y2srmY,1062
24
+ hydraflow-0.12.0.dist-info/RECORD,,