This is PYthon-based repository is for MECHanics of Tissue mechanics. The focus is on flexibility of adding new constitutive models and varying their parameters.
Project description
pyMechT
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.
Documentation
Find the full documentation at https://pymecht.readthedocs.io/en/latest/.
Structure
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
Installation
Step 1 (optional): Create a virtual environment
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)
Step 2: Install via pip
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.Step 2.1 Fork from ankushaggarwal/pymecht
To fork a branch, head to the Github repository and click the fork button in the top right-hand corner.
Step 2.2 Clone the forked repo
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.
Step 2.3 Install developer version of pyMechT
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.
Step 3: Check installation
Ensure that pyMechT has been installed by executing:
pip list
The package and version should be visible in the resulting list.
Contributing to pyMechT
To contribute to the pyMechT framework, install pyMechT using the developer options. All changes should be made to your forked repo. If there is a new feature or bug fix, raise a pull request. In the case that an additional feature is added, a corresponding example and test should be written in the respective python scripts.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pymecht-1.1.2.tar.gz
.
File metadata
- Download URL: pymecht-1.1.2.tar.gz
- Upload date:
- Size: 485.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d965469739de01d9f7a9b2f705e0864b346bec2f5fb4478c7d15635e04e70ead |
|
MD5 | 03eb555311945a9faf8d2e15fa42a34a |
|
BLAKE2b-256 | 80818c02f71c822a7767be9a82a9986374bca155ee84b5f7309d3de1286bcfe5 |
File details
Details for the file pymecht-1.1.2-py3-none-any.whl
.
File metadata
- Download URL: pymecht-1.1.2-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b07a3a21c1c0148b7e43cf59cec4a2f6b29f84f9e6febb5ced4c754f9e04d2e9 |
|
MD5 | c810c29efc007eb9fb34efd8128f6d40 |
|
BLAKE2b-256 | 36c3792cfda49a374492cc607048ebc440585aed9748721e18bad150a487c0db |