Commit af203439 authored by Yannick Roehlly's avatar Yannick Roehlly
Browse files

Remove unnecessary .keys()

parent 84d7e18c
......@@ -114,11 +114,9 @@ class AnalysisModule(object):
# of the parameter_list dictionary, we raises a KeyError. That means
# that a parameter is missing (and has no default value) or that an
# unexpected one was given.
if not set(parameters.keys()) == set(self.parameter_list.keys()):
missing_parameters = (set(self.parameter_list.keys())
- set(parameters.keys()))
unexpected_parameters = (set(parameters.keys())
- set(self.parameter_list.keys()))
if not set(parameters) == set(self.parameter_list):
missing_parameters = (set(self.parameter_list) - set(parameters))
unexpected_parameters = (set(parameters) - set(self.parameter_list))
message = ""
if missing_parameters:
message += ("Missing parameters: " +
......
......@@ -45,11 +45,9 @@ def complete_parameters(given_parameters, parameter_list):
given_parameters[key] = parameter_list[key][2]
# Check parameter consistency between the parameter list and the given
# parameters.
if not set(given_parameters.keys()) == set(parameter_list.keys()):
missing_parameters = (set(parameter_list.keys())
- set(given_parameters.keys()))
unexpected_parameters = (set(given_parameters.keys())
- set(parameter_list.keys()))
if not set(given_parameters) == set(parameter_list):
missing_parameters = (set(parameter_list) - set(given_parameters))
unexpected_parameters = (set(given_parameters) - set(parameter_list))
message = ""
if missing_parameters:
message += ("Missing parameters: " +
......@@ -64,7 +62,7 @@ def complete_parameters(given_parameters, parameter_list):
# We want the result to be ordered as the parameter_list of the module is.
result = OrderedDict()
for key in parameter_list.keys():
for key in parameter_list:
result[key] = given_parameters[key]
return result
......
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