This release is a pre-release and may not be stable for production use.
CoFI (Common Framework for Inference)
Introduction
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!
Installation
From PyPI:
$ pip install cofi
Or alternatively, from conda-forge:
$ conda install -c conda-forge cofi
Check CoFI documentation - installation page for details on dependencies and setting up with virtual environments.
Basic Usage
CoFI API has flexible ways of defining an inversion problem. For instance:
from cofi import BaseProblem
inv_problem = BaseProblem()
inv_problem.set_objective(my_objective_func)
inv_problem.set_initial_model(my_starting_point)
Once a problem is defined, cofi can tell you what inference tools you can use based on what level of
information you've provided:
inv_problem.suggest_tools() # a tree will be printed
Run an inversion with these lines:
from cofi import InversionOptions, Inversion
inv_options = InversionOptions()
inv_options.set_solving_method("optimization")
inv_options.set_params(options={"maxiter":100})
inv = Inversion(inv_problem, inv_options)
result = inv.run()
print(result.success)
print(result.model)
And now an inversion is completed! Check out our example gallery and tutorial pages for more real-world or advanced use cases.
Contributing
Interested in contributing? Please check out our contributor's guide.
Licence
This project is distributed under a 2-clause BSD licence. A copy of this licence is provided with distributions of the software.
Metadata
Release files for cofi 0.1.3.dev0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cofi-0.1.3.dev0.tar.gz | 44.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cofi-0.1.3.dev0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 90.3 kB
Release files / cofi-0.1.3.dev0.tar.gz
| Download URL | cofi-0.1.3.dev0.tar.gz |
|---|---|
| Size | 44.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4dcc1b414f267ad83408a01c79fd5f01a9c322d9610293d019da0233406793c1
|
|
BLAKE2b-256 checksum How to use checksums |
2c2edf36447655783b6622009d2c02fb98d1e96510346e07767b3297249d3c98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|
Release files / cofi-0.1.3.dev0-py3-none-any.whl
| Download URL | cofi-0.1.3.dev0-py3-none-any.whl |
|---|---|
| Size | 45.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6fc0a73501250fc59c242f67a6c16d31ce50650ff1e1188016dc96f722efdac
|
|
BLAKE2b-256 checksum How to use checksums |
773d80e5fe13a6ba02d4ec816b3fe88d7afa3ebe209053e73404a6630bb42c1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|