mirror of
https://github.com/clearml/clearml
synced 2025-02-12 07:35:08 +00:00
Fix argparser logging always captures defaults (Windows only, ignored cmd)
This commit is contained in:
parent
5a76ffd460
commit
e9f8fc949d
@ -548,5 +548,5 @@ class _Arguments(object):
|
|||||||
if str(hex(id(arg))) in str(arg):
|
if str(hex(id(arg))) in str(arg):
|
||||||
return str(type(arg))
|
return str(type(arg))
|
||||||
if dtype in (float, int) and isinstance(arg, list):
|
if dtype in (float, int) and isinstance(arg, list):
|
||||||
return [dtype(a) for a in arg]
|
return [None if a is None else dtype(a) for a in arg]
|
||||||
return arg
|
return arg
|
||||||
|
@ -144,9 +144,10 @@ class PatchArgumentParser:
|
|||||||
parsed_args_namespace = copy(parsed_args[0])
|
parsed_args_namespace = copy(parsed_args[0])
|
||||||
parsed_args = (parsed_args_namespace, parsed_args[1])
|
parsed_args = (parsed_args_namespace, parsed_args[1])
|
||||||
else:
|
else:
|
||||||
parsed_args = parsed_args_namespace = copy(parsed_args)
|
parsed_args_namespace = copy(parsed_args)
|
||||||
|
parsed_args = (parsed_args_namespace, [])
|
||||||
|
|
||||||
# cast arguments in parsed_args_namespace entries to str
|
# cast arguments in parsed_args_namespace entries to str
|
||||||
if parsed_args_namespace and isinstance(parsed_args_namespace, Namespace):
|
if parsed_args_namespace and isinstance(parsed_args_namespace, Namespace):
|
||||||
for k, v in parser._parsed_arg_string_lookup.items(): # noqa
|
for k, v in parser._parsed_arg_string_lookup.items(): # noqa
|
||||||
if hasattr(parsed_args_namespace, k):
|
if hasattr(parsed_args_namespace, k):
|
||||||
@ -157,7 +158,8 @@ class PatchArgumentParser:
|
|||||||
v if isinstance(v, list) else str(v)
|
v if isinstance(v, list) else str(v)
|
||||||
)
|
)
|
||||||
|
|
||||||
PatchArgumentParser._last_parsed_args = (PatchArgumentParser._last_parsed_args or []) + [parsed_args]
|
if not PatchArgumentParser._last_parsed_args or parsed_args not in PatchArgumentParser._last_parsed_args:
|
||||||
|
PatchArgumentParser._last_parsed_args = (PatchArgumentParser._last_parsed_args or []) + [parsed_args]
|
||||||
return parsed_args
|
return parsed_args
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user