PEtab import_job writes sampler confs that cannot record a draw: max_iterations = 100 with the default burn_in of 10000, and pt with no beta_range

Abierto Apto para principiantes
#1,074 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
testing

Línea de trabajo

Lee pybnf/petab/import_.py cerca de _DEFAULT_SETTINGS y de los ajustes que se escriben cerca de la línea 2077. Reproduce el problema con el fixture proporcionado y comprueba cada configuración de sampler generada con check_fresh_run. Se considera terminado cuando las configuraciones de sampler incluyen una ventana de muestreo y la configuración pt incluye beta_range, con una prueba de regresión que cubra cada configuración de sampler que escribe el importador.

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

Descripción

bug

pybnf.petab.import_.import_job writes the same run settings for every job type: population_size = 50, max_iterations = 100 and verbosity = 0 (_DEFAULT_SETTINGS, pybnf/petab/import_.py:219, written at :2077). For a sampler, burn_in is left at its default of 10000, so the generated sampler confs cannot record a draw:

  • Since #1066, dream, p_dream, am, mh and pt are refused at start with "max_iterations (100) must be greater than burn_in (10000), otherwise no samples will be collected."
  • Before #1066 they ran to an empty samples.txt and reported "Fitting complete" (#921).
  • The pt conf also gets no beta_range, so loading it warns that its replica exchanges will accomplish nothing.
  • hmc is accepted (it does not read max_iterations).

Found while reviewing #1066. Reproduced on main at cbb8159c.

Reproduction
import os, re
from pathlib import Path
from pybnf.petab.import_ import import_job
from pybnf import parse, config, printing

out = import_job(Path('tests/petab_fixtures/fixedsigma_v2/problem.yaml'), Path('/tmp/imp'), job_type='all')
os.chdir(out)
for c in sorted(out.glob('imported_*.conf')):
    try:
        conf = config.Configuration(parse.ploop(c.read_text().splitlines(keepends=True)))
        conf.check_fresh_run()
        print(c.name, 'accepted')
    except printing.PybnfError as e:
        print(c.name, 'refused:', e.message.splitlines()[0])

imported_am.conf, imported_dream.conf, imported_mh.conf, imported_p_dream.conf and imported_pt.conf are refused; imported_hmc.conf is accepted. The same happens with job_type='dream' (or any one sampler) in place of 'all'.

What should happen

For a sampler job type, the importer should write a run that records draws:

  • a burn_in below max_iterations, with a max_iterations long enough to leave a sampling window;
  • for pt, a beta_range.

A test should put every sampler conf the importer writes through check_fresh_run, as the reproduction does.

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.