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] OWDataProjectionWidget: check validity, fix sparse data reloading #3485

Merged
merged 4 commits into from
Jan 4, 2019

Conversation

VesnaT
Copy link
Contributor

@VesnaT VesnaT commented Dec 18, 2018

Issue
  1. Fixes ValueError: zero-size array to reduction operation minimum which has no identity #3484
  2. The widget crashes when reloading sparse data, because sparse matrices equality can not be checked with numpy
Description of changes
  1. return no coordinates when no valid data (return None instead of an empty array)
  2. fix reloading sparse data
Includes
  • Code changes
  • Tests
  • Documentation

@VesnaT VesnaT changed the title OWDataProjectionWidget: Return no coordinates when no valid data [FIX] OWDataProjectionWidget: Return no coordinates when no valid data Dec 20, 2018
@VesnaT VesnaT changed the title [FIX] OWDataProjectionWidget: Return no coordinates when no valid data [WIP][FIX] OWDataProjectionWidget: Return no coordinates when no valid data Dec 20, 2018
@codecov
Copy link

codecov bot commented Dec 20, 2018

Codecov Report

Merging #3485 into master will increase coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3485      +/-   ##
==========================================
+ Coverage   83.55%   83.57%   +0.02%     
==========================================
  Files         367      367              
  Lines       65454    65470      +16     
==========================================
+ Hits        54691    54718      +27     
+ Misses      10763    10752      -11

@codecov
Copy link

codecov bot commented Dec 20, 2018

Codecov Report

Merging #3485 into master will increase coverage by 0.03%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3485      +/-   ##
==========================================
+ Coverage   83.55%   83.59%   +0.03%     
==========================================
  Files         368      368              
  Lines       65772    65807      +35     
==========================================
+ Hits        54956    55009      +53     
+ Misses      10816    10798      -18

@VesnaT VesnaT changed the title [WIP][FIX] OWDataProjectionWidget: Return no coordinates when no valid data [FIX] OWDataProjectionWidget: Fixups Dec 20, 2018
Orange/data/util.py Outdated Show resolved Hide resolved
v2.sort(axis=0)
return np.allclose(v1, v2, equal_nan=True)


Copy link
Contributor

Choose a reason for hiding this comment

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

@VesnaT, if you agree with this, I agree with the rest (which I do anyway) and one of us can merge this.

@markotoplak markotoplak self-assigned this Jan 4, 2019

v1 = np.vstack(sp.find(a1)).T
v2 = np.vstack(sp.find(a2)).T
if not (sp.issparse(a1) and sp.issparse(a2)): # Any dense: order indices
Copy link
Member

Choose a reason for hiding this comment

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

So, sp.find internally sorts if the matrices have has_canonical_format=False, which is False when converting from any sparse matrix. Therefore, sparse matrices currently do not have to be resorted, so your optimization works well. Should we rely on such undocumented behavior, @janezd?

@markotoplak markotoplak changed the title [FIX] OWDataProjectionWidget: Fixups [FIX] OWDataProjectionWidget: check validity, fix sparse data reloading Jan 4, 2019
@markotoplak markotoplak merged commit 4a7ecc8 into biolab:master Jan 4, 2019
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.

ValueError: zero-size array to reduction operation minimum which has no identity
4 participants