Skip to content

insysbio/CICOBase.py

Repository files navigation

CICOBase.py

CI Python 3.10+ DOI:10.1371/journal.pcbi.1008495

CICOBase.py is the Python port of the CICOBase.jl routines for practical identifiability analysis and confidence interval evaluation.

The upstream Julia implementation lives in CICOBase.jl. That Julia code line was published as LikelihoodProfiler.jl until January 2025; the low-level computational core is now named CICOBase. This repository follows that naming and keeps the historical likelihoodprofiler import path available for compatibility.

Naming and Compatibility

New Python code should import from cicobase:

from cicobase import get_interval

The old top-level import path is still available as a compatibility shim:

from likelihoodprofiler import get_interval

The compatibility shim is intentionally small. New examples, documentation, and tests use cicobase as the primary package name.

Status

This repository was previously tied to a frozen 2019 development environment. The project metadata has been moved to pyproject.toml and the dependencies are now limited to the packages imported by the library:

  • numpy
  • nlopt
  • matplotlib

Runtime package metadata uses compatible version ranges so the library can coexist with user environments. Continuous integration and local development use constraints.txt to keep resolved versions reproducible.

Installation

From a checkout:

python -m venv .venv
.\.venv\Scripts\python -m pip install -U pip setuptools wheel
.\.venv\Scripts\python -m pip install -e .

On macOS or Linux:

python -m venv .venv
. .venv/bin/activate
python -m pip install -U pip setuptools wheel
python -m pip install -e .

For development:

python -m pip install -r requirements-dev.txt

For a reproducible test-only install:

python -m pip install -c constraints.txt -e .[test]

Quick Start

Python uses zero-based parameter indexes. The example below computes the confidence interval for the first parameter component, x[0].

from cicobase import get_interval

def loss(x):
    return 5.0 + (x[0] - 3.0) ** 2 + (x[0] - x[1] - 1.0) ** 2 + 0 * x[2] ** 2

result = get_interval(
    [3.0, 2.0, 2.1],
    0,
    loss,
    "LIN_EXTRAPOL",
    loss_crit=9,
)

result.plot()

Validation

Run the unit test suite:

python -m pytest

Run the test suite in a fresh constrained environment with tox:

tox -e py314

Build the documentation:

sphinx-build -d .doctrees -b html docs site

Build source and wheel distributions:

python -m build
python -m twine check dist/*

The same checks are wired into GitHub Actions for supported Python versions.

Compatibility Notes

  • Supported Python versions are 3.10 and newer.
  • nlopt is a compiled dependency. Modern releases publish wheels for common Python/platform combinations; if a wheel is unavailable for a platform, a local compiler toolchain may be required.
  • CI currently constrains nlopt to 2.10.0 for reproducibility while the package metadata allows any compatible 2.10.x release.
  • The package source and tests intentionally remain close to the historical port. Infrastructure updates should avoid changing numerical behavior unless the change is covered by tests and compared against the Julia upstream.

Documentation

Hosted documentation for this repository is expected at https://insysbio.github.io/CICOBase.py/.

The upstream Julia package is documented at https://insysbio.github.io/CICOBase.jl/latest/.

Citation

Borisov I, Metelkin E (2020) Confidence intervals by constrained optimization: An algorithm and software package for practical identifiability analysis in systems biology. PLoS Computational Biology 16(12): e1008495.

Reference: https://doi.org/10.1371/journal.pcbi.1008495

License

MIT. See LICENSE.

Packages

 
 
 

Contributors