A constraint's suffix.observable reference is resolved only once simulations run: an ambiguous suffix is accepted at load, and a gradient fit names a different cause

Aperta
#1,061 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, testing

Direzione di ricerca

Start with Constraint variable lookup in pybnf/constraint.py and gradient_base.scored_suffixes, then trace when constraint references are resolved during configuration loading. Use the two-model reproduction with duplicate q outputs and a dotted reference such as q.A_tot to check the behavior. Done means loading rejects references that match zero or multiple models and names the suffix and producing models.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

What you do. Fit two models that both write an output with the same suffix, say q. Attach a constraint to one of them that reads that output by name, for example a tc.prop on model m1 containing q.A_tot < 50 at q.time=2 weight 1.

What you see. The configuration loads and the fit is set up. Then it depends on the fit type:

  • job_type = de stops at its first simulation with "Suffix 'q' in your constraint file appears in multiple model files. Please change your suffix names so it isn't ambiguous".
  • job_type = gntr, where m2's q is an ssa run, is refused as it is set up. The message is that it "cannot differentiate the scored output 'q' of model 'm2': it is written by a simulate run with method 'ssa'". It does not mention the ambiguity, which is the actual problem. Both models' q count as read by the constraint, because a suffix.observable reference is matched against every model's outputs.

Both runs stop, so no wrong result is reported. But the name is resolved only against the simulated output, after the configuration has been accepted. Under refine_method = gntr or refine_method = ms, a refusal that depends on this would come after the whole search.

What should happen. When the configuration loads, each suffix.observable reference in a constraint file should resolve to exactly one model's output. If it resolves to none or to more than one, the configuration should be refused, naming the suffix and the models that produce it.

Where. Constraint's variable lookup in pybnf/constraint.py (the "appears in multiple model files" check) runs against the simulation data dictionary at evaluation time. gradient_base.scored_suffixes (from #1057) adds a dotted reference's suffix to every model that can produce it.

Reproduction. Two copies of a decay model, each with simulate({method=>...,suffix=>"q"}) and then resetConcentrations() and an ODE simulate(...suffix=>"tc"). The q run is ode in m1.bngl and ssa in m2.bngl. The job:

edition = 2
bngl_backend = bngsim
model = m1.bngl : a/tc.exp, a/tc.prop
model = m2.bngl : b/tc.exp
objective = sos
uniform_var = k_deg 0.1 10
job_type = de

a/tc.prop holds q.A_tot < 50 at q.time=2 weight 1.

Found during review of the multiple-shooting batch (fix/ms-batch). The de behaviour is the same on main.

Lingua principale
Python
Stelle
26
Fork
25
Merge medio
4h 25m
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lanl/PyBNF

Tutte le issue di lanl/PyBNF

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.