Skip to content

Commit

Permalink
Parameter Fitter: Report
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Oct 23, 2024
1 parent 566bc51 commit a8f1806
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Orange/widgets/evaluate/owparameterfitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,17 @@ def onDeleteWidget(self):
self.shutdown()
super().onDeleteWidget()

def send_report(self):
if self._data is None or self._learner is None \
or not self._learner.fitted_parameters():
return
parameter = self.fitted_parameters[self.parameter_index].label
self.report_items("Settings",
[("Parameter", parameter),
("Range", self.preview)])
self.report_name("Plot")
self.report_plot()

def set_visual_settings(self, key: KeyType, value: ValueType):
self.graph.parameter_setter.set_parameter(key, value)
# pylint: disable=unsupported-assignment-operation
Expand Down
12 changes: 11 additions & 1 deletion Orange/widgets/evaluate/tests/test_owparameterfitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,17 @@ def assertFontEqual(self, font1: QFont, font2: QFont):
self.assertEqual(font1.italic(), font2.italic())

def test_send_report(self):
self.assertEqual(1, 2)
self.widget.send_report()

self.send_signal(self.widget.Inputs.data, self._housing)
self.send_signal(self.widget.Inputs.learner, self._pls)
self.wait_until_finished()
self.widget.send_report()

self.send_signal(self.widget.Inputs.data, self._heart)
self.send_signal(self.widget.Inputs.learner, self._naive_bayes)
self.wait_until_finished()
self.widget.send_report()


if __name__ == "__main__":
Expand Down

0 comments on commit a8f1806

Please sign in to comment.