From adea2a7bc2f00fcc5e824126d83e4309cc0a447c Mon Sep 17 00:00:00 2001 From: Max Schmaltz Date: Thu, 22 Jun 2023 11:08:46 +0200 Subject: [PATCH] Minor typing changes --- README.md | 13 +++++-------- marchie/marchie.py | 34 +++++++++++++++++----------------- setup.py | 2 +- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 730e6e5..708ddd4 100644 --- a/README.md +++ b/README.md @@ -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/) ---------- @@ -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 ], diff --git a/marchie/marchie.py b/marchie/marchie.py index 1d51304..f9284e7 100644 --- a/marchie/marchie.py +++ b/marchie/marchie.py @@ -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 ''' @@ -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 ''' @@ -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\) @@ -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\) @@ -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\) @@ -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\) @@ -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 @@ -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 @@ -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 @@ -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 @@ -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\) @@ -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\) @@ -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\) @@ -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\) @@ -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 @@ -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 @@ -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 diff --git a/setup.py b/setup.py index 011e2b3..2b03c53 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name='marchie', - version='0.1', + version='0.3', author='Max Schmaltz', author_email='schmaltzmax@gmail.com', description=desc,