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] Create Class: multiple patterns for a class value #5283

Merged
merged 1 commit into from
Feb 19, 2021

Conversation

markotoplak
Copy link
Member

Issue

Repeated output class values created a DiscreteVariable with repeated values, which introduced problems later on. This PR fixes Quasars/orange-spectroscopy#521.

Description of changes

This PR ensures that all values of the output DiscreteVariable are unique.

Allowing multiple match patterns for a single value seems like a useful feature (we get something similar to OR conditions). So I decided to support it rather than blocking it on input.

Patterns are still being matched in the same order as before, so this PR should not change any behavior that was valid before the fix. Also, the order of output values is kept.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #5283 (30a3c7c) into master (4014f24) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #5283   +/-   ##
=======================================
  Coverage   85.21%   85.21%           
=======================================
  Files         300      300           
  Lines       61009    61022   +13     
=======================================
+ Hits        51987    52000   +13     
  Misses       9022     9022           

@janezd janezd self-assigned this Feb 19, 2021
@janezd
Copy link
Contributor

janezd commented Feb 19, 2021

@markotoplak, can you rebase, please? (Conflict in tests.)

Before, repeated output class values created a DiscreteVariable
with repeated values, which introduced problems later on.

This PR ensures that all values of the output DiscreteVariable are
unique. A single value can be shared by multiple match patterns.
@markotoplak
Copy link
Member Author

@janezd, I just rebased.

@janezd janezd merged commit 175aea3 into biolab:master Feb 19, 2021
@markotoplak markotoplak deleted the createclass-repeated 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.

Merging Values is not working
2 participants