release¶
The release of a model repository, see Release of a model repository. The release is sbmlsim's (sbmlsim.release), a model package uses its release settings (sbmlsim.release.settings); pkpdsim adds its release hook and the command pkpd_release, whose function is main, release is the release as a function.
What pkpdsim adds to the release of a model repository, the release hook.
The release of a model package is sbmlsim's (sbmlsim.release, the kind
release of python -m sbmlsim.run and python -m sbmlsim.release
publish); pkpd_release runs both (pkpdsim.release.cli). The release
settings of a model name HOOK by default
(pkpdsim.model.PKPDReleaseSettings.hook), which adds the content of the
pharmacokinetic models:
- the evidence of the extensions of pkpdsim on the page of the credibility
(
pkpdsim.credibility): the ratio pairs and the temporal validation of a context of use after its acceptance table, the inputs of its decisive mappings between its parameter uncertainty and its variability and the study data of the adopted fits with the records of their collection from pkdb_data after the sections of sbmlsim, the templates ofpkpdsim/resources/release; the rule of the ratio pairs is the row(ratio pairs)of the acceptance table and the rules of the other extensions are left out of it, they have tables of their own, as pkpdsim 0.19 showed them; - the study of a file of the data,
<substance>/<study>for a file of the folderdata/<substance>/<study>of the package, so the release notes name the studies as pkpdsim 0.19 named them.
The framework of the release, pkpdsim, and its core libraries are the
defaults of the release settings of a model,
pkpdsim.model.PKPDReleaseSettings. The module imports the release of sbmlsim
only for its types.
PKReleaseHook
¶
Bases: ReleaseHook
The release hook of pkpdsim, see the module.
templates
¶
Get the templates of pkpdsim, the parts of the page of the credibility.
Returns:
| Type | Description |
|---|---|
Sequence[Path | Traversable]
|
|
Sequence[Path | Traversable]
|
|
Sequence[Path | Traversable]
|
|
credibility
¶
Add the evidence of the extensions of pkpdsim to the page of the credibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
assessment
|
CredibilityAssessment
|
the assessment of the contexts of use of the release. |
required |
data
|
dict[str, Any]
|
the data of the page as sbmlsim shows it. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
|
dict[str, Any]
|
every context of use the ratio pairs ( |
dict[str, Any]
|
validation ( |
dict[str, Any]
|
and its acceptance rows of the core followed by the ones of the |
dict[str, Any]
|
ratio pairs, named |
data_study
¶
Get the study of a file of the data, <substance>/<study>.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
PurePosixPath
|
the data folder of the file relative to the root of the
package, e.g. |
required |
path
|
PurePosixPath
|
the path of the file relative to |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
|
str | None
|
of the package, e.g. |
str | None
|
file, which belongs to no study. |
The command pkpd_release: the complete release of a model repository.
pkpd_release pkdb_models.models.hctz --version 0.8.0 --no-publish
pkpd_release pkdb_models.models.hctz --version 0.8.0
pkpd_release pkdb_models.models.hctz --repo ../hctz-model --version 0.8.0
The release is sbmlsim's (sbmlsim.release) with the release settings and the
release hook of pkpdsim (pkpdsim.model.PKPDReleaseSettings,
pkpdsim.release.hook); the command runs its two steps:
- The build, the kind
releaseof the run layer of sbmlsim (sbmlsim.run.release_kinds,python -m sbmlsim.release build), into an output (--out, by default<repository>-release-<version>next to the checkout of the release repository): the release repository is cloned into<out>/repository, from the checkout (--repo, by default the sibling of the source repository named like the release repository) when it exists, which is only read, else from GitHub, and the release is built there (export of the model package, project files, models, simulations, fit reports, credibility, release notes, docs, manifest). - The publishing (
python -m sbmlsim.release publish): commit, tag, GitHub Pages, push, Docker image and GitHub release from<out>/repository; afterwards the checkout is fast-forwarded to the release when it is clean and onmain.
--no-publish stops before the commit, so the build can be reviewed; a later
run without the flag publishes the reviewed build without building it again. A
run which failed while publishing is finished by running the same command
again. See release for the order of the steps.
default_out
¶
Get the default output of the build of a release.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checkout
|
Path
|
the checkout of the release repository, which need not exist. |
required |
version
|
str
|
the version of the release. |
required |
local
|
bool
|
a build with a local pkpdsim ( |
False
|
Returns:
| Type | Description |
|---|---|
Path
|
|
Path
|
a build with a local pkpdsim. |
release
¶
release(
model,
*,
version,
repo,
publish,
pkpdsim_path,
workers,
out=None,
runner=run,
publisher=publish,
)
Make the complete release of a model repository.
The steps, in order; the first failure stops the release:
- Checks, before anything is built: the version is
X.Y.Z, a local pkpdsim only without publishing, the release settings of the model are complete, the model is the model object of its package (the kind loads it by its reference,pkpdsim.cli.project_reference), the source repository is clean (source_repo); when publishing, the model declares its COMBINE archive and docker, its buildx plugin andghare ready (check_tools), so a missing tool fails before the long build. - The build, the kind
releaseof sbmlsim intoout, which clones the release repository intoout/repository(from the checkoutrepowhen it exists, else from GitHub) and checks it, the version and the records of the adopted fits, seesbmlsim.release.workflow.execute_release. It is skipped if a publishing run finds a publishable build of this release in the output (sbmlsim.release.workflow.publishable: a reviewed--no-publishbuild, or the release commit of a publishing which failed half way); an earlier build of the same spec in the output is built again (a resume of the run layer). --no-publishstops here, before the commit.- The publishing of the build of the output
(
sbmlsim.release.workflow.publish_release,publisher), then the checkout is fast-forwarded to the release when it is clean and onmain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
PKPDModel
|
the model which is released, with its release settings. |
required |
version
|
str
|
the version of the release, |
required |
repo
|
Path | None
|
the checkout of the release repository, default is a sibling of the source repository named like the release repository; only read, and fast-forwarded after publishing. |
required |
publish
|
bool
|
publish the release; |
required |
pkpdsim_path
|
Path | None
|
a local checkout of pkpdsim instead of the released
pkpdsim, only without |
required |
workers
|
str
|
the number of workers of the simulations, |
required |
out
|
Path | None
|
the output of the build, |
None
|
runner
|
Runner
|
runs git, uv, the analyses of the model, docker and gh. |
run
|
publisher
|
Publisher
|
publishes the built release. |
publish
|
Returns:
| Type | Description |
|---|---|
Path
|
The release repository of the build, |
Raises:
| Type | Description |
|---|---|
ReleaseError
|
if a check or a step fails; the message is for the user. |
main
¶
The console script pkpd_release, see release.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argv
|
Sequence[str] | None
|
the command line arguments, |
None
|
Raises:
| Type | Description |
|---|---|
SystemExit
|
with 2 for a usage error, with 1 if the release fails. |