Repository navigation
Conversation
* Sympify each distinct value once per `from_df` call. The cache is
passed to the field validators via the pydantic validation context,
keyed by type and value (`1` and `1.0` are sympified differently).
* Validate each distinct condition target ID once per `from_df` call.
* Avoid `groupby`, `iterrows`, and `to_dict("records")`.
`ConditionTable.from_df` now keeps conditions in the order of their
first occurrence, instead of sorting them by ID.
Loading the converted Froehlich_CellSystems2018 problem: 18.7 s ->
9.7 s; Beer_MolBioSystems2014: 2.8 s -> 0.4 s. The loaded tables are
unchanged for all other benchmark problems (apart from condition order).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dweindl
force-pushed
the
v2-table-load-perf
branch
from
November 26, 2026 13:56
3e7b963 to
629e64f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #634 +/- ##
==========================================
+ Coverage 80.34% 80.39% +0.05%
==========================================
Files 70 70
Lines 8505 8538 +33
Branches 1561 1565 +4
==========================================
+ Hits 6833 6864 +31
- Misses 1180 1182 +2
Partials 492 492 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Speeds up
ConditionTable.from_dfandMeasurementTable.from_dffor large tables. In such tables, many cells share the same values (e.g., target values, noise or observable parameters), and each cell was converted withsympifyseparately, which dominated the loading time.from_dfcall. The cache is passed to the field validators through the pydantic validation context, so it only lives for that call. It is keyed by type and value, because1and1.0hash equal but are sympified toIntegerandFloat, respectively (sympify_petabreturnsIntegerfor Python/numpy integers, butFloatfor numeric strings #553).from_dfcall.groupby,iterrows, andto_dict("records")are replaced by plain column lists.Behavior change:
ConditionTable.from_dfkeeps conditions in the order of their first occurrence in the file, instead of sorting them by ID.Loading time of the PEtab v2 versions of benchmark problems: Froehlich_CellSystems2018 goes from 18.7 s to 9.7 s, and Beer_MolBioSystems2014 from 2.8 s to 0.4 s. For all other problems of the benchmark collection, the loaded tables are unchanged apart from the condition order.
🤖 Generated with Claude Code