This repository contains the code to build a Python wheel to load the Dakota python module.
pip install itis-dakota
Pre-built wheels are published on PyPI for these platforms, for CPython 3.12–3.14:
| Platform | Wheel tags | Notes |
|---|---|---|
| Linux | manylinux_2_28 (x86_64, aarch64) |
manylinux compatible distributions |
| macOS | macosx_*_arm64, macosx_*_x86_64 |
|
| Windows | win_amd64 |
built in CI with an MSYS2/MinGW-w64 (ucrt64) toolchain; runs on any 64-bit Windows with the Universal CRT (Windows 10/11 out of the box). Not yet on PyPI: these wheels (~80 MB) exceed PyPI's default 60 MB per-file limit, so pip install availability starts after a one-time project limit increase and the next release |
On Windows, install a regular 64-bit CPython from
python.org (or any virtual
environment based on it, e.g. venv or conda); the dakota.exe launcher
and its bundled runtime DLLs are installed next to the interpreter and
need no separate compiler or Visual C++ redistributable. The Windows
"embeddable zip" distribution is untested; use the full installer.
Known limitation: Dakota's binary restart files are not portable across
platforms (Boost archives are native-format checked, e.g. sizeof(long)
differs between Linux and Windows).
After installation, the module can be imported:
import dakota
import dakota.environment as dakenv
And example on how to use the environment module can be found here: https://github.com/snl-dakota/dakota/blob/devel/src/unit/test_dakota_python_env.py
make wheel
dakota.environment is a compiled pybind11 extension, so its type stubs
(stubs/dakota/environment/{__init__.pyi,environment.pyi}) are generated,
not hand-written. After bumping the Dakota version or touching
dakota/src/dakota_python.cpp via a patch, regenerate the stubs, then
commit the result:
make stubs
make stubs builds the wheel first when wheelhouse/ is empty. Commit the
regenerated stubs: the wheel used for generation still ships the previous
ones, and wheels built afterwards bundle the committed stubs.
CI fails (one linux matrix leg) if the committed stubs no longer match the compiled module.
Since Dakota 6.24, studies can be configured directly from JSON instead of
Dakota's legacy keyword input file. Dakota's own Pydantic v2 models for that
JSON format (dakota/python/dakota/spec, source of truth for dakota.json
and the C++ JSON parser) are shipped as dakota.spec, giving IDE
autocomplete/inline docs and real validation without a round-trip to the
online docs:
from dakota.spec.study import DakotaStudy
import dakota.environment as dakenv
study = DakotaStudy(
method=[...],
variables=[...],
responses=[...],
)
dakenv.study(callback, study.model_dump(mode="json", exclude_none=True))dakota.spec is pure Python (no compiled dependency) and is copied
verbatim from the vendored Dakota source on each build, so it stays in
sync with whatever Dakota version this wheel bundles automatically.
Copyright (c) 2023-2026 IT'IS Foundation, Zurich, Switzerland