Print deprecation warnings to stderr
@@ -4,6 +4,7 @@ import datetime
import os
import time
import uuid
+import sys
from enum import Enum
import yaml
@@ -536,7 +537,10 @@ def _process_deprecated_options(options: Dict[str, Any]):
def rename_key(old_key, new_key):
if old_key in options:
print(
- "Warning: key {} is deprecated; use {} instead".format(old_key, new_key)
+ "Warning: key {} is deprecated; use {} instead".format(
+ old_key, new_key
+ ),
+ file=sys.stderr,
)
if new_key in options:
raise ValueError(
@@ -554,7 +558,8 @@ def _process_deprecated_options(options: Dict[str, Any]):
print(
"Warning: {}={} is deprecated; use {} instead".format(
key, old_value, new_value
- )
+ ),
+ file=sys.stderr,
)
options[key] = new_value
return True
@@ -588,7 +593,7 @@ def _process_deprecated_options(options: Dict[str, Any]):
for key in rename_value_re(r".*\.regularize$", f"l{p}", "lp"):
new_key = re.sub(r"\.regularize$", ".regularize_args.p", key)
options[new_key] = p
- print(f"Set {new_key}={p}.")
+ print(f"Set {new_key}={p}.", file=sys.stderr)
# 21.10.2019
rename_key("negative_sampling.score_func_type", "negative_sampling.implementation")
