Metadata-Version: 2.4
Name: physioblocks
Version: 1.1.3
Dynamic: Author
Dynamic: Author-email
Dynamic: License
Dynamic: License-Expression
Summary: Physioblocks allows the simulation of dynamical models of physiological systems
Project-URL: Homepage, https://github.com/physioblocks/physioblocks
Project-URL: Documentation, https://physioblocks.gitlabpages.inria.fr/physioblocks/
Project-URL: Issues, https://github.com/physioblocks/physioblocks/issues
Project-URL: Discussions, https://github.com/physioblocks/physioblocks/discussions
License-File: licenses/GPL-3.0-only.txt
License-File: licenses/LGPL-3.0-only.txt
Keywords: block diagram,cardiovascular modeling,dynamical systems,physiology
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.10
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: plotly
Requires-Dist: pyarrow
Requires-Dist: regex
Requires-Dist: rich
Requires-Dist: scipy
Provides-Extra: doc
Requires-Dist: sphinx; extra == 'doc'
Requires-Dist: sphinx-rtd-theme; extra == 'doc'
Requires-Dist: sphinxcontrib-tikz; extra == 'doc'
Provides-Extra: quality
Requires-Dist: mypy; extra == 'quality'
Requires-Dist: ruff; extra == 'quality'
Provides-Extra: test
Requires-Dist: coverage; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Provides-Extra: tox
Requires-Dist: tox>=4; extra == 'tox'
Description-Content-Type: text/markdown

# PhysioBlocks

PhysioBlocks allows the simulation of dynamical models of physiological systems.

## User Levels

They are several use cases for PhysioBlocks depending on the user profile:

* __Level 1:__ Configure and run physiological systems simulation (for pre-existing systems)
* __Level 2:__ Create new systems with existing blocks without writing code
* __Level 3:__ Write and add new blocks to the library.

## Principle

* A __Net__ (system) is built from __Nodes__ and __Blocks__ connected by those nodes.
* At each node in the net, connected blocks share __Degrees of Freedom__ (ex: pressure) and send __Fluxes__ that verify Kirchhoff Law.
* __ModelComponents__ concatenate blocks equations to the global system (if necessary, for modularity purposes within the block)

## Interactions

__Level 1:__ Configure and run a simulation : JSON
* Update the model parameters

__Level 2:__ Create Nets : JSON
* Declare the nodes, the blocks, and the block - nodes connections


__Level 3:__ Write and add models to the library: Python
* Declare the quantities to use in the model
* Write the fluxes and equations

## Documentation

Here are the links to the sections of the [full documentation](https://physioblocks.gitlabpages.inria.fr/physioblocks/):
* [Installation](https://physioblocks.gitlabpages.inria.fr/physioblocks/installation.html)
* [User Guide](https://physioblocks.gitlabpages.inria.fr/physioblocks/user_guide.html)
* [Library](https://physioblocks.gitlabpages.inria.fr/physioblocks/library.html)
* [API Reference](https://physioblocks.gitlabpages.inria.fr/physioblocks/api_reference.html)

## Quick start

Complete instructions are available in the [documentation](https://physioblocks.gitlabpages.inria.fr/physioblocks/). This instructions will enable you to launch a reference simulation.

### Installation

This project requires a recent version of python installed.
Then: 
```
    pip install physioblocks
```

### Configuration

To configure PhysioBlocks Launcher:

```
# Create an empty folder where you want to store simulations results.
mkdir $LAUNCHER_FOLDER_PATH$

# Configure the folder
python -m physioblocks.launcher.configure -d $LAUNCHER_FOLDER_PATH$ -v
```

### Launch a simulation

With a Launcher folder configured:

```
# Move to your configured launcher folder
cd $LAUNCHER_FOLDER_PATH$

#  Launch a reference simulation
python -m physioblocks.launcher references/spherical_heart_sim.jsonc -v -t -s QuickStart

# This can take some time.
```


Results will be available in the `$LAUNCHER_FOLDER_PATH$/simulations/QuickStart` series folder:
* the csv file contains the simulation results.
* the html allows you to visualize the results.
* the log and json files are here for debug purposes.