traval


Nametraval JSON
Version 0.4.0 PyPI version JSON
download
home_pageNone
SummaryPython package for applying automatic error detection algorithms to timeseries. Create custom error detection algorithms to support data validation workflows.
upload_time2024-03-22 12:13:38
maintainerNone
docs_urlNone
authorD.A. Brakenhoff
requires_python>=3.9
licenseNone
keywords hydrology groundwater time series analysis database
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ![traval](https://github.com/ArtesiaWater/traval/workflows/traval/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/traval/badge/?version=latest)](https://traval.readthedocs.io/en/latest/?badge=latest)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d3e9ef5e30724b59a847093daeb6c233)](https://www.codacy.com/gh/ArtesiaWater/traval/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ArtesiaWater/traval&utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/d3e9ef5e30724b59a847093daeb6c233)](https://www.codacy.com/gh/ArtesiaWater/traval/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ArtesiaWater/traval&utm_campaign=Badge_Coverage)
![PyPI](https://img.shields.io/pypi/v/traval)

# traval

Tools for applying automatic error detection algorithms to timeseries.

## Introduction

This module is set up to provide tools for applying any error detection 
algorithm to any timeseries. The module consists of three main components:

-   `RuleSet`: the RuleSet object is a highly flexible object for defining error detection algorithms based on (user-defined) functions.
-   `Detector`: a data management object for storing timeseries and error detection results.
-   `SeriesComparison*`: objects for comparing timeseries. These objects include plots for visualizing the comparisons.

The general workflow consists of the following steps:

1.  Define error detection algorithm(s).
2.  Load data, i.e. raw timeseries data and optionally timeseries representing the "truth" to see how well the algorithms perform.
3.  Initialize Detector objects and apply algorithms to timeseries.
4.  Store and analyze the results.

For more detailed information and examples, please refer to the notebooks in 
the examples directory.

## Installation

To install the traval module, follow these steps:

1.  Clone the repository from GitHub.
2.  Open a terminal and navigate to the module root directory: `<your path here>/traval`
3.  Type `pip install -e .`

## Usage

The basic usage of the module is described below. To start using the module, 
import the package:

```python
>>> import traval
```

The first step is generally to define an error detection algorithm. This is 
done with the `RuleSet` object:

```python
>>> ruleset = traval.RuleSet("my_first_algorithm")
```

Add a detection rule (using a general rule from the library contained within 
the module). In this case the rule states any value above 10.0 is suspect:

```python
>>> ruleset.add_rule("rule1", traval.rulelib.rule_ufunc_threshold , apply_to=0, 
                     kwargs={"ufunc": (np.greater,), "threshold": 10.0})
```

Take a look at the ruleset by just typing `ruleset`:

```python
>>> ruleset
```

```text
RuleSet: 'my_first_algorithm'
  step: name            apply_to
     1: rule1                  0
```

Next define a Detector object. This object is designed to store a timeseries 
and the intermediate and final results after applying an error detection 
algorithm. Initialize the Detector object with some timeseries. In this example 
we assume there is a timeseries called `raw_series`:

```python
>>> detect = traval.Detector(raw_series)
```

Apply our first algorithm to the timeseries.

```python
>>> detect.apply_ruleset(ruleset)
```

By default, the result of each step in the algorithm is compared to the 
original series and stored in the `detect.comparisons` attribute. Take a 
look at the comparison between the raw data and the result of the error 
detection algorithm. 

Since we only defined one step, step 1 represents the final result.

```python
>>> cp = detect.comparisons[1]  # result of step 1 = final result
```

The `SeriesComparison*` objects contain methods to visualize the comparison, 
or summarize the number of observations in each category:

```python
>>> cp.plots.plot_series_comparison()  # plot a comparison
>>> cp.summary  # series containing number of observations in each category
```

For more detailed explanation and more complex examples, see the notebook(s) 
in the examples directory.

## Author

-   D.A. Brakenhoff, Artesia, 2020

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "traval",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "\"D.A. Brakenhoff\" <d.brakenhoff@artesia-water.nl>",
    "keywords": "hydrology, groundwater, time series, analysis, database",
    "author": "D.A. Brakenhoff",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/17/5d/65c0687b944e386b16f8ed2d07c216205fa66627fbfcb0c7e6c0115f2fa0/traval-0.4.0.tar.gz",
    "platform": null,
    "description": "![traval](https://github.com/ArtesiaWater/traval/workflows/traval/badge.svg)\n[![Documentation Status](https://readthedocs.org/projects/traval/badge/?version=latest)](https://traval.readthedocs.io/en/latest/?badge=latest)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d3e9ef5e30724b59a847093daeb6c233)](https://www.codacy.com/gh/ArtesiaWater/traval/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ArtesiaWater/traval&amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/d3e9ef5e30724b59a847093daeb6c233)](https://www.codacy.com/gh/ArtesiaWater/traval/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ArtesiaWater/traval&utm_campaign=Badge_Coverage)\n![PyPI](https://img.shields.io/pypi/v/traval)\n\n# traval\n\nTools for applying automatic error detection algorithms to timeseries.\n\n## Introduction\n\nThis module is set up to provide tools for applying any error detection \nalgorithm to any timeseries. The module consists of three main components:\n\n-   `RuleSet`: the RuleSet object is a highly flexible object for defining error detection algorithms based on (user-defined) functions.\n-   `Detector`: a data management object for storing timeseries and error detection results.\n-   `SeriesComparison*`: objects for comparing timeseries. These objects include plots for visualizing the comparisons.\n\nThe general workflow consists of the following steps:\n\n1.  Define error detection algorithm(s).\n2.  Load data, i.e. raw timeseries data and optionally timeseries representing the \"truth\" to see how well the algorithms perform.\n3.  Initialize Detector objects and apply algorithms to timeseries.\n4.  Store and analyze the results.\n\nFor more detailed information and examples, please refer to the notebooks in \nthe examples directory.\n\n## Installation\n\nTo install the traval module, follow these steps:\n\n1.  Clone the repository from GitHub.\n2.  Open a terminal and navigate to the module root directory: `<your path here>/traval`\n3.  Type `pip install -e .`\n\n## Usage\n\nThe basic usage of the module is described below. To start using the module, \nimport the package:\n\n```python\n>>> import traval\n```\n\nThe first step is generally to define an error detection algorithm. This is \ndone with the `RuleSet` object:\n\n```python\n>>> ruleset = traval.RuleSet(\"my_first_algorithm\")\n```\n\nAdd a detection rule (using a general rule from the library contained within \nthe module). In this case the rule states any value above 10.0 is suspect:\n\n```python\n>>> ruleset.add_rule(\"rule1\", traval.rulelib.rule_ufunc_threshold , apply_to=0, \n                     kwargs={\"ufunc\": (np.greater,), \"threshold\": 10.0})\n```\n\nTake a look at the ruleset by just typing `ruleset`:\n\n```python\n>>> ruleset\n```\n\n```text\nRuleSet: 'my_first_algorithm'\n  step: name            apply_to\n     1: rule1                  0\n```\n\nNext define a Detector object. This object is designed to store a timeseries \nand the intermediate and final results after applying an error detection \nalgorithm. Initialize the Detector object with some timeseries. In this example \nwe assume there is a timeseries called `raw_series`:\n\n```python\n>>> detect = traval.Detector(raw_series)\n```\n\nApply our first algorithm to the timeseries.\n\n```python\n>>> detect.apply_ruleset(ruleset)\n```\n\nBy default, the result of each step in the algorithm is compared to the \noriginal series and stored in the `detect.comparisons` attribute. Take a \nlook at the comparison between the raw data and the result of the error \ndetection algorithm. \n\nSince we only defined one step, step 1 represents the final result.\n\n```python\n>>> cp = detect.comparisons[1]  # result of step 1 = final result\n```\n\nThe `SeriesComparison*` objects contain methods to visualize the comparison, \nor summarize the number of observations in each category:\n\n```python\n>>> cp.plots.plot_series_comparison()  # plot a comparison\n>>> cp.summary  # series containing number of observations in each category\n```\n\nFor more detailed explanation and more complex examples, see the notebook(s) \nin the examples directory.\n\n## Author\n\n-   D.A. Brakenhoff, Artesia, 2020\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python package for applying automatic error detection algorithms to timeseries. Create custom error detection algorithms to support data validation workflows.",
    "version": "0.4.0",
    "project_urls": {
        "documentation": "https://traval.readthedocs.io/en/latest/",
        "homepage": "https://github.com/ArtesiaWater/traval",
        "repository": "https://github.com/ArtesiaWater/traval"
    },
    "split_keywords": [
        "hydrology",
        " groundwater",
        " time series",
        " analysis",
        " database"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae1263e1a7624f8e2859c545ded53bd3156e3b9a98b3fe842dc1312fdae61564",
                "md5": "d4809ea037f705ae2108589a4c9cc6f6",
                "sha256": "7233f0c95bfe967b829c3b55f357a634050bf320458b43fa3a0516af150576df"
            },
            "downloads": -1,
            "filename": "traval-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d4809ea037f705ae2108589a4c9cc6f6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 36953,
            "upload_time": "2024-03-22T12:13:36",
            "upload_time_iso_8601": "2024-03-22T12:13:36.780947Z",
            "url": "https://files.pythonhosted.org/packages/ae/12/63e1a7624f8e2859c545ded53bd3156e3b9a98b3fe842dc1312fdae61564/traval-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "175d65c0687b944e386b16f8ed2d07c216205fa66627fbfcb0c7e6c0115f2fa0",
                "md5": "a48e141850e59a148d93be7bf7e6caef",
                "sha256": "65d84aa3e016967e7a37f8f592af28dc690cda627e62ec5f56b09e0603c5c80e"
            },
            "downloads": -1,
            "filename": "traval-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a48e141850e59a148d93be7bf7e6caef",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 39997,
            "upload_time": "2024-03-22T12:13:38",
            "upload_time_iso_8601": "2024-03-22T12:13:38.419773Z",
            "url": "https://files.pythonhosted.org/packages/17/5d/65c0687b944e386b16f8ed2d07c216205fa66627fbfcb0c7e6c0115f2fa0/traval-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-22 12:13:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ArtesiaWater",
    "github_project": "traval",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "traval"
}
        
Elapsed time: 0.22500s