Conin supports constrained inference and learning for hidden Markov models, Bayesian networks, dynamic Bayesian networks, and Markov networks. It includes native model classes, reusable constraint declarations, HMM learning utilities, examples, and interfaces to optional backends such as pgmpy, Pyomo-compatible solvers, and Toulbar2.
Install Conin from a local checkout with:
python -m pip install -e .
Optional extras are available for documentation, tests, and PGM integrations:
python -m pip install -e .[docs]
python -m pip install -e .[test]
python -m pip install -e .[pgm-all]
Individual PGM extras and solver requirements are described in the backend requirements page in the documentation.
The documentation is published on Read the Docs:
https://conin.readthedocs.io/en/latest/
Useful starting points include:
- Quickstart and installation
- Selected examples
- Backend and optional dependency guide
- Model conversion and I/O
- HMM learning
To build the documentation locally:
python -m pip install -e .[docs]
python -m sphinx -b html doc/sphinx doc/sphinx/_build/html
The generated HTML is written to doc/sphinx/_build/html.
Conin tests can be executed using pytest:
cd conin
pytest .
If the pytest-cov package is installed, pytest can provide coverage statistics:
cd conin
pytest --cov=conin .
The following options list the lines that are missing from coverage tests:
cd conin
pytest --cov=conin --cov-report term-missing .
Note that pytest coverage includes coverage of test files themselves. This gives a somewhat skewed sense of coverage for the code base, but it helps identify tests that are omitted or not executed completely.
