-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
experiments: support
dvc repro --exp
command line params (#4331)
* experiments: support passing params values instead of reading from user's workspace * repro: add --params option for experiments * support toml params * update invalid param error message * update tests
- Loading branch information
Showing
6 changed files
with
131 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import toml | ||
|
||
from dvc.exceptions import TOMLFileCorruptedError | ||
|
||
|
||
def parse_toml_for_update(text, path): | ||
"""Parses text into Python structure. | ||
NOTE: Python toml package does not currently use ordered dicts, so | ||
keys may be re-ordered between load/dump, but this function will at | ||
least preserve comments. | ||
""" | ||
try: | ||
return toml.loads(text, decoder=toml.TomlPreserveCommentDecoder()) | ||
except toml.TomlDecodeError as exc: | ||
raise TOMLFileCorruptedError(path) from exc | ||
|
||
|
||
def dump_toml(path, data): | ||
with open(path, "w", encoding="utf-8") as fobj: | ||
toml.dump(data, fobj, encoder=toml.TomlPreserveCommentEncoder()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters