Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

The PEtab importer reads a blank time in the experiments table as 0 instead of refusing the problem, so a pre-equilibration whose -inf was left blank is dropped from a dose-response

Open Beginner friendly
#954 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start in pybnf/petab/conditions.py at read_experiment_table around line 676, then compare the blank-time handling with _require_float in pybnf/petab/measurements.py:689-693. Make blank or missing experiment times raise a PybnfError naming the experiment, and add tests covering the dose-response example and the missing time column.

Written by the indexing model from the issue text.

Description

bug silent-incorrectness

A PEtab v2 experiments table must give every period a start time. libpetab refuses a blank one ("time value must be finite or -inf but got nan"). PyBNF's importer instead reads a blank time as 0 and carries on. The worst case on main is a dose-response in which each dose is preceded by an equilibration period whose -inf was left blank. The equilibration is dropped without a message, every dose starts from the seed species instead of the equilibrated state, and the imported job scores 13.0 at the parameter value that generated the data, where the correct score is 0. In other shapes the blank either produces an error that names times the user never wrote ("times [0.0, 0.0]") or lets an invalid problem import. The importer should refuse a blank time and name the experiment, as the measurements reader already does for a blank measurement time.

Example

m.bngl (A is made at rate kp and decays at rate k·A, starting from A = 0):

begin model
begin parameters
  kp  4
  k   1
end parameters
begin molecule types
  A()
end molecule types
begin seed species
  A() 0
end seed species
begin observables
  Molecules A_tot A()
end observables
begin reaction rules
  0 -> A() kp
  A() -> 0 k
end reaction rules
end model

PEtab v2 tables (problem.yaml lists these five tables and m.bngl with language: bngl). The three cells marked <blank> are empty in the file:

# parameters.tsv
parameterId  estimate  lowerBound  upperBound  nominalValue
k            true      0.1         10          1
# observables.tsv
observableId  observableFormula  noiseFormula  noiseDistribution
obs_A         A_tot              1             normal
# conditions.tsv
conditionId  targetId  targetValue
cond_pre     kp        8
cond_dr_1    kp        1
cond_dr_2    kp        2
cond_dr_3    kp        4
# experiments.tsv
experimentId  time     conditionId
dr_1          <blank>  cond_pre
dr_1          0        cond_dr_1
dr_2          <blank>  cond_pre
dr_2          0        cond_dr_2
dr_3          <blank>  cond_pre
dr_3          0        cond_dr_3
# measurements.tsv   (steady state under kp = 8, then 1 time unit at the dose, k = 1)
observableId  experimentId  time  measurement
obs_A         dr_1          1     3.575156
obs_A         dr_2          1     4.207277
obs_A         dr_3          1     5.471518

The readings are A(1) = d + (8 − d)e^(−1) for doses d = 1, 2, 4. That is what the problem means when the blanks are -inf.

  • libpetab 0.9.0: Problem.from_yaml raises ValidationError ... time value must be finite or -inf but got nan. With the time column removed altogether, ExperimentTable.from_tsv raises KeyError: 'time'.
  • PyBNF: import_job('petab/problem.yaml', 'imported') succeeds and writes experiment: dr, method: ode, t_end: 1, data: dr.exp, with no preequilibrate:. At k = 1 it simulates A = 0.632, 1.264, 2.528 against the readings 3.575, 4.207, 5.472, and the objective is 12.99. The same tables with -inf written in the blank cells import as experiment: dr, preequilibrate: pre, method: ode, t_end: 1 and score 7e-14.

Other shapes:

experiments.tsv rows for e1 libpetab PyBNF on main
<blank> cond_pre, 0 cond_on (a time course) refuses refuses, but the error names "times [0.0, 0.0]", which the user never wrote
<blank> cond_on (a single period) refuses imports as a time course that starts at 0
no time column at all refuses (KeyError) every period is read as starting at 0

Why

read_experiment_table (pybnf/petab/conditions.py:676) writes float(time) if time and time.strip() else 0.0, so an empty or missing time becomes 0. The measurement-table reader refuses a blank time (_require_float, pybnf/petab/measurements.py:689-693). In the example, the blank equilibration period is read as starting at 0, so the pre-equilibrated dose-response reconstruction does not recognise it (it looks for a -inf period, measurements.py:530). The plain dose-response reconstruction then takes each experiment's last row as its only condition (measurements.py:408, the defect in #904), and the equilibration period is lost.

Possible fix

In read_experiment_table, raise a PybnfError that names the experiment when the time cell is blank or the column is missing, as _require_float does for measurements. Add a test for the dose-response example above and for the missing column.

Open PR #947 (the fix for #904) makes the dose-response example fail to import, with "Experiment 'dr_1' applies 2 conditions at the same time (0)". That error is loud, but it names a time of 0 that the user never wrote. PR #940 does not change the example. Neither PR changes read_experiment_table.

Related: #904.

Found while fixing the PEtab issues #892–#908 (2026-09-25); reproduced on main at 5ecb1f69.

Dominant language
Python
Stars
25
Forks
25
Avg merge
2h 38m
Merged PRs (30d)
98

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lanl/PyBNF

All issues in lanl/PyBNF

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.