Skip to content

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 of pkpdsim/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 folder data/<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

templates()

Get the templates of pkpdsim, the parts of the page of the credibility.

Returns:

Type Description
Sequence[Path | Traversable]

TEMPLATES, with docs/credibility-acceptance.md.j2,

Sequence[Path | Traversable]

docs/credibility-uncertainty.md.j2 and

Sequence[Path | Traversable]

docs/credibility-sections.md.j2.

credibility

credibility(assessment, data)

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]

data with the study data of the adopted fits (studies), and for

dict[str, Any]

every context of use the ratio pairs (ratios), the temporal

dict[str, Any]

validation (temporal) and the inputs (inputs) of its sections,

dict[str, Any]

and its acceptance rows of the core followed by the ones of the

dict[str, Any]

ratio pairs, named ratio pairs.

data_study

data_study(data_dir, path)

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. data/hctz.

required
path PurePosixPath

the path of the file relative to data_dir.

required

Returns:

Type Description
str | None

<substance>/<study> for a file below data/<substance>/<study>

str | None

of the package, e.g. hctz/Beermann1976; None for any other

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:

  1. The build, the kind release of 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).
  2. 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 on main.

--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

default_out(checkout, version, *, local=False)

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 (--pkpdsim-path), which is never published and gets an output of its own.

False

Returns:

Type Description
Path

<checkout>-release-<version> next to the checkout, with -local for

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:

  1. 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 and gh are ready (check_tools), so a missing tool fails before the long build.
  2. The build, the kind release of sbmlsim into out, which clones the release repository into out/repository (from the checkout repo when it exists, else from GitHub) and checks it, the version and the records of the adopted fits, see sbmlsim.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-publish build, 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).
  3. --no-publish stops here, before the commit.
  4. 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 on main.

Parameters:

Name Type Description Default
model PKPDModel

the model which is released, with its release settings.

required
version str

the version of the release, X.Y.Z.

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; False stops before the commit.

required
pkpdsim_path Path | None

a local checkout of pkpdsim instead of the released pkpdsim, only without publish.

required
workers str

the number of workers of the simulations, auto (the CPUs of the quota) or a number.

required
out Path | None

the output of the build, default_out of the checkout by default (an output of its own for a build with a local pkpdsim).

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, out/repository.

Raises:

Type Description
ReleaseError

if a check or a step fails; the message is for the user.

parser

parser()

Get the parser of the command pkpd_release.

main

main(argv=None)

The console script pkpd_release, see release.

Parameters:

Name Type Description Default
argv Sequence[str] | None

the command line arguments, sys.argv[1:] by default.

None

Raises:

Type Description
SystemExit

with 2 for a usage error, with 1 if the release fails.