Skip to content

mdpiper/pymt_heatf

Repository files navigation

pymt_heatf

This is an example of building a model, written in Fortran and wrapped in Python with the babelizer, with the meson-python build system using only a pyproject.toml file for project metadata.

Build/Install

This is a sketch of how to build and install this project with either conda or pip.

With conda

  1. Create a conda environment from the included environment.yml file and activate it

  2. Build/install the Fortran BMI example

  3. Build/install the project with:

    $ make install

With pip

Make, CMake, and a Fortran compiler are required.

  1. Create a virtual environment

  2. Install the build system requirements through pip:

    $ pip install meson-python meson ninja cython numpy bmipy
  3. Build/install the Fortran BMI specification (it's not installable through pip)

  4. Build/install the Fortran BMI example

  5. Build/install the project with:

    $ make install

Use

Import the standalone project into a Python session:

>>> import pymt_heatf

Import the pymt component:

>>> from pymt.MODELS import HeatModelF

Try the examples in the examples directory.