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

uint32_t weight in tdigest<float> + cross-language test #424

Merged
merged 8 commits into from
Feb 26, 2024

Conversation

AlexanderSaydakov
Copy link
Contributor

generate files for Java

@coveralls
Copy link

coveralls commented Feb 21, 2024

Pull Request Test Coverage Report for Build 8056069290

Details

  • 0 of 6 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 98.949%

Totals Coverage Status
Change from base Build 7980471138: 0.2%
Covered Lines: 16377
Relevant Lines: 16551

💛 - Coveralls

@AlexanderSaydakov AlexanderSaydakov changed the title cross-language test uint32_t weight in tdigest<float> + cross-language test Feb 22, 2024
Copy link
Contributor

@jmalkin jmalkin left a comment

Choose a reason for hiding this comment

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

Can improve one test slightly and I think we need to fix the weight type, unless the intent is to cast it into a floating-point type

void add(const centroid& other) {
weight_ += other.weight_;
mean_ += (other.mean_ - mean_) * other.weight_ / weight_;
}
T get_mean() const { return mean_; }
uint64_t get_weight() const { return weight_; }
T get_weight() const { return weight_; }
Copy link
Contributor

Choose a reason for hiding this comment

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

return type W?

REQUIRE(bytes.size() == static_cast<size_t>(s.tellg()));

REQUIRE(deserialized_td1.get_k() == deserialized_td2.get_k());
REQUIRE(deserialized_td1.get_total_weight() == deserialized_td2.get_total_weight());
Copy link
Contributor

Choose a reason for hiding this comment

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

This never actually checks that the weight is 0 or that is_empty() returns true, only that they're equivalent

Copy link
Contributor

@jmalkin jmalkin left a comment

Choose a reason for hiding this comment

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

👍

@AlexanderSaydakov AlexanderSaydakov merged commit 5bf5a9f into master Feb 26, 2024
8 checks passed
@AlexanderSaydakov AlexanderSaydakov deleted the tdigest branch February 27, 2024 22:30
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.

3 participants