Skip to main content

A package to compute distances between curves.

Project description

FrechetLib

A library for computing Frechet distances between curves, and other associated quantities. This is a Python version of the FrechetDist julia package.

Development Status

This library is in an alpha state. Most functions have some degree of testing, but not extensively.

Examples

import time

from frechetlib.continuous_frechet import frechet_c_approx
from frechetlib.data import FrechetDownloader

downloader = FrechetDownloader()
big_curve_1 = downloader.get_curve("11/poly_a.txt")
big_curve_2 = downloader.get_curve("11/poly_b.txt")

print(big_curve_1.shape)
print(big_curve_2.shape)
# NOTE Run twice to factor out the compilation time from the timing.
frechet_c_approx(big_curve_1, big_curve_2, 1.01)
print("Starting")

start = time.perf_counter()
res, morphing = frechet_c_approx(big_curve_1, big_curve_2, 1.01)
end = time.perf_counter()

print("Approximated Frechet distance: ", morphing.dist)
print("Time taken (s): ", end - start)

API

The package API is currently minimal and undocumented for now. See the test cases for usage examples. This will be filled out more later.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frechetlib-0.1.1.tar.gz (17.7 kB view hashes)

Uploaded Source

Built Distribution

frechetlib-0.1.1-py3-none-any.whl (19.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page