Skip to content

Commit

Permalink
Merge pull request #113 from robertcv/fix/uniqu_vars
Browse files Browse the repository at this point in the history
Fix duplicate variable names
  • Loading branch information
AndrejaKovacic authored Jul 8, 2020
2 parents bb31b17 + 71b2b29 commit c54a6a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion orangecontrib/geo/widgets/owchoropleth.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,10 @@ def effective_variables(self):

@property
def effective_data(self):
return self.data.transform(Domain(self.effective_variables))
eff_var = self.effective_variables
if eff_var and self.attr_lat.name == self.attr_lon.name:
eff_var = [self.attr_lat]
return self.data.transform(Domain(eff_var))

# Input
@Inputs.data
Expand Down
9 changes: 8 additions & 1 deletion orangecontrib/geo/widgets/owmap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from AnyQt.QtCore import Qt
from Orange.data import Table, ContinuousVariable
from Orange.data import Table, Domain, ContinuousVariable
from Orange.widgets import gui, settings
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.utils.itemmodels import DomainModel
Expand Down Expand Up @@ -228,6 +228,13 @@ def effective_variables(self):
return [self.attr_lat, self.attr_lon] \
if self.attr_lat and self.attr_lon else []

@property
def effective_data(self):
eff_var = self.effective_variables
if eff_var and self.attr_lat.name == self.attr_lon.name:
eff_var = [self.attr_lat]
return self.data.transform(Domain(eff_var))

def showEvent(self, ev):
super().showEvent(ev)
# reset the map on show event since before that we didn't know the
Expand Down

0 comments on commit c54a6a8

Please sign in to comment.