A BNGL simulate() or parameter_scan() with no method runs as an ODE on the bngsim backend, but BNG2.pl refuses it, so the default backend fits a model that bngl_backend = bionetgen cannot run, and neither refuses it at load
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start with bng2pl_network_free_refusals in pybnf/bngsim_model/grid.py (around line 274), then find the get('method', 'ode') defaults in classification.py, grid.py, net_model.py and segment.py. Add a load-time refusal for simulate, parameter_scan and bifurcate that name no method and no poplevel, quoting BNG2.pl's message. Done when the nomethod.bngl reproduction is refused on the default backend, and a model that loads also runs on bngl_backend = bionetgen.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
BNG2.pl requires method on simulate. With no method it stops with ABORT: simulate() requires 'method' parameter (ode, ssa, pla, psa, nf). (BioNetGen 2.9.3, Perl2/BNGAction.pm:256-257). A parameter_scan calls simulate at each point, so it stops too: Error in parameter_scan (step 1): simulate() requires 'method' parameter.
The bngsim bridge reads a missing method as ode everywhere:
- the classifier, which decides that
bngl_backend = autotakes the.netbridge (pybnf/bngsim_model/classification.py:300,:307,:314for simulate, parameter_scan, bifurcate); - the load-time grid check (
pybnf/bngsim_model/grid.py:342and:184); - the run itself (
_prepare_simulate_run,pybnf/bngsim_model/net_model.py:1607-1610, and_resolve_scan_settings,net_model.py:2064-2067); - the multiple-shooting segment integrator (
pybnf/bngsim_model/segment.py:110).
bng2pl_network_free_refusals (grid.py:274) looks only at network-free methods, so an empty method passes it too. The model is therefore accepted at load on every backend. On the bridge it fits as an ODE model. On bngl_backend = bionetgen every simulation aborts, and the fit ends with Fitting complete, objective inf, and exit status 0. That is a configuration error turned into failed simulations.
The bridge is supplying a default for an input whose absence BNG2.pl treats as a mistake. The method decides whether the model is deterministic at all (ode against ssa, psa, nf). So the default backend and bngl_backend = bionetgen disagree about whether the model is valid. Usually the user meant ode, so the impact is low, but the backends should agree.
Failure scenario
A hand-written edition-1 action leaves out method, for example simulate({t_end=>5,n_steps=>5,suffix=>"tc"}). Under the default backend the fit runs and reports a best fit as an ODE model. The same configuration with bngl_backend = bionetgen, or the saved Results/<model>_<best>.bngl run with BNG2.pl, aborts. If the author meant a stochastic method, the default backend has fitted a deterministic model without saying so.
Reproduction
PyBNF v1.8.1 on main at dd4c6a3a, bngsim 0.16.0, BioNetGen 2.9.3.
nomethod.bngl:
begin model
begin parameters
A0 1000
kdeg kdeg__FREE
end parameters
begin molecule types
A()
end molecule types
begin seed species
A() A0
end seed species
begin observables
Molecules Atot A()
end observables
begin reaction rules
A() -> 0 kdeg
end reaction rules
end model
begin actions
generate_network({overwrite=>1})
simulate({t_end=>5,n_steps=>5,suffix=>"tc"})
end actions
tc.exp holds 1000·exp(−0.1 t) at t = 0…5. bngsim.conf (edition 1, so the job type defaults to de):
model = nomethod.bngl : tc.exp
bngl_backend = bngsim
objfunc = sos
uniform_var = kdeg__FREE 0.0999 0.1001
population_size = 3
max_iterations = 1
random_seed = 1
parallel_count = 1
output_dir = out_bngsim
delete_old_files = 0
| backend | result |
|---|---|
bngsim |
Fitting complete, objective 0.0224; the best-fit tc rows are the ODE solution (1000, 904.81, 818.68, …) |
auto |
the same as bngsim (objective 0.0224) |
bionetgen |
Job gen0ind0/1/2 failed, objective inf, exit 0; ABORT: simulate() requires 'method' parameter (ode, ssa, pla, psa, nf). in each simulation log |
perl $BNGPATH/BNG2.pl nomethod.bngl (with kdeg 0.1) exits 1 with the same ABORT. With the action replaced by parameter_scan({parameter=>"kdeg",par_min=>0.1,par_max=>0.4,n_scan_pts=>4,t_end=>5,suffix=>"scan"}), BNG2.pl exits 1 with Error in parameter_scan (step 1): simulate() requires 'method' parameter. The .net bridge runs it as an ODE scan (606.53, 367.88, 223.13, 135.34).
Possible fix
Refuse, at load, a simulate, parameter_scan or bifurcate that names no method (and no poplevel, which BNG2.pl reads as psa). The refusal should name the action and quote BNG2.pl's message, on every backend, so that a model that loads also runs on BNG2.pl. Once that refusal is in place, the get('method', 'ode') defaults listed above are unreachable for hand-written actions. Edition-2 experiments write the method explicitly (pybnf/config.py:1750 defaults the experiment: field to ode, which is documented), so they are unaffected.
#1005
#1005 (fix/872-sample-times-grid, 44ef34e9) does not change this. Rerunning both actions against 44ef34e9 on the .net bridge gives the same ODE rows.
Related: #920 (method spellings that are not recognised as stochastic), #999 (network-free actions BNG2.pl refuses, now refused at load).
- Lenguaje dominante
- Python
- Estrellas
- 25
- Forks
- 25
- Merge medio
- 4 h 5 min
- PR fusionados (30 d)
- 10
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de lanl/PyBNF
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug tech debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug silent-incorrectness
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
Todos los issues de lanl/PyBNF
Issues similares
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
gh-sync ship audits cards before writing station done, so every ship reports false STATUS findingsAbiertoharness
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mruangutai/harness#2455 ·
Los mantenedores suelen responder en 1 día
-
stripthink leaves thinking text in place when the chat template opens the think tag in the promptPosiblemente ocupada @MaiAditya la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
xcorr sizes its bin array from the largest observed m/z, so one out-of-range peak kills the runPosiblemente ocupada @BioGeek la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
instadeepai/winnow#312 ·