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

Implement __eq__ and __hash__ for PCA (and family) #6627

Merged
merged 4 commits into from
Nov 10, 2023

Conversation

markotoplak
Copy link
Member

@markotoplak markotoplak commented Nov 7, 2023

Issue

There are too many warnings when using PCA.

Having worked with this code, I saw that just about everything is wrong with this class hierarchy - it is much too circular. These classes need to be rewritten - at first I though I won't even be able to implement __eq__ and __hash__, but then I somehow remembered the trick in the second commit.

I also added a tiny test. I could theoretically test all classes in the chain separately by initializing them manually and call corresponding functions, but am not sure that would make sense. Do I have to?

Includes
  • Code changes
  • Tests
  • Documentation

@markotoplak markotoplak force-pushed the pca-eq-2 branch 2 times, most recently from 5b41873 to 528b0e3 Compare November 7, 2023 16:24
@janezd
Copy link
Contributor

janezd commented Nov 7, 2023

"(...) for PCA", and for other classes derived from Projection, one of which is Linear Projection.

Thank you! I disabled these warnings just to be able to normally work on #6614!

@markotoplak markotoplak changed the title Implement __eq__ and __hash__ for PCA Implement __eq__ and __hash__ for PCA and family Nov 9, 2023
@markotoplak markotoplak changed the title Implement __eq__ and __hash__ for PCA and family Implement __eq__ and __hash__ for PCA (and family) Nov 9, 2023
@markotoplak markotoplak marked this pull request as ready for review November 9, 2023 21:19
@markotoplak
Copy link
Member Author

@janezd, I did what I could to make warnings go away. It is not pretty (see the second commit), but for a straightforward implementations the whole Orange.projection would need refactoring. I decided first to solve the immediate issue (warnings) and leave refactoring for some other time - who know when that would finish.

@janezd janezd self-assigned this Nov 10, 2023
@janezd janezd merged commit df20f2e into biolab:master Nov 10, 2023
@markotoplak markotoplak deleted the pca-eq-2 branch July 4, 2024 14:16
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.

2 participants