pyMechT is a Python package for simulating the mechanical response of soft biological tissues. The ethos of pyMechT is to create simplified virtual experimental setups, rather than finite element analyses. Thus, varying parameters and running simulations is much faster, making it feasible to perform Bayesian inference and Markov Chain Monte Carlo analyses. A short overview is provided in the video below.
Find the full documentation at https://pymecht.readthedocs.io/en/latest/.
pyMechT is a collection of modules for:
MatModel
: defining material modelsSampleExperiment
: simulating experiments, such as uniaxial extension, biaxial extension, and inflation-extension. Simulations can be eitherdisp_controlled
orforce_controlled
ParamDict
: a custom dictionary class of a datastructure calledParam
, which facilitates storing/varying/fitting parametersParamFitter
: fitting parameters to experimental dataRandomParameters
andMCMC
: Bayesian inference by running Monte Carlo (MC) and Markov chain Monte Carlo (MCMC) simulations
This package is developed and maintained by the Computational Biomechanics Research Group at the University of Glasgow.
Required dependencies are:
- matplotlib
- numpy
- pandas
- pyDOE
- scipy
- torch
- sympy
- tqdm
To create an environment in Anaconda, execute:
conda create -n pymecht
To activate this virtual environment, execute:
conda activate pymecht
This is an option, but recommended step. There are other options for create and managing environments (such as venv or virtualenv)
User
pyMechT can be installed directly from PyPI via pip by using:
pip install pymecht
Developer
To install as a devloper, it is recommended to fork from the repo and clone this fork locally.To fork a branch, head to the Github repository and click the fork button in the top right-hand corner.
To clone this repo locally, use the
git clone <repo-address>
where <repo-address>
can be replaced by either the https or ssh addresses of the forked repo.
To install a developer version of pyMechT, navigate to the locally cloned repo and execute:
python setup.py develop
An editable version of pyMechT is now installed. All local changes to the cloned source code files will be reflected when pyMechT is imported.
Ensure that pyMechT has been installed by executing:
pip list
The package and version should be visible in the resulting list.
See the contributing guidelines CONTRIBUTING.md for information on submitting issues and pull requests.