Skip to content
Snippets Groups Projects
Commit 14bd3092 authored by Florian Obersteiner's avatar Florian Obersteiner
Browse files

any and all built-ins take generator expression

parent 41e1c58f
Branches
Tags
1 merge request!6code refactor
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
......@@ -163,7 +163,7 @@ class DataStore2110(collections.UserDict):
ivarvalue = vmiss_to_npnan(kwargs[self.ivarname], self.missvals[self.ivarname])
# this is an AUX line
if any([x in self.auxvarnames for x in kwargs.keys()]): # TODO: any (all as well) do not require a comprehension; pure generator expression works fine
if any(x in self.auxvarnames for x in kwargs.keys()):
# and we create the whole dataset if needed
if not ivarvalue in self.data.keys():
self.data[ivarvalue] = {
......@@ -173,7 +173,7 @@ class DataStore2110(collections.UserDict):
self.data[ivarvalue]["AUX"].add(**kwargs)
# this is a DEP line
if any([x in self.dvarnames for x in kwargs.keys()]): # TODO: see above: remove [ ]
if any(x in self.dvarnames for x in kwargs.keys()):
if not self.ibvarname in kwargs.keys():
raise Exception("Need independent (bounded) variable data.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment