Skip to main content

Common Framework for Inference

Project description

CoFI (Common Framework for Inference)

PyPI version build Documentation Status codecov Slack


CoFI (Common Framework for Inference) is an open-source initiative for interfacing between generic inference algorithms and specific geoscience problems.

With a mission to bridge the gap between the domain expertise and the inference expertise, CoFI provides an interface across a wide range of inference algorithms from different sources, underpinned by a rich set of domain relevant examples.

This project and documentation are under initial development stage. Please feel free to contact us for feedback or issues!


It's optional, but recommended to use a virtual environment:

conda create -n cofi_env python=3.8 scipy
conda activate cofi_env

Install cofi with:

pip install cofi

Basic Usage

CoFI API has flexible ways of defining an inversion problem. For instance:

from cofi import BaseProblem

inv_problem = BaseProblem()

Once a problem is defined, cofi can tell you what inference solvers you can use based on what level of information you've provided:

inv_problem.suggest_solvers()   # a tree will be printed

Run an inversion with these lines:

from cofi import InversionOptions, Inversion

inv_options = InversionOptions()

inv = Inversion(inv_problem, inv_options)
result =

And now an inversion is completed! Check out our example gallery and tutorial pages for more real-world or advanced use cases.


Interested in contributing? Please check out our contributor's guide.


This project is distributed under a 2-clause BSD license. A copy of this license is provided with distributions of the software.

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

cofi-0.1.2.dev6.tar.gz (1.3 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page