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

preprocess.score.Scorer: Improve error messages #2266

Merged
merged 1 commit into from
May 4, 2017

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Apr 28, 2017

Issue

As we discussed in #2205, features selection in the Preprocess widget shows ugly error messages. This happens since it shows exceptions raised by preprocess.score.Scorer, which are, in turn, in need of improvement.

Description of changes

This PR makes the exceptions issued by preprocess.score.Scorer presentable.

I think we should not do this in general since exceptions are for programmers and error messages in the widgets are for the end-user, so the former have to be exact and technical, including the type names etc, while the latter favour readability over exactness.

A check in preproces.fss is removed since it is also done in preprocess.score.Scorer.

Includes
  • Code changes

No additional tests are needed.

@@ -30,12 +31,37 @@ class Scorer(_RefuseDataInConstructor, Reprable):
RemoveNaNClasses()
]

@property
Copy link
Contributor Author

@janezd janezd Apr 28, 2017

Choose a reason for hiding this comment

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

Sadly, Python doesn't provide @classproperty (and, no, you can't combine @classmethod and @property). Implementing it doesn't make sense for just a few (overpedantic) cases. :)

@astaric
Copy link
Member

astaric commented May 4, 2017

As the old errors were cryptic (to programmers and users), this is a welcome improvement.

@astaric astaric merged commit a01a050 into biolab:master May 4, 2017
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