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 1.0.0

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 1.0.0
File Size Uploaded
smoek-1.0.0.tar.gz 50.8 kB Details

Built distribution (wheel)

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

Total release size: 114.0 kB

Release files / smoek-1.0.0.tar.gz

Download URL smoek-1.0.0.tar.gz
Size 50.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7f56ed37de21831e4117b9c11bc60dfc3b8590c11f31b664e15b2f7e7d1ebbd0
BLAKE2b-256 checksum
How to use checksums
2563aa9a7a5081a9a60b03a6e418571c2a5acfc646cef5618083fa7152a1ba0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / smoek-1.0.0-py3-none-any.whl

Download URL smoek-1.0.0-py3-none-any.whl
Size 63.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e4ee40c2f624196af7ff437346a0bce86f04c6c71f6460ed226b9743d152de3
BLAKE2b-256 checksum
How to use checksums
2fabca63204528200e64cf3b7bda0474ff62af5042ee665f587826f5f68753ca
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

2.0.1

2 release files

This release

1.0.0 This release

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