Skip to content

petab1to2: make experiment IDs unique - #636

Open
dweindl wants to merge 1 commit into
PEtab-dev:mainfrom
dweindl:petab1to2-unique-experiment-ids
Open

dweindl wants to merge 1 commit into
PEtab-dev:mainfrom
dweindl:petab1to2-unique-experiment-ids

Conversation

@dweindl

@dweindl dweindl commented Nov 26, 2026

Copy link
Copy Markdown
Member

petab1to2 generates an experiment ID for each combination of pre-equilibration and simulation condition, e.g., experiment__a____b. The deduplication of these IDs never applied, because it compared the ID against a list of dicts. As a result, e.g., the (pre-equilibration, simulation) condition pairs (a_, b) and (a, _b) were merged into a single experiment.

Now, the experiment ID is determined once per condition pair and is unique among the generated experiment IDs and the existing condition, observable, and parameter IDs. Previously, each check scanned all experiments, and the condition check used a .loc lookup per measurement, which was slow for large measurement tables.

For all problems in the benchmark collection, the output is unchanged.

🤖 Generated with Claude Code

The deduplication of generated experiment IDs never applied: it checked
the ID against a list of dicts. So, e.g., the (pre-equilibration,
simulation) condition pairs (`a_`, `b`) and (`a`, `_b`) were merged into
one experiment `experiment__a____b`. Also, each check scanned all
experiments, and the condition check used a `.loc` lookup per
measurement.

Now, the experiment ID is determined once per condition pair, unique
among the generated experiment IDs and the condition, observable, and
parameter IDs, and reused for the measurement table.

Output is unchanged for all benchmark problems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl dweindl self-assigned this Nov 26, 2026
@codecov-commenter

codecov-commenter commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.39%. Comparing base (bacc686) to head (e8c4d57).

Files with missing lines Patch % Lines
petab/v2/petab1to2.py 80.95% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #636      +/-   ##
==========================================
+ Coverage   80.34%   80.39%   +0.05%     
==========================================
  Files          70       70              
  Lines        8505     8514       +9     
  Branches     1561     1561              
==========================================
+ Hits         6833     6845      +12     
+ Misses       1180     1177       -3     
  Partials      492      492              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweindl
dweindl force-pushed the petab1to2-unique-experiment-ids branch from 60b4df3 to e8c4d57 Compare November 26, 2026 14:50
@dweindl
dweindl marked this pull request as ready for review November 26, 2026 14:52
@dweindl
dweindl requested a review from a team as a code owner November 26, 2026 14:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants