Skip to main content

A lightweight optimization modeling library.


CI codecov Documentation Status Python 3.10+ GitHub contributors Merged PRs Code style: black

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.

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)

Source distribution for smoek 2.0.1
File Size Uploaded
smoek-2.0.1.tar.gz 50.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smoek 2.0.1
File Interpreter ABI Platform
smoek-2.0.1-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page