From dfc888a1ee09e377c015cef0dac9652d97f9c698 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 30 Sep 2021 14:02:19 +0200 Subject: observations_to_by_name: None values are illegal --- lib/utils.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/utils.py') diff --git a/lib/utils.py b/lib/utils.py index 2c879c0..b904974 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -227,6 +227,10 @@ def observations_to_by_name(observations: list, attributes: list): param_dict_to_list(observation["param"], parameter_names) ) for attribute in attributes: + if observation[attribute] is None: + raise ValueError( + f"""Attribute "{attribute}" of observation "{name}" is None. This is not allowed. Parameters = {observation["param"]}""" + ) by_name[name][attribute].append(observation[attribute]) for name in by_name: for attribute in attributes: -- cgit v1.2.3