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

Adapt util.unique tests for numpy 1.21 #5508

Merged
merged 1 commit into from Jun 29, 2021

Conversation

markotoplak
Copy link
Member

Issue

Tests on numpy 1.21 fail. numpy.unique changed behaviour in 1.21. Since 1.21 it treats all NaNs as the same value; before, it outputted as many NaNs as there were in the input array. The corresponding numpy issue: numpy/numpy#2111

Description of changes

Orange's util.unique function is a thin wrapper around numpy.unique. Because TestUnique used a test array with 2 NaNs the results were different depending on the version. Now they use a single NaN value.

Includes
  • Code changes
  • Tests
  • Documentation

numpy.unique changed behaviour in 1.21. Since 1.21 it treats all NaNs as
the same value; before, it outputted as many NaNs as there were in the
input array.

Orange's util.unique functions is a thin wrapper around around numpy.unique.
Because TestUnique used a test  array with 2 NaNs the results were
different depending on the version. Now they use a single NaN value.
@codecov
Copy link

codecov bot commented Jun 29, 2021

Codecov Report

Merging #5508 (2d0061f) into master (d37138e) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #5508      +/-   ##
==========================================
- Coverage   86.36%   86.36%   -0.01%     
==========================================
  Files         304      304              
  Lines       61665    61665              
==========================================
- Hits        53255    53254       -1     
- Misses       8410     8411       +1     

@janezd janezd merged commit ca9c301 into biolab:master Jun 29, 2021
@markotoplak markotoplak deleted the fix-tests-numpy-1.21-unique branch November 25, 2021 15:38
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.

None yet

2 participants