Skip to content

[FIX] Variable: Fix cases when equal variables had different hashes#4843

Merged
lanzagar merged 1 commit intobiolab:masterfrom
janezd:variable-fix-hash
Jun 9, 2020
Merged

[FIX] Variable: Fix cases when equal variables had different hashes#4843
lanzagar merged 1 commit intobiolab:masterfrom
janezd:variable-fix-hash

Conversation

@janezd
Copy link
Contributor

@janezd janezd commented Jun 5, 2020

Issue

May fix #4766 (comment) from #4766.

Description of changes

__hash__ did not follow the same logic as __eq__. __eq__ backtracked through identities while __hash__ (kind of) made a single step.

I replaced the recursion in __eq__ with a loop. I believe the new version to be equivalent to the old one. The old one exited earlier if compute_value's matched, but with the same result as the new one.

__hash__ then uses the same pieces of data as __eq__.

Includes
  • Code changes
  • Tests

@codecov
Copy link

codecov bot commented Jun 5, 2020

Codecov Report

Merging #4843 into master will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4843      +/-   ##
==========================================
- Coverage   84.12%   84.10%   -0.03%     
==========================================
  Files         282      277       -5     
  Lines       57327    56498     -829     
==========================================
- Hits        48229    47520     -709     
+ Misses       9098     8978     -120     

@lanzagar lanzagar merged commit 6061f2d into biolab:master Jun 9, 2020
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.

Heatmap colour annotation not updating

3 participants