Skip to content

Commit

Permalink
Merge pull request #22 from kbonney/kld-doccs
Browse files Browse the repository at this point in the history
Documentation updates
  • Loading branch information
tgunda authored Oct 21, 2024
2 parents a29d008 + 212bee5 commit 619e938
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
45 changes: 44 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,50 @@ Python environment.

To get started, we recommend exploring the pyrocs :ref:`tutorials<tutorials>`.

The :ref:`API documentation<apidoc>` provides additional details about the functions included in the package.
Datasets can be analyzed in multiple ways using using functions within pyRoCS.
While most of these datasets are in array formats, they reflect different underlying
structures, with some representing counts of entries and
sequences and other representing summaries of graph-based structures. The below table summarizes
current functionality. Letters in parentheticals indicate which module the function is located:
information theory \(I), bioscience \(B), or complex systems \(C).

.. list-table:: (Module) Functions and Primary Data Inputs
:widths: 25 75
:header-rows: 1

* - (Module) Function
- Primary Data Inputs
* - \(I) discrete_entropy
- Unique entries in a process and associated counts
* - \(I) kl_divergence
- Two arrays of probability distributions
* - \(I) novelty_transience_resonance
- An array of probability distribution
* - \(I) mutual_info
- Two arrays of entries (optional: counts)
* - \(B) affinity
- Matrix of co-occurring variables (optional: weights)
* - \(B) functional_redundancy
- Array of relative abundance and array of symmetric similarities
* - \(B) hill_diversity
- Proportion of individuals in group
* - \(B) hill_shannon
- Proportion of individuals in group
* - \(B) hill_simpson
- Proportion of individuals in group
* - \(C) causal_complexity
- Adjacency matrix of graph structure
* - \(C) cyclomatic_complexity
- Adjacency matrix of graph structure
* - \(C) feedback_density
- Adjacency matrix of graph structure
* - \(C) fluctuation_complexity
- Array of sequenced events
* - \(C) grc
- Adjacency matrix of graph structure

The :ref:`API documentation<apidoc>` provides additional details about the functions
included in the package.

.. toctree::
:maxdepth: 1
Expand Down
4 changes: 2 additions & 2 deletions pyrocs/biosciences/affinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def affinity(data: np.ndarray, weights=None, to_bool=bool) -> float:
results in a binary implementation of affinity within this software.
Args:
data (array)
weights (optional array)
data (array): Matrix of co-occurring variables
weights (optional array): weights for each variable
to_bool: function or type to convert array values to boolean
Returns:
Expand Down
6 changes: 3 additions & 3 deletions pyrocs/complex_systems/causal_complexity.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def cyclomatic_complexity(A : np.ndarray, directed : bool = False) -> float:
higher cyclomatic complexity values).
Args:
A (array)
A (array): Adjacency matrix of graph structure
Returns:
float
'''
Expand Down Expand Up @@ -64,7 +64,7 @@ def feedback_density(A : np.ndarray, directed : bool = False) -> float:
edges are included in one or more feedback loops.
Args:
A (array)
A (array): Adjacency matrix of graph structure
Returns:
float
'''
Expand Down Expand Up @@ -124,7 +124,7 @@ def causal_complexity(A: np.ndarray, directed : bool = False) -> float:
of causal complexity than those systems with lower feedback density.
Args:
A (array)
A (array): Adjacency matrix of graph structure
Returns:
float
'''
Expand Down
2 changes: 1 addition & 1 deletion pyrocs/complex_systems/grc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def grc(A : np.ndarray, directed : bool) -> float:
versa :cite:p:`lakkaraju_complexity_2019`.
Args:
A (array): Square matrix of adjacencies in the network
A (array): Adjacency matrix of graph structure
directed (bool): If true, assume A represents a directed graph (row -> column).
If false, assume A represents an undirected graph.
Returns:
Expand Down
2 changes: 1 addition & 1 deletion pyrocs/information_theory/kl_divergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def novelty_transience_resonance(
thetas_arr (array): rows are topic mixtures
window (int): positive integer defining scale or scale size
Returns:
tuple(array): novelties, transiences, resonances
tuple(array) [novelties, transiences, resonances]
"""

# Find the first and last center speech offset, given window size.
Expand Down

0 comments on commit 619e938

Please sign in to comment.