Skip to content

Commit

Permalink
Minor typing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxschmaltz authored Jun 22, 2023
1 parent b968268 commit adea2a7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 26 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# MarChie: a Compact Open Source Tool for Analyzing Discrete **Mar**kov **Ch**ains

[![Generic badge](https://img.shields.io/badge/PyPI-0.1-green.svg)](https://pypi.org/project/MarChie/)
[![Generic badge](https://img.shields.io/badge/GitHub-Source-red.svg)](https://github.com/maxschmaltz/MarChie)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)
[![Generic badge](https://img.shields.io/badge/PyPI-0.3-green.svg)](https://pypi.org/project/MarChie/) [![Generic badge](https://img.shields.io/badge/GitHub-Source-red.svg)](https://github.com/maxschmaltz/MarChie) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)


----------
Expand Down Expand Up @@ -70,18 +67,18 @@ Given transition probability matrix and (optional) initial state probability dis

## Quick Start

`March` is a `pip`-installable package. You can access it directly from PyPI:
`Marchie` is a `pip`-installable package. You can access it directly from PyPI:

```bash
pip install MarChie
pip install marchie
```

The main object that is really intended to be used is `class marchie.marchie.March`. The class requires only transition probability matrix and (optionally) initial state probability distribution vector as arguments; if you provide no initial distribution vector, it will be generated.
The main object that is really intended to be used is `class marchie.marchie.Marchie`. The class requires only transition probability matrix and (optionally) initial state probability distribution vector as arguments; if you provide no initial distribution vector, it will be generated.

```python

>>> import numpy as np
>>> from marchie.marchie import March
>>> from marchie import Marchie

>>> trans_mat = np.array([
[1, 0, 0 ],
Expand Down
34 changes: 17 additions & 17 deletions marchie/marchie.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
init_distr : `March._matrix` of shape (`n_states`, )
init_distr : `Marchie._matrix` of shape (`n_states`, )
distribution vector
'''

Expand All @@ -172,7 +172,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
trans_mat : `March._matrix` of shape (`n_states`, `n_states`)
trans_mat : `Marchie._matrix` of shape (`n_states`, `n_states`)
transition matrix
'''

Expand All @@ -185,7 +185,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
adjacency_mat : `March._matrix` of shape (`n_states`, `n_states`)
adjacency_mat : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating one-step paths between states,
where `adjacency_mat[i, j]` is \(1\) if the probability of tranition
from the state `i` to the state `j` is not zero, else \(0\)
Expand Down Expand Up @@ -215,7 +215,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
reachability_mat : `March._matrix` of shape (`n_states`, `n_states`)
reachability_mat : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating paths between states,
where `reachability_mat[i, j]` is \(1\) if there is a path
from the state `i` to the state `j`, else \(0\)
Expand Down Expand Up @@ -245,7 +245,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
reachability_mat_tr : `March._matrix` of shape (`n_states`, `n_states`)
reachability_mat_tr : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating paths between states,
where `reachability_mat_tr[i, j]` is \(1\) if there is a path
from the state `j` to the state `i`, else \(0\)
Expand Down Expand Up @@ -275,7 +275,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
communication_mat : `March._matrix` of shape (`n_states`, `n_states`)
communication_mat : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating bidirectional paths between states,
where `communication_mat[i, j]` is \(1\) if there is a path
from the state `j` to the state `i` and from `j` to `i`, else \(0\)
Expand Down Expand Up @@ -306,7 +306,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
communication_mat_comp : `March._matrix` of shape (`n_states`, `n_states`)
communication_mat_comp : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating absence of bidirectional paths between states,
where `communication_mat[i, j]` is \(1\) if there is no path
from the state `j` to the state `i` and from `j` to `i`, else 0
Expand All @@ -333,7 +333,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
classification_mat : `March._matrix` of shape (`n_states`, `n_states`)
classification_mat : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix where `classification_mat[i, j]` is \(1\) if there is a path
from the state `i` to the state `j` but states `j` and `i` do not communicate, 0 otherwise
Expand Down Expand Up @@ -362,7 +362,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
classification_mat_ext : `March._matrix` of shape (`n_states`, `n_states` + 1)
classification_mat_ext : `Marchie._matrix` of shape (`n_states`, `n_states` + 1)
boolean-like matrix where the last column indicates essentiality of states:
if classification_mat_ext[`i`, `n_states` + 1] equals 1, the state `i`
is inessential, if 0, is essential
Expand All @@ -389,7 +389,7 @@ def canonical(self) -> np.ndarray:
Returns
-------
equivalency_cls_mat : `March._matrix` of shape (`n_classes`, `n_essential`)
equivalency_cls_mat : `Marchie._matrix` of shape (`n_classes`, `n_essential`)
matrix showing belonging of each essential (!) state to its equivalence class;
`equivalency_cls_mat[i, j]` indicates that the state `j` is in `i`th equivalence class
Expand Down Expand Up @@ -1083,7 +1083,7 @@ def _adjacency_mat(self) -> np.ndarray:
Returns
-------
adjacency_mat : `March._matrix` of shape (`n_states`, `n_states`)
adjacency_mat : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating one-step paths between states,
where `adjacency_mat[i, j]` is \(1\) if the probability of tranition
from the state `i` to the state `j` is not zero, else \(0\)
Expand Down Expand Up @@ -1118,7 +1118,7 @@ def _reachability_mat(self) -> np.ndarray:
Returns
-------
reachability_mat : `March._matrix` of shape (`n_states`, `n_states`)
reachability_mat : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating paths between states,
where `reachability_mat[i, j]` is \(1\) if there is a path
from the state `i` to the state `j`, else \(0\)
Expand Down Expand Up @@ -1160,7 +1160,7 @@ def _reachability_mat_tr(self) -> np.ndarray:
Returns
-------
reachability_mat_tr : `March._matrix` of shape (`n_states`, `n_states`)
reachability_mat_tr : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating paths between states,
where `reachability_mat_tr[i, j]` is \(1\) if there is a path
from the state `j` to the state `i`, else \(0\)
Expand Down Expand Up @@ -1194,7 +1194,7 @@ def _communication_mat(self) -> np.ndarray:
Returns
-------
communication_mat : `March._matrix` of shape (`n_states`, `n_states`)
communication_mat : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating bidirectional paths between states,
where `communication_mat[i, j]` is \(1\) if there is a path
from the state `j` to the state `i` and from `j` to `i`, else \(0\)
Expand Down Expand Up @@ -1229,7 +1229,7 @@ def _communication_mat_comp(self) -> np.ndarray:
Returns
-------
communication_mat_comp : `March._matrix` of shape (`n_states`, `n_states`)
communication_mat_comp : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix indicating absence of bidirectional paths between states,
where `communication_mat[i, j]` is \(1\) if there is no path
from the state `j` to the state `i` and from `j` to `i`, else 0
Expand Down Expand Up @@ -1261,7 +1261,7 @@ def _classification_mat(self) -> np.ndarray:
Returns
-------
classification_mat : `March._matrix` of shape (`n_states`, `n_states`)
classification_mat : `Marchie._matrix` of shape (`n_states`, `n_states`)
boolean-like matrix where `classification_mat[i, j]` is \(1\) if there is a path
from the state `i` to the state `j` but states `j` and `i` do not communicate, 0 otherwise
Expand Down Expand Up @@ -1294,7 +1294,7 @@ def _classification_mat_ext(self) -> np.ndarray:
Returns
-------
classification_mat_ext : `March._matrix` of shape (`n_states`, `n_states` + 1)
classification_mat_ext : `Marchie._matrix` of shape (`n_states`, `n_states` + 1)
boolean-like matrix where the last column indicates essentiality of states:
if classification_mat_ext[`i`, `n_states` + 1] equals 1, the state `i`
is inessential, if 0, is essential
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name='marchie',
version='0.1',
version='0.3',
author='Max Schmaltz',
author_email='[email protected]',
description=desc,
Expand Down

0 comments on commit adea2a7

Please sign in to comment.