Skip to content

credibility.lock

The lock of the evidence of a credibility declaration: splits fixed in advance.

A validation counts only if its data was set apart before the predictions were seen. The kinds of the mappings (training or validation) are fixed by the records of the adopted fits (sbmlsim.credibility.records); which validation data answers which question is fixed by the declaration, which a modeller can change after looking at a verdict. The lock records the mappings every evidence and every limitation selects, credibility.lock.json in the root of the project (the folder of the model package, lock_path), reviewed in the history of the repository:

  • write_lock writes the selection of a declaration on the table of the fits into an out, never into the package: the new lock is an output which a person or an agent reviews and commits as the lock of the package.
  • lock_differences names every evidence whose mappings differ from the lock; check_declaration reports them and the assessment raises a LockMismatchError, so a changed split is renewed explicitly.

A project without a lock is assessed as before; the record says whether the evidence matched a lock (Provenance.lock).

LockMismatchError

LockMismatchError(problems)

Bases: ValueError

The evidence selects other mappings than the lock of the declaration.

Attributes:

Name Type Description
problems

every evidence which differs, with its added and removed mappings.

Create the error.

Parameters:

Name Type Description Default
problems list[str]

every evidence which differs.

required

lock_path

lock_path(project)

Get the file of the lock of a project, credibility.lock.json in its root.

selection_lock

selection_lock(selections, fits)

Get the mappings of every evidence and limitation of a selection.

Parameters:

Name Type Description Default
selections Selections

the selection of the declaration, see select.

required
fits FitTable

the table of the fits the selection was made on.

required

Returns:

Type Description
Lock

The sorted mappings, fit/experiment/mapping, by the key of the

Lock

evidence, context/name (a limitation of the model /name).

write_lock

write_lock(selections, fits, out)

Write the lock of the evidence of a declaration into an out.

Parameters:

Name Type Description Default
selections Selections

the selection of the declaration.

required
fits FitTable

the table of the fits the selection was made on.

required
out Path

the directory the lock is written into, created if missing; never the package, whose lock is the reviewed copy of it.

required

Returns:

Type Description
Path

The file of the lock, credibility.lock.json of the out.

read_lock

read_lock(project)

Read the lock of a project, None without one.

The format is the one of pkpdsim 0.19, version 1.

Raises:

Type Description
ValueError

if the file is no lock of this version.

lock_differences

lock_differences(project, selections, fits)

Get every evidence whose mappings differ from the lock of the project.

Parameters:

Name Type Description Default
project Project

the project.

required
selections Selections

the current selection of its declaration.

required
fits FitTable

the table of the fits the selection was made on.

required

Returns:

Type Description
list[str] | None

A line per evidence which is new, gone or selects other mappings, with

list[str] | None

the added (+) and removed (-) mappings; empty if the selection

list[str] | None

matches the lock, None if the project has no lock.