Skip to content

Commit

Permalink
Merge pull request #1796 from ales-erjavec/fixes/confusionmatrix-migr…
Browse files Browse the repository at this point in the history
…ate-settings

[FIX] owconfusionmatix: Add migrate_settings
  • Loading branch information
janezd authored Dec 2, 2016
2 parents 11c3f11 + 14b9a0f commit a107be4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Orange/widgets/evaluate/owconfusionmatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class OWConfusionMatrix(widget.OWWidget):
"Proportion of predicted",
"Proportion of actual"]

settings_version = 1
settingsHandler = settings.ClassValuesContextHandler()

selected_learner = settings.Setting([0], schema_only=True)
Expand Down Expand Up @@ -483,6 +484,19 @@ def send_report(self):
self.quantities[self.selected_quantity].lower()),
self.tableview)

@classmethod
def migrate_settings(cls, settings, version):
super().migrate_settings(settings, version)
if not version:
# For some period of time the 'selected_learner' property was
# changed from List[int] -> int
# (commit 4e49bb3fd0e11262f3ebf4b1116a91a4b49cc982) and then back
# again (commit 8a492d79a2e17154a0881e24a05843406c8892c0)
if "selected_learner" in settings and \
isinstance(settings["selected_learner"], int):
settings["selected_learner"] = [settings["selected_learner"]]


if __name__ == "__main__":
from AnyQt.QtWidgets import QApplication

Expand Down

0 comments on commit a107be4

Please sign in to comment.