Skip to main content

Installation

Prerequisites

  • Python 3.9+ (3.11+ recommended)
  • TensorFlow 2.18+ (installed automatically)

Install from PyPI

historymatching is published on PyPI, so the usual one-liner works:

pip install historymatching

Add optional extras as needed — notebooks for the tutorial notebooks, mac for Metal GPU acceleration on Apple Silicon:

pip install "historymatching[notebooks]"
pip install "historymatching[notebooks,mac]"

If you use uv, uv pip install historymatching is a faster drop-in replacement for pip install. And if you maintain your own project with a pyproject.toml, uv add historymatching installs it and records it as a dependency there.

NoteApple Silicon (Metal GPU)

The mac extra installs the TensorFlow Metal plugin for GPU acceleration. Note that Cholesky decomposition (used internally by GPflow) is not yet implemented on Metal, so GPR training falls back to CPU for that operation.

Verify installation

import historymatching as hm

engine = hm.HistoryMatching(
    bounds={'x': (0, 1)},
    observations={'y': (0.5, 0.1)},
)
print(engine)  # Should print engine status