Skip to content
Snippets Groups Projects
Commit 47850c2f authored by leufen1's avatar leufen1
Browse files

remove does not work properly still

parent 5233f61b
No related branches found
No related tags found
9 merge requests!353add developments to release v1.5.0,!352Resolve "release v1.5.0",!351Lukas issue337 bug ci pipeline fails for docs,!350Resolve "upgrade code to TensorFlow V2",!343Update wrf with develop,!342Include sample-uncertainty to wrf workflow,!340Lukas issue332 feat report error metrics for all competitors,!336Resolve "report error metrics for all competitors",!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #80732 passed
......@@ -81,8 +81,10 @@ def remove_items(obj: Union[List, Dict, Tuple], items: Any):
def remove_from_list(list_obj, item_list):
"""Remove implementation for lists."""
if len(items) > 1:
if len(item_list) > 1:
return [e for e in list_obj if e not in item_list]
elif len(item_list) == 0:
return list_obj
else:
list_obj = list_obj.copy()
try:
......@@ -96,8 +98,6 @@ def remove_items(obj: Union[List, Dict, Tuple], items: Any):
return {k: v for k, v in dict_obj.items() if k not in key_list}
items = to_list(items)
if len(items) == 0:
return obj
if isinstance(obj, list):
return remove_from_list(obj, items)
elif isinstance(obj, dict):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment