Skip to content

datasig-ac-uk/pysegments

Repository files navigation

PySegments

Tools for working with intervals and dyadic segmentation in Python.

Installation

For now, the only way to install this package is to download from GitHub and build from source. This can be done using pip.

python3 -m pip install git+https://github.com/datasig-ac-uk/pysegments.git

Example usage

The segment function in this module can be used to perform dyadic segmentation of a base interval to isolate the parts of this interval for which a characteristic function return true. These "parts" are generated by partitioning the base interval into dyadic intervals of given length, and then removing those dyadic intervals on which the characteristic function is not constantly 1. A simple example of its use is as follows.

from pysegments import Interval, segment

def char_function(interval):
    return interval.inf >= 0.3 and interval.sup <= 0.752

base = Interval(-5, 5)
segments = segment(base, char_function, 2)
# segments = [Interval(0.50000, 0.750000)]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published