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

DiscreteVariable: Raise an exception if values are not unique #6878

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Aug 21, 2024

Issue

Closes #6877.

Description of changes

Check that all values are unique; raise an exception if not.

This does not solve any bugs, but reports them earlier.

Includes
  • Code changes
  • Tests

@markotoplak
Copy link
Member

This bug catcher is so good that it successfully reported 2 bugs on the first attempt.

@janezd janezd force-pushed the unique-discrete-values branch 2 times, most recently from 548af76 to 12367d4 Compare October 10, 2024 16:04
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.41%. Comparing base (c6a79f6) to head (dc7b9b2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6878   +/-   ##
=======================================
  Coverage   88.40%   88.41%           
=======================================
  Files         326      326           
  Lines       71946    71979   +33     
=======================================
+ Hits        63605    63641   +36     
+ Misses       8341     8338    -3     

@janezd
Copy link
Contributor Author

janezd commented Oct 10, 2024

I'm so proud of my dilligent work. :)

However, as I unintentionally wrote "This does not solve any bugs, but reports them earlier.". :)

  • Now I reimplemented the code that creates labels for discretized variables so that it increases the number of digits when necessary. When the number of digits is given as an argument (as opposed to using ContinuousVariable.str_val), it also rounds the interval threshold so that they match the printed labels.
  • The other bug was due to an invalid test.

@markotoplak markotoplak added this to the 3.38.0 milestone Oct 21, 2024
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.

Continuize: multiple attributes with the same name
3 participants