Skip to content

scan

The results of the scans of a model: the dimension and the timecourse of a point.

sbmlsim 0.9 returns a scan as a ScanResult with the layout (*dims, time) and, at the time of a change after the start, the states before and after it. The PK of the scans of a model (<model>_pk.py) and its own figures read the timecourse of one point of a scan as sbmlsim 0.8 gave it, with the state after a change only, so that their numbers and figures stay the same:

# not executed
dim = single_dimension(res)
for k in range(res.ds.sizes[dim]):
    time, values = point_timecourse(res, "[Cve_hctz]", **{dim: k})

single_dimension

single_dimension(res)

Get the dimension of a scan of one dimension.

Parameters:

Name Type Description Default
res ScanResult

the result of the scan.

required

Returns:

Type Description
str

The id of the dimension.

Raises:

Type Description
ValueError

if the scan has no dimension or several.

point_timecourse

point_timecourse(res, key, /, **point)

Get the timecourse of a variable at one point of a scan, as sbmlsim 0.8 gave it.

At the time of a change after the start the timecourse has the state after the change only (sbmlsim.result.timecourse.without_states_before), and a result whose simulations have different times loses its padding.

Parameters:

Name Type Description Default
res ScanResult

the result of the scan, positional only.

required
key str

the variable, a timecourse, positional only, so that a dimension of any name, also res or key, is a position.

required
**point int

the position of the point along every dimension of the scan, e.g. dim_dose=2; the result of a simulation needs none.

{}

Returns:

Type Description
tuple[ndarray, ndarray]

The time points and the values.

Raises:

Type Description
ValueError

if a dimension of the scan has no position, a position names no dimension of the scan, or the variable is no timecourse.