Conventions

Package Imports

We use the following conventions when organising dependencies in pyhctsa:
  • Standard python libraries (first), third party imports (next), local imports (last)

  • Within each section, imports are listed alphabetically for easier scanning.

# Standard python libraries
import time
from typing import union

# third-party imports
import numpy as np
import pandas as pd

# local imports
from pyhctsa.operations.physics import walker

Naming Conventions

pyhctsa follows the standard PEP 8 style guide. Specifically:

Docstring Conventions

Below is an example of the docstring convention for feature-computing functions in pyhctsa:

def feature_function(x : ArrayLike) -> float:
    """
    Description of the function including what it computes.
    Reference to literature provided with [1].
    Also see [2] for supporting literature.

    References
    ----------
    .. [1] Moore, J.B., "Supporting literature", IEEE, 2026.
    .. [2] Moore, J.B., "Second source", IEEE, 2026.

    Parameters
    ----------
    x : array-like
        Time series data.

    Returns
    -------
    float
        The feature value as a scalar.
    """
    x = np.asarray(x)
    x += 0.1
    out = np.mean(x)
    return out