Multiple shooting drops the per-measurement binding table when it splits data into segments, so a per-measurement model under job_type = ms is refused with the wrong cause

Open Beginner friendly
#1,049 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
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

Research direction

Read pybnf/shooting/problem.py and inspect _subset_rows, which creates each segment's Data; compare how it subsets row-indexed values and weights. Use the reproduction in the issue to check that measurement_params contains the corresponding rows in the same order after segmentation. Done means a multiple-shooting segment preserves the bindings for its selected rows.

Written by the indexing model from the issue text.

Description

bug

_subset_rows in pybnf/shooting/problem.py builds each segment's Data from the experiment's data. It copies the values, the columns, the headers, the independent variable and the weights, but not measurement_params, the per-measurement binding table that a row-varying observable or noise formula reads (ADR-0045).

Reproduction:

import numpy as np
from pybnf.data import Data
from pybnf.shooting.problem import _subset_rows
d = Data.from_columns(np.array([[0., 1.], [1., 2.], [2., 3.]]), ['time', 'y'])
d.measurement_params = {'y': {'scale': ['s1', 's2', 's3']}}
seg = _subset_rows(d, [1, 2])
print(getattr(seg, 'measurement_params', None))   # None

So under job_type = ms, a per-measurement model or a row-varying noise formula finds no binding table, and the fit stops with a message such as "A row-varying noise formula ... needs a per-measurement binding table, but none is attached to the experimental data. The experiment must declare 'measurement_params: .tsv'", even when the experiment does declare it. The independent review of the #1030 fix found this by running such a fit.

Copying the table is not enough on its own. The table is indexed by data row, and a segment keeps only some rows, so each segment needs the table's rows for the rows it keeps, in the same order. Until that is done, job_type = ms with a per-measurement model or noise formula could instead be refused at load with that reason.

Dominant language
Python
Stars
25
Forks
25
Avg merge
4h 5m
Merged PRs (30d)
10

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.