From 28bface31dc298258cbde2dc87fc03b7ffb493be Mon Sep 17 00:00:00 2001 From: Rui Coelho Date: Mon, 6 May 2024 19:16:20 +0100 Subject: [PATCH] Sanitise transformer keywords --- piglot/utils/responses.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/piglot/utils/responses.py b/piglot/utils/responses.py index 492fdb7..a8915ef 100644 --- a/piglot/utils/responses.py +++ b/piglot/utils/responses.py @@ -63,12 +63,12 @@ def read(config: Dict[str, Any]) -> Transformer: Transformer instance. """ return Transformer( - x_scale=config.get("x_scale", 1.0), - y_scale=config.get("y_scale", 1.0), - x_offset=config.get("x_offset", 0.0), - y_offset=config.get("y_offset", 0.0), - x_min=config.get("x_min", -np.inf), - x_max=config.get("x_max", np.inf), + x_scale=float(config.get("x_scale", 1.0)), + y_scale=float(config.get("y_scale", 1.0)), + x_offset=float(config.get("x_offset", 0.0)), + y_offset=float(config.get("y_offset", 0.0)), + x_min=float(config["x_min"]) if "x_min" in config else -np.inf, + x_max=float(config["x_max"]) if "x_max" in config else np.inf, )