Skip to content

petab1to2: random column name for pre-existing experimentId column #568

Closed

Description

@dweindl

If a v1 measurement table has an extra column experimentId, petab1to2 renames it to experiment_id_<uuid4> to make room for the v2 experimentId column (petab/v2/petab1to2.py). The output differs between conversions of the same problem, and the new column name carries no meaning.

import tempfile
from pathlib import Path

import benchmark_models_petab as bmp
from petab.v2.petab1to2 import petab1to2

yaml_v1 = bmp.get_problem_yaml_path("Brannmark_JBC2010")
for _ in range(2):
    with tempfile.TemporaryDirectory() as outdir:
        petab1to2(yaml_v1, outdir)
        header = Path(outdir, "measurements.tsv").read_text().split("\n")[0]
        print(header.split("\t"))
['experimentId', 'observableId', 'measurement', 'time', 'observableParameters', 'noiseParameters', 'experiment_id_fda2a0d7-e3d5-462c-a8db-544d13aff6e3', 'independentVariableId', 'datasetId']
['experimentId', 'observableId', 'measurement', 'time', 'observableParameters', 'noiseParameters', 'experiment_id_28c488f0-1acf-493b-bea4-d58f3eef7b19', 'independentVariableId', 'datasetId']

This affects Brannmark_JBC2010 and Isensee_JCB2018 in the benchmark collection, where experimentId groups measurements across simulation conditions (e.g., dose_response, one_step_time_response). Committing converted problems produces spurious diffs on every re-conversion.

Suggested fix: use a fixed name, e.g. experimentId_v1 (appending a counter only if that name is taken as well), and emit a warning about the rename.

🤖 Generated by an AI agent (Claude Code)

Activity

  1. self-assigned this
    on Oct 25, 2026
  2. added 2 commits that reference this issue on Oct 25, 2026
    2b9dea8
    de53c06
  3. added a commit that references this issue on Oct 26, 2026
    ce80233
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions