Commit 7279a05b authored by Niklas Selke's avatar Niklas Selke
Browse files

Made some changes to the 'check_statistics' function in 'input_checks.py'. It...

Made some changes to the 'check_statistics' function in 'input_checks.py'. It now returns a list of functions.
parent 96cf2b35
......@@ -38,16 +38,18 @@ def check_statistics(input_argument):
statistics = []
if isinstance(input_argument, str):
stat = input_argument.strip()
if hasattr(stats, stat) or hasattr(ozone_metrics, stat):
statistics.append(stat)
func = getattr(stats, stat, getattr(ozone_metrics, stat, None))
if func is not None:
statistics.append(func)
else:
for stat in input_argument:
if not isinstance(stat, str):
continue
stat = stat.strip()
if hasattr(stats, stat) or hasattr(ozone_metrics, stat):
statistics.append(stat)
if (not statistics or ("diurnal_cycle" in statistics
func = getattr(stats, stat, getattr(ozone_metrics, stat, None))
if func is not None and func not in statistics:
statistics.append(func)
if (not statistics or (stats.diurnal_cycle in statistics
and len(statistics) > 1)):
return None
return statistics
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment