Skip to content

Dymerz/swingingpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swinging Door Algorithm real time compression

This module is the implementation of the swinging door algorithm in Python.

Install

pip install swingingpy

Usage

    from swingingpy import SwingingDoor, Cpoint

    comp_dev = 1
    comp_max = 5
    original = CPoint(0, 0)
    snapshot = None

    sd = SwingingDoor(
        comp_dev=comp_dev, 
        comp_max=comp_max, 
        original=original, 
        snapshot=snapshot
    )

    points = [
        CPoint(1, 0),
        CPoint(2, 5),
        CPoint(3, 6),
    ]

    for p in points:
        point = compressor.check(p)

        if point:
            print(f"Compressed {point}")
        else:
            print(f"Uncompressed {point}")

Sources:

Releases

No releases published

Packages

No packages published