Skip to content

Fix two bugs in MCMC start_from feature#1

Draft
Kushallodha with Copilot wants to merge 2 commits into
add_feat_resume_fromfrom
copilot/check-latest-commit
Draft

Fix two bugs in MCMC start_from feature#1
Kushallodha with Copilot wants to merge 2 commits into
add_feat_resume_fromfrom
copilot/check-latest-commit

Conversation

Copilot AI commented Mar 9, 2026

Copy link
Copy Markdown

The new start_from feature in the MCMC sampler contained two bugs that would cause runtime failures in specific scenarios.

Bugs Fixed

  • collection.append()collection._append(): SampleCollection exposes only a private _append() method. The public append() call would raise AttributeError in any MPI run where multiple chain files are present and need to be concatenated.

  • max_tries.value accessed before NumberWithUnits conversion: _load_start_from() was called before the block that converts max_tries from its raw YAML value (e.g. "40d") into a NumberWithUnits object. Accessing .value on a bare string would raise AttributeError when sampled params are missing from the loaded chain. Fixed by:

    1. Moving _load_start_from() to after the NumberWithUnits conversion block
    2. Adding self.max_tries.set_scale(self.model.prior.d()) before using .value in the missing-params path — consistent with how normal initialization handles it

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… call after NumberWithUnits conversion

Co-authored-by: Kushallodha <30127773+Kushallodha@users.noreply.github.com>
Copilot AI changed the title [WIP] Review latest commit changes Fix two bugs in MCMC start_from feature Mar 9, 2026
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