A lightweight optimization modeling library.
Overview
Smoek is an experimental Python modeling environment that uses a compact abstract model expression to enable fast transformation of model structure, deferred model instantiation, and code generation. Smoek was designed to support lightweight model declarations that can be transformed into back-end implementations such as Pyomo, Poek, Coek, and other modeling languages or specialized solver interfaces. Abstract model descriptions can be written compactly in Python, transformed quickly, and used to generate efficient concrete optimization models in lower-level or performance-oriented modeling systems. The overhead for Smoek declarations and problem transformations is minimal, and low- level modeling libraries like Coek can be leveraged to significantly accelerate model generation.
Installation
Basic Installation
Install smoek with pip:
pip install smoek
With Optional Backends
Smoek supports multiple optimization backends. Install with optional dependencies:
# Install with poek backend
pip install smoek[poek]
# Install with coek backend
pip install smoek[coek]
# Install with all backends
pip install smoek[backends]
Development Installation
For contributors and developers:
git clone https://github.com/sandialabs/smoek.git
cd smoek
conda env create -f dev_environment.yml
conda activate smoek_dev
pip install -e ".[dev]"
See CONTRIBUTING.md for detailed development setup and guidelines.
Requirements
- Python 3.10 or higher
- Pyomo >= 6.0
- munch
- numpy >= 1.20
Testing
Smoek tests can be executed using pytest:
cd smoek
pytest .
If the pytest-cov package is installed, pytest can provide coverage statistics:
cd smoek
pytest --cov=smoek .
The following options list the lines that are missing from coverage tests:
cd smoek
pytest --cov=smoek --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.
Metadata
Release files for smoek 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smoek-2.0.1.tar.gz | 50.8 kB | Without provenance | Details for smoek-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smoek-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for smoek-2.0.1-py3-none-any.whl |
Total release size: 114.0 kB
Release files / smoek-2.0.1.tar.gz
| Download URL | smoek-2.0.1.tar.gz |
|---|---|
| Size | 50.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a52817219fd78ba2817a4934aadca58d8b5786d2c42b19e31dc8f505853ca2d
|
|
BLAKE2b-256 checksum How to use checksums |
7041f79789a0c1fb0a2ef58fa8947ed6e40ffb503d3b6ebe005c1faabaf694a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / smoek-2.0.1-py3-none-any.whl
| Download URL | smoek-2.0.1-py3-none-any.whl |
|---|---|
| Size | 63.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
621896d1186b94221ccce408d8014cc7a6883347d9b2ea5e70339b38f6acfa0b
|
|
BLAKE2b-256 checksum How to use checksums |
b54021258de98f51980ccd6b217cfecf0aaa85dde88a57048ca632ed2bc99dba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for smoek 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.