Skip to content

Comments

feat: JSON model representation#209

Draft
mhovd wants to merge 21 commits intomainfrom
json-backup
Draft

feat: JSON model representation#209
mhovd wants to merge 21 commits intomainfrom
json-backup

Conversation

@mhovd
Copy link
Collaborator

@mhovd mhovd commented Feb 15, 2026

For keeping a backup of the contributions by @Siel

Siel and others added 21 commits December 30, 2025 14:37
This commit adds two related features:

## NormalizedRow API (parser/)
- New  struct for format-agnostic data parsing
- Decouples column mapping from event creation logic
- Full ADDL/II expansion support (both positive and negative directions)
- Refactors pmetrics.rs to use NormalizedRow internally
- Enables external tools (like vial) to reuse parsing logic without
  reimplementing ADDL expansion

## ResidualErrorModel (data/)
- New  for parametric algorithms (SAEM, FOCE)
- Uses prediction-based sigma (vs observation-based in ErrorModel)
- Adds  and  functions
- Documentation clarifying ErrorModel vs ResidualErrorModel usage

Both features are independent but included together to avoid merge conflicts.
* nca

* wip: current version

* feat: nca

* clenup

* chore: documentation

* chore: cleanup

* chore: cleanup

* chore: deprecating ErrorModel in favor of AssayErrorModel, subdividing the likelihood module and deprecating linear space likelihood calculation functions

* feat: the Data parsing is centraliced to NormalizedRow

* feat: the ErrorModel -> AssayErrorModel

* feat: validation

* chore: cleanup

* chore: cleanup
Co-authored-by: Markus Hovd <markushh@uio.no>
* chore: Rename modules and structures

* Update src/error/mod.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/data/parser/mod.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Name changes

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mhovd added a commit that referenced this pull request Feb 15, 2026
A copy before this change is at #209
@github-actions
Copy link
Contributor

🐰 Bencher Report

Branchjson-backup
Testbedmhovd-pgx
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
Analytical vs ODE/One-compartment IV/Analytical📈 view plot
🚷 view threshold
829.52 ns
(-2.82%)Baseline: 853.58 ns
986.54 ns
(84.08%)
Analytical vs ODE/One-compartment IV/ODE📈 view plot
🚷 view threshold
17,843.00 ns
(+0.54%)Baseline: 17,747.50 ns
18,199.00 ns
(98.04%)
Analytical vs ODE/One-compartment oral/Analytical📈 view plot
🚷 view threshold
851.61 ns
(-0.13%)Baseline: 852.75 ns
1,025.81 ns
(83.02%)
Analytical vs ODE/One-compartment oral/ODE📈 view plot
🚷 view threshold
25,665.00 ns
(-0.45%)Baseline: 25,781.00 ns
26,394.78 ns
(97.24%)
Analytical vs ODE/Two-compartment IV/Analytical📈 view plot
🚷 view threshold
879.91 ns
(-5.14%)Baseline: 927.55 ns
1,094.34 ns
(80.41%)
Analytical vs ODE/Two-compartment IV/ODE📈 view plot
🚷 view threshold
26,097.00 ns
(-0.50%)Baseline: 26,229.25 ns
26,747.11 ns
(97.57%)
Analytical vs ODE/Two-compartment oral/Analytical📈 view plot
🚷 view threshold
949.03 ns
(-3.09%)Baseline: 979.30 ns
1,170.35 ns
(81.09%)
Analytical vs ODE/Two-compartment oral/ODE📈 view plot
🚷 view threshold
29,277.00 ns
(-0.20%)Baseline: 29,336.00 ns
30,340.11 ns
(96.50%)
Conditional dose modification📈 view plot
🚷 view threshold
1,174.90 ns
(-1.30%)Baseline: 1,190.33 ns
1,236.97 ns
(94.98%)
Create large dataset (100 subjects)📈 view plot
🚷 view threshold
55,202.00 ns
(+1.96%)Baseline: 54,142.75 ns
56,979.68 ns
(96.88%)
Data expand complex (1h intervals)📈 view plot
🚷 view threshold
27,865.00 ns
(+1.08%)Baseline: 27,567.75 ns
29,432.86 ns
(94.67%)
Data expand simple (1h intervals)📈 view plot
🚷 view threshold
487.01 ns
(0.00%)Baseline: 487.01 ns
503.01 ns
(96.82%)
Data expand with additional time📈 view plot
🚷 view threshold
37,458.00 ns
(-1.30%)Baseline: 37,951.75 ns
40,332.92 ns
(92.87%)
Filter exclude subjects📈 view plot
🚷 view threshold
30,986.00 ns
(-0.29%)Baseline: 31,076.75 ns
31,569.82 ns
(98.15%)
Filter include subjects📈 view plot
🚷 view threshold
7,952.90 ns
(+0.01%)Baseline: 7,952.22 ns
8,359.95 ns
(95.13%)
Modify all bolus doses📈 view plot
🚷 view threshold
1,161.20 ns
(-0.14%)Baseline: 1,162.80 ns
1,171.33 ns
(99.14%)
Modify all infusion doses📈 view plot
🚷 view threshold
1,200.40 ns
(-0.54%)Baseline: 1,206.90 ns
1,255.54 ns
(95.61%)
SubjectBuilder multi-occasion📈 view plot
🚷 view threshold
270.44 ns
(+2.66%)Baseline: 263.43 ns
281.93 ns
(95.92%)
SubjectBuilder simple📈 view plot
🚷 view threshold
103.48 ns
(+0.01%)Baseline: 103.47 ns
104.72 ns
(98.81%)
SubjectBuilder with covariates📈 view plot
🚷 view threshold
276.86 ns
(+1.72%)Baseline: 272.19 ns
284.70 ns
(97.25%)
nca_auc_cmax_metrics📈 view plot
🚷 view threshold
609.91 ns
nca_lambda_z_candidates📈 view plot
🚷 view threshold
633.44 ns
nca_population/10📈 view plot
🚷 view threshold
45,813.00 ns
nca_population/100📈 view plot
🚷 view threshold
140,040.00 ns
nca_population/500📈 view plot
🚷 view threshold
315,210.00 ns
nca_single_subject📈 view plot
🚷 view threshold
1,018.00 ns
one_compartment📈 view plot
🚷 view threshold
19,765.00 ns
(+0.22%)Baseline: 19,722.25 ns
20,236.85 ns
(97.67%)
one_compartment_covariates📈 view plot
🚷 view threshold
26,684.00 ns
(+0.98%)Baseline: 26,425.00 ns
28,757.82 ns
(92.79%)
readme 20📈 view plot
🚷 view threshold
303,350.00 ns
(-0.57%)Baseline: 305,080.00 ns
324,219.83 ns
(93.56%)
two_compartment📈 view plot
🚷 view threshold
22,952.00 ns
(+3.78%)Baseline: 22,116.75 ns
24,344.87 ns
(94.28%)
🐰 View full continuous benchmarking report in Bencher

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