Multi-dimensional Experimental Run GENerator: space-filling Design of Experiments for Python.
What is Mergen?
Every experimental study works under a fixed budget: only a limited number of runs can be afforded, and each one should be as informative as possible. Mergen selects those runs. Given a parameter space (its bounds, resolution, constraints and critical regions), it computes the coordinates of n points that spread evenly through the space, so that no region is left unexplored and no run is wasted.
The result is not a random sample but a mathematically optimised design, delivered together with a statistical quality report suitable for the methods section of a paper. Mergen handles the spaces real studies actually have: mixed factor types, forbidden regions, runs that already exist, and zones that deserve extra attention.
Features
- Factor types: discrete, continuous (linear or log), integer, nominal and ordinal, freely mixed in one space, with feasibility constraints.
- Design control: prescribed points, focus regions, exclusion zones, named extra sets, and resuming from an existing design.
- Optimisation: seven space-filling criteria (including recent
developments such as uMaxPro and the stratified L2-discrepancy)
and three optimisers over a discrete-grid Latin-hypercube
structure, with a
compare()sweep for when you are unsure. - Evidence and export: a Monte Carlo quality report, eight plot types, and CSV, JSON, Markdown, LaTeX, HTML and Excel export.
- Sequential workflows: extend, subsample, reorder and nest designs as a campaign grows.
Installation
git clone https://github.com/acanbay/mergen.git
cd mergen
pip install .
The distribution name is mergen-doe; the import name is mergen.
Requires Python 3.9 or newer; the core dependencies (NumPy, SciPy,
pandas, matplotlib) are installed automatically.
Quick start
from mergen import ParameterSpace, Sampler
space = ParameterSpace({
'temperature': range(100, 500, 10), # discrete
'pressure': ('continuous', 0.5, 5.0), # continuous grid
'n_layers': ('integer', 2, 10), # integer grid
})
sampler = Sampler(space)
sampler.set_design(n_samples=30)
result = sampler.run()
result.summary()
result.quality_report()
result.plot('pairplot', save=True)
result.to_csv()
Documentation
The full documentation lives at mergen.readthedocs.io. It covers tutorials, task guides, the reasoning behind every choice Mergen asks you to make, an executed gallery of fifteen example studies with their complete output and figures, and the full API reference.
To build the documentation locally (for instance when contributing):
pip install -e ".[docs]"
sphinx-build -b html docs docs/_build/html
then open docs/_build/html/index.html.
Examples
Fifteen complete, runnable studies from different domains live in
examples/, from a five-line quickstart to CFD,
wet-lab and particle-physics campaigns.
Citing
If you use Mergen in academic work, please cite it using the
information in CITATION.cff; GitHub renders it
under the "Cite this repository" button.
License
MIT © Ali Can Canbay
Metadata
Release files for mergen-doe 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mergen_doe-0.1.0.tar.gz | 115.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mergen_doe-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 247.7 kB
Release files / mergen_doe-0.1.0.tar.gz
| Download URL | mergen_doe-0.1.0.tar.gz |
|---|---|
| Size | 115.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7771f5cd7f2763f636cbe99cdb72b267024b373c688df4a69b0710d6262a2ebc
|
|
BLAKE2b-256 checksum How to use checksums |
c2205a2bec07fa5e8b0b7aa0b41b7b9091ef532dfc1dd328afd6a0fe85922440
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|
Release files / mergen_doe-0.1.0-py3-none-any.whl
| Download URL | mergen_doe-0.1.0-py3-none-any.whl |
|---|---|
| Size | 132.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f27b95c19eeb66f21da24c10e2e80eda673a82e3bd88f3e1f403635230f74383
|
|
BLAKE2b-256 checksum How to use checksums |
c8665fd24344a4b7a0db71c14fb38840893fb868024e3cf4f2e472545e2d8310
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|