Skip to main content

Python bindings for RATS, a rust crate for Rapid Augmentations for Time Series.

Project description

RATSpy

License ReadTheDocs

RATSpy provides Python bindings for RATS, a rust crate for Rapid Augmentations for Time Series on univariate time series data.

Installation

Install the package using PyPI

pip install ratspy

Python version 3.8+ is required.

Usage

Example to reconstruct the surface from an input file, apply some post-processing methods and write the data back to a file:

import ratspy as rp
import numpy as np

# Dataset from https://timeseriesclassification.com/dataset.php
data = pd.read_csv("./data/Car/Car.csv").to_numpy()

x = data[:,:-1].astype(np.float64)
y = list(map(lambda a: str(a), data[:,-1]))

dataset = rp.Dataset(x, y)

addnoise = rp.AddNoise(rp.NoiseType.Slope, bounds=(0.01, 0.05))
# Only execute the AddNoise augmenter for half of the series in the dataset
addnoise.probability = 0.5

pipeline = (rp.AugmentationPipeline()
            + rp.Repeat(10)
            + rp.Crop(100)
            + addnoise
            + rp.Jittering(0.1))

pipeline.augment_batch(dataset, parallel=True)

# Access augmented data using dataset.features and dataset.labels

Development notes

Manual Build instructions

  1. Clone the repository
  2. cd to the ratspy directory
  3. Install all required Python packages from requirements.txt in a virtual environment of your choice: pip install -r requirements.txt
  4. Now, to build the project, use maturin: maturin develop -r
    • Maturin automatically installs the resulting binary in your Python environment

Stub file generation

To automatically generate a stub file (ratspy.pyi) for the package, run cargo run --bin stub_gen.

This will expose Rust documentation comments to the Python side as docstrings.

Sphinx Documentation

To generate the Sphinx documentation, make sure that the package is installed through, e.g., maturin, and then run make html in the docs directory. The resulting HTML files will be in docs/_build/html.

You also need to install the documentation dependencies from docs/requirements.txt.

Tests

To test the installation of ratspy in your venv and run some initial tests, we provide unit tests for each of ratspy's classes as well as the entire pipeline in the /tests directory.

Run the following commands to run tests:

cd tests
python -m unittest test_RATSpy

Benchmarking

In benchmarking/ are scripts that automatically benchmark this library against the Python-native library tsaug. Which augmenters should be benchmarked can be configured using the benchmarking/augmenter_configs.yaml file.

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

