Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Jun 2, 2017
1 parent 329f8c4 commit ec6dcae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
15 changes: 7 additions & 8 deletions Orange/widgets/visualize/owvenndiagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ def handleNewSignals(self):
self.samedomain = samedomain

has_identifiers = all(source_attributes(input.table.domain)
for input in self.data.values())
for input in self.data.values())
has_any_identifiers = any(source_attributes(input.table.domain)
for input in self.data.values())
for input in self.data.values())
self.useequalityButton.setEnabled(samedomain)
self.useidentifiersButton.setEnabled(
has_any_identifiers or len(self.data) == 0)
Expand Down Expand Up @@ -715,7 +715,7 @@ def table_concat(tables):

domain = Orange.data.Domain(attributes, class_vars, metas)

tables = list(map(lambda tab: tab.transform(domain), tables))
tables = [tab.transform(domain) for tab in tables]
return tables[0].concatenate(tables, axis=0)


Expand Down Expand Up @@ -785,7 +785,7 @@ def inst_key(inst, vars):
# each instance in this list belongs to one group (but not all
# groups need to be present).
inst_by_id = defaultdict(list)
id_by_inst = defaultdict(list) # inverse mapping
id_by_inst = defaultdict(list) # inverse mapping

for i in range(len(table)):
inst_id = instance_ids[i]
Expand Down Expand Up @@ -836,8 +836,8 @@ def expanded(feat):
if var in idvarlist or var in in_expanded:
continue
col, _ = newtable.get_column_view(var)
nan_indices = filter(lambda j: isinstance(col[j], str) or numpy.isnan(col[j]),
col.nonzero()[0])
nan_indices = (i for i in col.nonzero()[0]
if isinstance(col[i], str) or numpy.isnan(col[i]))
for i in nan_indices:
for ind in inst_by_id[ids[i]]:
if not numpy.isnan(table[ind, var]):
Expand Down Expand Up @@ -936,8 +936,7 @@ def string_attributes(domain):
"""
Return all string attributes from the domain.
"""
return [attr for attr in domain.variables + domain.metas
if attr.is_string]
return [attr for attr in domain.variables + domain.metas if attr.is_string]


def discrete_attributes(domain):
Expand Down
3 changes: 2 additions & 1 deletion Orange/widgets/visualize/tests/test_owvenndiagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def test_venn_diagram(self):
source_var, item_id_var)
temp_m = np.array([[cv[0, i], sources[i], table.metas[0 + i, 0]],
[cv[1, i], sources[i], table.metas[1 + i, 0]],
[cv[2, i], sources[i], table.metas[2 + i, 0]]], dtype=object)
[cv[2, i], sources[i], table.metas[2 + i, 0]]],
dtype=object)
temp_table = self.add_metas(temp_table, temp_d, temp_m)
tables.append(temp_table)

Expand Down

0 comments on commit ec6dcae

Please sign in to comment.