A Python package for accessing the MPMMine dataset
Project description
mpmmine: A Python package for accessing the MPMMine dataset
The mpmmine library provides a Python API for the MPMMine benchmark dataset. By leveraging native Python structures, it simplifies script development and facilitates seamless integration of the dataset into larger Python projects. MPMMine is a standardized dataset of benchmark problems for Mathematical Programming model mining problems. For the details on the dataset, see the corresponding repository.
Getting started
Installation
To use MPMMine, you need two components: mpmmine package from PyPI and the actual
dataset. To install mpmmine just run standard package installation, e.g., for
pip:
pip install mpmmine
Download the dataset from the releases section of the official repository. We recommend using the SQLite-backed version, as it offers lower latency than direct file-system access while providing a highly-compressed representation.
Usage
from mpmmine.dataset import MPMMine
from pathlib import Path
mpmmine = MPMMine(Path("~/path/to/MPMMine.sqlite").expanduser())
print("Available benchmarks and their statistics: ")
for problem in mpmmine.problems:
for model in problem.models:
for instance in model.instances:
print(f"{instance.full_id}: {len(list(instance.solutions))} solutions, and " +
f"{len(list(instance.non_solutions))} non-solutions")
print("A reference MiniZinc model for benchmark P016M001:")
model = mpmmine["MPMMine-P016M001"]
print(model.mzn) # read MiniZinc code
print("Here's the problem description in natural text:")
print(model.get_description("D001").markdown) # read Markdown
print("Here's another description read using full artifact id:")
print(mpmmine["MPMMine-P016M001D002"].markdown) # read Markdown
print("Here's I001 instance (model parameters):")
print(model.get_instance("I001").dzn) # read MiniZinc data
print("Here's some solutions (variable values):")
for i, solution in enumerate(mpmmine["MPMMine-P016M001I001"].solutions):
if i >= 3:
break
print(f"% {solution.full_id}:\n{solution.dzn}")
print("... and non-solutions:")
for i, non_solution in enumerate(mpmmine["MPMMine-P016M001I001"].non_solutions):
if i >= 3:
break
print(f"% {non_solution.full_id}:\n{non_solution.dzn}")
Development
To build a package run:
python3 -m build
To publish the package in PyPI run:
python3 -m twine upload --skip-existing dist/*
Note that it requires an access token to the PyPI repository to be configured first.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpmmine-0.1.0.20260720.tar.gz.
File metadata
- Download URL: mpmmine-0.1.0.20260720.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64e4cf86672b32a9d2b5ca6da34b305aa223f38108217fffe80d5ee41cf155ac
|
|
| MD5 |
27decff7ae32873c6fa035b018956321
|
|
| BLAKE2b-256 |
0ed0d3b4d12f78e854332004c2196a23096248ca3d97048af1ca55bba3f2c83f
|
File details
Details for the file mpmmine-0.1.0.20260720-py3-none-any.whl.
File metadata
- Download URL: mpmmine-0.1.0.20260720-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b32749234577136d1f867b4cf75f55b758a7e24d6f5ca1e326325d393ce2eff0
|
|
| MD5 |
7350c6e927dd702899c96da22c9ffd5e
|
|
| BLAKE2b-256 |
0bfad2802757cef543445eb9240268dc7180ecb15488a2b85eed28338f95e39a
|