Skip to content

Integration property tests#122

Draft
kirloo wants to merge 4 commits into
kmolan:mainfrom
kirloo:task/integration_proptests
Draft

Integration property tests#122
kirloo wants to merge 4 commits into
kmolan:mainfrom
kirloo:task/integration_proptests

Conversation

@kirloo

@kirloo kirloo commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What & why

Resolves #102

I haven't touched gaussian_tables yet, but I'm submitting a draft because while the test logic looks sound, I had to increase the number of iterations all the way to 300 for the Simpsons test to pass. I don't know whether that's indicative of an error somewhere, or expected for that method due to the relatively larger intervals, but the discrepancy made me nervous.

Checklist

  • CHANGELOG.md updated under ## [Unreleased] (required for behavior-facing changes)
  • cargo test + cargo clippy --all-targets clean locally
  • New public APIs have a doc example
  • No unwrap/expect/panic on library paths (typed errors instead)

@kmolan

kmolan commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Thanks for taking this! This is a non trivial change so I'll need a day or two to review this (I'm also traveling atm). Will get back soon!

Comment thread crates/multicalc/tests/numerical_integration.rs Outdated
Comment thread crates/multicalc/tests/numerical_integration.rs Outdated

proptest! {
#[test]
fn proptest_trapezoid_integration_f64(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You added four tests, but there is so much repeated code. Please consolidate them into one test.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@kmolan Yeah, you're right. I could factor out a lot of the code into a function returning a strategy which includes the function, the closed form value, the tolerance and the limit. But do you really want all the integration methods to live in a single test? Should they not be allowed to succeed/fail individually?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

no, this is cleanup and therefore nice to have, not a strong blocker.

@kmolan

kmolan commented Jul 11, 2026

Copy link
Copy Markdown
Owner

@kirloo Left comments. Please also add tests for other quadratures when ready.

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.

Property test: quadrature rules are exact up to their rule order

3 participants