ratspy-0.1.0a3.tar.gz (53.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (735.3 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARMv7l

ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (835.6 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux2014_armv7l.manylinux_2_17_armv7l.whl (717.3 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARMv7l

ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (809.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (735.9 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARMv7l

ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (835.6 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux2014_armv7l.manylinux_2_17_armv7l.whl (717.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARMv7l

ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (809.7 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

ratspy-0.1.0a3-cp38-abi3-win_amd64.whl (680.9 kB view details)

Uploaded CPython 3.8+Windows x86-64

ratspy-0.1.0a3-cp38-abi3-win32.whl (480.6 kB view details)

Uploaded CPython 3.8+Windows x86

ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (941.9 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (786.1 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (736.1 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARMv7l

ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (838.1 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

ratspy-0.1.0a3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (924.9 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

ratspy-0.1.0a3-cp38-abi3-manylinux2014_i686.manylinux_2_17_i686.whl (769.0 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

ratspy-0.1.0a3-cp38-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl (717.7 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARMv7l

ratspy-0.1.0a3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (812.2 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

ratspy-0.1.0a3-cp38-abi3-macosx_11_0_arm64.whl (750.0 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

ratspy-0.1.0a3-cp38-abi3-macosx_10_12_x86_64.whl (846.4 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file ratspy-0.1.0a3.tar.gz.

File metadata

  • Download URL: ratspy-0.1.0a3.tar.gz
  • Upload date:
  • Size: 53.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for ratspy-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 5a30aa5db7260da6c022e9c17a36ba3f57f49092033484150da06c56f0e98328
MD5 b196ebcb7af52688cc257661d31bc5c9
BLAKE2b-256 af3fb3f22117a57ab4fa05d8c636b4d656cee2ac0e40df9b825d635a8f2c9699

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 c42e4459899bea85ba244be5a96868dd1033ec4c38ee8bdb832fddb08cee1221
MD5 0c936f53a3c0429640f73dcd213ff4dc
BLAKE2b-256 98ee2f81150c5b74d8eb0e097f2cb6037f22ea698428d34853cedb8617acbbb8

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f02da0b27d9155452f21c5909700f0290119fdd44eb6ce5a5878394bd1eb20f6
MD5 dff1a19665486b9722da37ce93100d20
BLAKE2b-256 bea9d0ae8f4fe82c16d155f17f9f7a06af21eba3c2fa85ee5c7a9f56a8448d74

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux2014_armv7l.manylinux_2_17_armv7l.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
Algorithm Hash digest
SHA256 875468f6cbc9b83b8fbc995dcaffaaea09cae345317f284742aaba4b45d244a5
MD5 703505ae5a0293a81b902fc3e2a76a9b
BLAKE2b-256 f1c54b94df0a5927e7b8bbeaefe9b16a2f7d5b26aead5ce9f37055fec1ecbb44

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-pp310-pypy310_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 82c706b0d6ae309e65dee87f32500d669bbe14afeb1c87effbeb9ea931f65f1d
MD5 19168cdacd57df68aff3baabb82714f5
BLAKE2b-256 c2452eb9d9969f829a51a18fed5866f6b2851a519e330edd51cf50db31cb7ebf

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 25cde96eed746d7b997c118dcf291440de2020c2ec3b367440f8fbd0288b3a34
MD5 213f68e065e55168a0aadefaac41a382
BLAKE2b-256 76b9885e38f036671661596686e5cbf232bd84a1fe62c9119b56fa980bc86759

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ae8c592aa8c10159fef05caa94d536bc258679b5a71db4b070adbb865df15552
MD5 b04b2ac0399240a6bcba25e89972289a
BLAKE2b-256 0397160ed86a88fb0d5d419ec380f86ec8a90855aa108b017f75103554f18f22

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux2014_armv7l.manylinux_2_17_armv7l.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
Algorithm Hash digest
SHA256 d7e36342006db272fd95565963eea5e698e0cd5e56af3a55e72b923516e3aa33
MD5 60a8f51c46caa034e5e379baba4cbe2f
BLAKE2b-256 db3dc8e5ac706f5aafe6a8ede0020b8520feb347f232213c0364d1d2bc063316

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-pp39-pypy39_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 be2c6fa1c7bd57ffcbbe94121f4244bfcf0efe25ac4873d735632dcfbc2a8d28
MD5 fb13d3437ea1ade2074c55bac69da376
BLAKE2b-256 8417bd1cfaba7d52f291b05ae4d2a7a2d9a85492f8505d44c82b3a6d482e69c2

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: ratspy-0.1.0a3-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 680.9 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4e9c6319c61e16f12af8aba9eaa4cac802cbc448c5cdf850ec8e470b6f2cc6bb
MD5 d3110abecc2386630d891828ab33239e
BLAKE2b-256 645a05a8309812384b5964aaf27378712f74f80d1e0c05e36ee3cf505c9212db

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-win32.whl.

File metadata

  • Download URL: ratspy-0.1.0a3-cp38-abi3-win32.whl
  • Upload date:
  • Size: 480.6 kB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 89975d5681ce190b4ecb72fff78a4e662968ebf825bc478f7fe81150f9476406
MD5 30c48df19fe941ed5f5b099cfc600161
BLAKE2b-256 a92b6bbdfaa68357a3026b292c597d53be1bff3e272a19341f3e27ee52aac66f

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac6321b75f6d648601d1cebce0ec862485be70338ec0a503ddba0287097319c5
MD5 74c350a3d27f69ddf7996904df949ca9
BLAKE2b-256 323d3de5c37db6bf9e87d813e4b4e96098e4860b4750feb42eba2298408f4850

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 dcd248ab203d59a030026a7bccd62e2402618517e44797348938f175d1a4e7d2
MD5 40cc31c389e06c6a326354b44cfe428d
BLAKE2b-256 0fecf58b4bcb051ce3581bbeedb3f308d3a65c78078eaed43bc12cef3c2a3c7c

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 686093dde95b98fa83eed9f39701922f0e263fee3acfa296cdbcc74f8745b7be
MD5 5233db3c599d7dbb5f414fa1012cb20a
BLAKE2b-256 c0b4b02405cf1a3a493bb7d16ce27414d2c18b9f48bbb99e4bb6339f8e9337b6

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3be8010227f800e0827cfe347a6de0d6797783235e1ceec9ca312a2f9d5d0d31
MD5 8b02c47c5f464377fc551128ece8af8a
BLAKE2b-256 737494a6e2207b95947f478fae6f606c206eeec8f935dff24596d1d450e1349b

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4ff65565ed88ce85ee22ca450eb061af411c6d04a81d96127b05568dd46be31b
MD5 56c4ba248cfe08e1bbf9c5b750da9390
BLAKE2b-256 9d33a0845317ec2ebd3d97b7dee59e791b6b79db06e4bad92e0e678ca7f841d9

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-manylinux2014_i686.manylinux_2_17_i686.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-manylinux2014_i686.manylinux_2_17_i686.whl
Algorithm Hash digest
SHA256 249f9b9b6944940c5d8ca4b7bd4d2ac1bda4e56cd350bb5a7f3556ce590e6db5
MD5 8dee3a1d6cdc586efe7090bc10381832
BLAKE2b-256 e24c69ea99bd0df8bbf85d244b9d6e8742b987aac32bace1e61a97d0da5887de

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
Algorithm Hash digest
SHA256 b8e63f54bb0ac3a3caac5d422ad07e43739f8af2ec86c12188c3a0d6a9be479c
MD5 eee054c7c0a58e51edcf6b9fa5d1b215
BLAKE2b-256 187dcadd99175b5b5dfffdfe4be11870f27d84207f737e71f5eedaa9ae4eaeee

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 feac86f08f82cd386ce734839ecab85f149a434e58eadc5c5a9f6dd9b0ca398b
MD5 75a5992bed374a614135b24692cc99c2
BLAKE2b-256 fc1078d5b2bcf2e83e824ce5b75322e2e2985632fa6e8a1db362aad7583484c6

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 889d438cc5bfe878de4cdfee4ea7edbf9d73fffb968566476dbad0fdb6932a41
MD5 60160111d56f6db9c9458a64ba60665c
BLAKE2b-256 aae34e12ffcb547c9c81cca0d502e8792674690f47a5cbeaeb4de8fa56aee606

See more details on using hashes here.

File details

Details for the file ratspy-0.1.0a3-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ratspy-0.1.0a3-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ab8dee7253b7598b7f9aff965248508bbd3a63647f94a784d16088cf4cd7979e
MD5 e3661c22c0d6756b33e68a741f3f9461
BLAKE2b-256 90748aa9e75bc706a9292b1cff865f4f52019b249d5ee69e366fd1a50820a662

See more details on using hashes here.

Supported by

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