Skip to content

reports

The reports of the adopted fits of a model.

A fit is adopted with run_fit <package> --adopt <fit id>, its record (PKPDModel.fits_dir) holds everything its report is built from. The report of every adopted fit is written separately, there is no report which merges the fits of a model: the fits have different problems, data and parameters.

adopted_record

adopted_record(model, fit_id)

Get the record of an adopted fit of a model, which its report is built from.

Parameters:

Name Type Description Default
model PKPDModel

the model.

required
fit_id str

the id of the adopted fit, e.g. PK_20261016_185018__3efe3.

required

Returns:

Type Description
Path

The directory of the record in model.fits_dir.

Raises:

Type Description
ValueError

if the id is not the id of a fit (pkpdsim.fit.fit_subset) or its subset has no fit definition.

FileNotFoundError

if the record of the fit has no parameters.json.

adopted_reports

adopted_reports(
    model, output_dir=None, *, mapping_figures=True
)

Write the report of every adopted fit of a model, each from its record.

No fit is run. The report of a record is the report which run_report <package> --subset <subset> --name <fit id> <record>/parameters.json writes for it: the same problem (its id is the subset), the settings the fit ran with, the records of the fit (sbmlsim.fit.cli.report_from_records) and the context of the model (pkpdsim.fit.records_context), i.e. the title, the description of the fit and of its parameters, and the adopted fits whose parameters were fixed as the provenance of the record names them. A record without provenance gives a report which states that the provenance was not recorded and names no fixed fits.

Parameters:

Name Type Description Default
model PKPDModel

the model, its fits are the fits to report.

required
output_dir Path | None

the directory of the reports, model.report_dir by default; every report is written into the folder named by its fit id.

None
mapping_figures bool

create the figures of the fit mappings.

True

Returns:

Type Description
list[Path]

The directories of the reports, in the order of model.fits.

Raises:

Type Description
ValueError

if the model has no adopted fits, or the subset of an adopted fit has no fit definition.

FileNotFoundError

if the record of an adopted fit has no parameters.json.