Skip to content

Commit ee38d09

Browse files
allow passing logical axis rules in cli
1 parent d5b6da3 commit ee38d09

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/maxdiffusion/pyconfig.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
# pylint: disable=missing-module-docstring
1818
import os
19+
import ast
1920
import json
2021
import sys
2122
from collections import OrderedDict
@@ -35,8 +36,10 @@ def string_to_bool(s: str) -> bool:
3536
return False
3637
raise ValueError(f"Can't convert {s} to bool")
3738

39+
def string_to_list(string_list: str) -> list:
40+
return ast.literal_eval(string_list)
3841

39-
_yaml_types_to_parser = {str: str, int: int, float: float, bool: string_to_bool}
42+
_yaml_types_to_parser = {str: str, int: int, float: float, bool: string_to_bool, list: string_to_list}
4043

4144
_config = None
4245
config = None

0 commit comments

Comments
 (0)