Skip to content

[FIX] Various fixes of box plot#4231

Merged
lanzagar merged 2 commits intobiolab:masterfrom
PrimozGodec:fix-box-plot
Nov 29, 2019
Merged

[FIX] Various fixes of box plot#4231
lanzagar merged 2 commits intobiolab:masterfrom
PrimozGodec:fix-box-plot

Conversation

@PrimozGodec
Copy link
Contributor

@PrimozGodec PrimozGodec commented Nov 28, 2019

Issue

While working on some data I found few bugs in the Box Plot widget. Some issues were produced by #4135 some are old.

  • Widget failed with index error since one of the arrays unexpectedly changed the shape when subgroup had just missing values
  • Contingency is not correctly computed when row_variable is sparse
  • Axis does not stretch correctly when many missing values
  • Missing values not plotted when a subgroup is not selected
  • Continuous variable raises an error in some cases when the group variable has nans.
Description of changes

All of the above errors fixed and added tests

Important before you test run pip install -e . in Orange directory since Cython code was changed and C code needs to be compiled.

Includes
  • Code changes
  • Tests
  • Documentation

@PrimozGodec PrimozGodec changed the title Fix box plot [WIP] Various fixes of box plot Nov 28, 2019
@codecov
Copy link

codecov bot commented Nov 28, 2019

Codecov Report

Merging #4231 into master will increase coverage by <.01%.
The diff coverage is 93.75%.

@@            Coverage Diff             @@
##           master    #4231      +/-   ##
==========================================
+ Coverage   85.95%   85.95%   +<.01%     
==========================================
  Files         394      394              
  Lines       70174    70183       +9     
==========================================
+ Hits        60319    60328       +9     
  Misses       9855     9855

@PrimozGodec PrimozGodec changed the title [WIP] Various fixes of box plot Various fixes of box plot Nov 28, 2019
@PrimozGodec PrimozGodec changed the title Various fixes of box plot [FIX] Various fixes of box plot Nov 28, 2019
@PrimozGodec PrimozGodec changed the title [FIX] Various fixes of box plot [WIP][FIX] Various fixes of box plot Nov 29, 2019
np.array
Array with concatenated unknowns as a row and column
"""
return np.append(np.array(self), self.unknowns)
Copy link
Contributor

Choose a reason for hiding this comment

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

The documentation for append says it already works on the copy of the first arg - do you really need to make another copy? (or are you doing this to change it from a distribution to an array?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It just to transform to array from distribution. Otherwise, it stays distribution which is not good since we get another distribution with unknown attributes. In this case, the unknowns attribute is joined together with other data so it needs to be an array.

@PrimozGodec PrimozGodec changed the title [WIP][FIX] Various fixes of box plot [FIX] Various fixes of box plot Nov 29, 2019
@lanzagar
Copy link
Contributor

When stretch bars is disabled, and there are missing values in the subgroup with the largest bar, the size of that subgroup (written to the right of the bar) falls out of view.
(does not happen when there are no missing values)

@PrimozGodec
Copy link
Contributor Author

@lanzagar it should be fixed now.

@lanzagar lanzagar merged commit 89f31fc into biolab:master Nov 29, 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.

2 participants