Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Resolve deprecations #63

Merged
merged 5 commits into from
Aug 7, 2023
Merged

Conversation

PrimozGodec
Copy link
Collaborator

@PrimozGodec PrimozGodec commented Jul 26, 2023

In the addon, there are some calls to deprecated functions.

This PR resolve deprecated calls/classes.
It also increases the minimum versions of Orange packages because of ListViewFilter and get_column.

@PrimozGodec PrimozGodec force-pushed the fix-deprecations branch 2 times, most recently from 03e8653 to c2591f3 Compare July 26, 2023 11:18
@codecov-commenter
Copy link

codecov-commenter commented Jul 26, 2023

Codecov Report

Patch coverage: 87.50% and no project coverage change.

Comparison is base (4ae18ab) 93.47% compared to head (497000e) 93.47%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #63   +/-   ##
=======================================
  Coverage   93.47%   93.47%           
=======================================
  Files          16       16           
  Lines        5030     5030           
=======================================
  Hits         4702     4702           
  Misses        328      328           
Files Changed Coverage Δ
orangecontrib/explain/tests/test_explainer.py 99.45% <ø> (ø)
orangecontrib/explain/widgets/owice.py 83.90% <60.00%> (-0.06%) ⬇️
orangecontrib/explain/explainer.py 100.00% <100.00%> (ø)
...ngecontrib/explain/widgets/owexplainfeaturebase.py 97.97% <100.00%> (+<0.01%) ⬆️
orangecontrib/explain/widgets/owexplainmodel.py 92.78% <100.00%> (ø)
...ngecontrib/explain/widgets/owexplainpredictions.py 78.25% <100.00%> (+0.03%) ⬆️
...contrib/explain/widgets/owpermutationimportance.py 90.94% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

self.send_signal(self.widget.Inputs.model, self.rf_cls)
self.wait_until_finished()
self.assertTrue(self.widget.Error.domain_transform_err.is_shown())
with patch(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot make a case where DomainTransformationError is raised. When a new domain doesn't have attributes from the model, the list view is empty, resulting in an empty feature variable and the process finishing with None (before domain transformation).

I hope I didn't miss any cases. I would anyway leave domain_transform_err, so I added a test with a patch for it.

@@ -39,15 +40,19 @@ def test_input_cls(self):

self.send_signal(self.widget.Inputs.model, self.rf_reg)
self.wait_until_finished()
self.assertTrue(self.widget.Error.unknown_err.is_shown())
# no error since no attributes in view and those no future is selected
self.assertFalse(self.widget.Error.unknown_err.is_shown())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model and data domain are different, which results in no attributes in the list view and those no feature is selected. ICE shows an empty graph without error.

self.feature = selection.indexes()[0].data(gui.TableVariable)
self._apply_feature_sorting()
def __on_feature_changed(self):
selection = self._features_view.selectionModel().selectedIndexes()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes while filtering, __on_feature_changed is called two times. First with a selection change and second without change (both selected and deselected parameters are empty). Since it is safer, use self._features_view.selectionModel().selectedIndexes().

@VesnaT VesnaT merged commit 9da17ff into biolab:master Aug 7, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants