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_lockwrites 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_differencesnames every evidence whose mappings differ from the lock;check_declarationreports them and the assessment raises aLockMismatchError, 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
¶
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
¶
Get the file of the lock of a project, credibility.lock.json in its root.
selection_lock
¶
Get the mappings of every evidence and limitation of a selection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selections
|
Selections
|
the selection of the declaration, see |
required |
fits
|
FitTable
|
the table of the fits the selection was made on. |
required |
Returns:
| Type | Description |
|---|---|
Lock
|
The sorted mappings, |
Lock
|
evidence, |
write_lock
¶
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, |
read_lock
¶
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
¶
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 ( |
list[str] | None
|
matches the lock, |