The notebook helper's run_fit ignores refine and bootstrap without a word

Abierto
#1,073 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
73/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
backend, testing

Línea de trabajo

Start with examples/notebooks/pybnf_notebook.py and compare run_fit with the refine and bootstrap flow in pybnf.main; the issue asks that this work be shared or that unsupported settings be rejected. Add a test for refine or bootstrap and confirm the notebook helper either runs the requested phase or reports clearly that it is skipped. The _report_parallelism traceback is a separate reported problem to investigate in the same helper.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug silent-incorrectness

The notebook helper's run_fit (examples/notebooks/pybnf_notebook.py) runs only the main fit. It never runs the refine or bootstrap phases that pybnf -c runs, and it doesn't refuse a conf that sets them. A notebook user who sets bootstrap = 3 or refine = 1 gets the unrefined fit with no bootstrap replicates, and no message saying either step was skipped. This applies to every job type.

Found while reviewing #1066, which made the helper run the same start checks as pybnf.main. Reproduced on main at cbb8159c.

Reproduction
import os, sys
sys.path.insert(0, 'examples/notebooks')
import pybnf_notebook as nb

base = """edition = 2
objective = gaussian, mean = 0 0, variance = 1 1
uniform_var = g1 -10 10
uniform_var = g2 -10 10
random_seed = 1
job_type = de
population_size = 8
max_iterations = 20
"""
alg = nb.run_fit(base + "bootstrap = 3\n", "out_boot")
print(alg.config.config['bootstrap'], sorted(os.listdir(alg.res_dir)))

This prints 3 and ['sorted_params_0.txt', 'sorted_params_backup.txt', 'sorted_params_final.txt', 'start_point.txt']. No replicate runs and nothing reports one. With refine = 1 the output is the same.

The same conf through pybnf -c x.conf -o prints "Beginning bootstrap run 0" through 2 and "Bootstrapping complete", and writes Results/bootstrapped_parameter_sets.txt.

What should happen

Have run_fit run the refine and bootstrap phases as pybnf.main does, sharing that code rather than copying it. Otherwise, have build_algorithm refuse a conf that sets refine or bootstrap, saying the helper runs only the main fit. Either way, add a test.

Separately, run_fit prints a traceback ("'_SyncClient' object has no attribute 'scheduler_info'") from _report_parallelism on every run. It is caught and harmless, but it is noise in every notebook.

Lenguaje dominante
Python
Estrellas
26
Forks
25
Merge medio
4 h 25 min
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lanl/PyBNF

Todos los issues de lanl/PyBNF

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.