bootstrap with mh or am is accepted at load, then crashes with a TypeError when the first replicate starts, after the whole main fit has run
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start with bootstrap handling at pybnf/pybnf.py:521 and the sampler reset methods in basic_mcmc.py:101 and adaptive_mcmc.py:165. Trace how base.py:379 opens samples_file during start_run, then check configuration loading for a validation path. Done means unsupported sampler bootstrapping is rejected before the main fit runs, including mh, am, and pt, with coverage for the reported configuration.
Written by the indexing model from the issue text.
Description
The configuration accepts bootstrap = N with job_type = mh or job_type = am. The main fit then runs to the end and writes its results. When the first bootstrap replicate starts, the run stops with Sorry, an unknown error occurred: TypeError: expected str, bytes or os.PathLike object, not NoneType. No replicate is fitted, and the error appears only after the whole main fit has run.
pt shares mh's code and should crash the same way; I did not run it. #862 covers dream and p_dream, where bootstrap runs but each replicate's result is wrong.
Example
boot.conf needs no model or data file:
edition = 2
objective = expression
expression = 0.5*((x - 1)/0.5)^2 + 0.5*((y - 3)/0.5)^2
job_type = mh
uniform_var = x -5 5
uniform_var = y -5 10
max_iterations = 100
burn_in = 50
sample_every = 1
population_size = 2
random_seed = 1
bootstrap = 2
output_dir = out
Run pybnf -c boot.conf -o. It prints Fitting complete, then Beginning bootstrap run 0, then the TypeError, and exits with code 1. job_type = am (with adaptive = 20 added) does the same.
Where in the code
pybnf/pybnf.py:521:alg.reset(bootstrap=...)runs before each replicate.pybnf/algorithms/samplers/basic_mcmc.py:101(mh, pt) andpybnf/algorithms/samplers/adaptive_mcmc.py:165(am):reset()setsself.samples_file = None.pybnf/algorithms/samplers/base.py:379: the replicate'sstart_runthen openssamples_fileto write its header, and getsNone.
Unless bootstrapping a sampler is meant to be supported, the simplest fix is to refuse bootstrap for every sampler job_type when the configuration loads. That would also cover #862.
- Dominant language
- Python
- Stars
- 25
- Forks
- 25
- Avg merge
- 2h 38m
- Merged PRs (30d)
- 98
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lanl/PyBNF
-
bug silent-incorrectness
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
bug silent-incorrectness
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug silent-incorrectness
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug silent-incorrectness
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-2 days Newbie friendliness 70/100
-
FingerprintSplitter raises ZeroDivisionError when int(frac_train * len(dataset)) floors to zeroOpen
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
lmstudio-ai/mlx-engine#376 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyiron/bagofholding#166 ·