Skip to content

Conversation

@aseyboldt
Copy link
Member

No description provided.

@aseyboldt aseyboldt requested a review from Copilot May 27, 2025 11:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR prepares a new release by bumping package and dependency versions, adds support for zero-size variables and low-rank mass matrix sampling in both Stan and PyMC backends, and updates the Python sampling interface with new parameters.

  • Add tests for low-rank mass matrix and zero-size variables in Stan and PyMC
  • Extend sample() interface with optional parameters (low_rank_modified_mass_matrix, transform_adapt, progress_*)
  • Bump crate and dependency versions for release

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_stan.py Added low-rank and zero-size variable tests for Stan backend
tests/test_pymc.py Added low-rank and zero-size variable tests for PyMC backend
src/stan.rs Handle empty parameter string and track sample count
src/pymc.rs Track sample count and update pointer arithmetic
python/nutpie/sample.py Extend sample signature with new options
Cargo.toml Bump package version and dependencies
CHANGELOG.md Document release 0.15.0 changes
Comments suppressed due to low confidence (4)

tests/test_stan.py:60

  • The test_empty test has no assertions and will always pass; consider adding assertions (or marking it xfail) to verify the expected behavior for zero-size variables.
nutpie.sample(compiled_model)

tests/test_pymc.py:44

  • The test_low_rank test does not assert any properties of trace.posterior.a; consider adding assertions on its shape or values to ensure the low-rank path is exercised.
trace.posterior.a  # noqa: B018

src/pymc.rs:18

  • The trait CheckedEuclid may not exist under rand_distr::num_traits; verify the correct trait import for checked_div_rem_euclid or use standard integer methods for division and remainder.
use rand_distr::num_traits::CheckedEuclid;

src/pymc.rs:180

  • Using unwrap_or((self.count, 0)) hides a potential division-by-zero or invalid division case; handle zero size explicitly or propagate an error rather than defaulting.
.checked_div_rem_euclid(&size)

Comment on lines +472 to 495
) -> arviz.InferenceData: ...


@overload
def sample(
compiled_model: CompiledModel,
*,
draws: int | None = None,
tune: int | None = None,
chains: int | None = None,
cores: int | None = None,
seed: int | None = None,
save_warmup: bool = True,
progress_bar: bool = True,
low_rank_modified_mass_matrix: bool = False,
transform_adapt: bool = False,
init_mean: Optional[np.ndarray],
return_raw_trace: bool,
init_mean: np.ndarray | None = None,
return_raw_trace: bool = False,
blocking: Literal[True],
progress_template: str | None = None,
progress_style: str | None = None,
progress_rate: int = 100,
**kwargs,
) -> arviz.InferenceData: ...
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

The docstring isn’t updated to cover the new parameters progress_template, progress_style, and progress_rate, and the documented default for progress_rate (500) doesn't match the code default (100); please align the documentation with the signature.

Copilot uses AI. Check for mistakes.
@aseyboldt aseyboldt changed the title Prepare 0.16.0 Prepare 0.15.0 May 27, 2025
@aseyboldt aseyboldt merged commit 724e620 into pymc-devs:main May 27, 2025
8 checks passed
@aseyboldt aseyboldt deleted the prepare-0.16.0 branch May 28, 2025 19:55
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.

1 participant