This is a python wrapper of the bw package's C++ implementation of the Dynamic Weight Change model from Hall et al. for adults.
Specifically, this package provides Python bindings via C++ shimming for the adult_weight and energy_build functions. See the original package for comprehensive documentation.
You can install the package via uv:
uv add git+https://github.com/nestauk/ahl_dwc.git --tag v0.1.0Or develop locally by cloning the repo and running uv sync.
shim.hppcontains the necessary shims to replace Rcpp functionality with standard C++ and pybind11 equivalents, this is entirely new code.bindings.cppcontains the pybind11 bindings for the two functions we are exposing, this is entirely new code.adult_weight.cppis identical to the version in thebwpackage.adult_weight.hhas been modified very slightly to useshim.hpp(the main new code insrc) to replace the references tomath.handRcpp.hin the original version. The actual structure ofadult_weight.his near identical to the original though.energy_build.cppis identical to the version in thebwpackage.