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

Add set_unchecked method to Score #78

Merged
merged 3 commits into from
Jul 19, 2023
Merged

Add set_unchecked method to Score #78

merged 3 commits into from
Jul 19, 2023

Conversation

jim-works
Copy link
Contributor

In some cases it can be useful to be able to represent scores outside the [0,1] range, especially when it is difficult to calculate the minimum and maximum values of a Scorer, or you want one scorer to be able to dominate in certain scenarios. This PR adds a set_unchecked method to Score to accommodate this.

I saw some previous discussion on this in #36 , but I think it's good to give people the option. I've only been using big-brain for a few days, so feel free to ignore my opinion.

src/scorers.rs Outdated
@@ -35,6 +35,12 @@ impl Score {
}
self.0 = value;
}

/// Set the `Score`'s value. Allows values outside the range `0.0..=1.0`
/// Note: it is up to you to make sure your scorers are using the same units!
Copy link
Owner

Choose a reason for hiding this comment

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

I'd like a bit more of a warning here about the implications: It can make scorers much, much harder to effectively compose together when there isn't a single set scale.

@zkat zkat merged commit e179cb5 into zkat:main Jul 19, 2023
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