{"id":28719854,"url":"https://github.com/artesiawater/traval","last_synced_at":"2025-06-15T06:05:52.088Z","repository":{"id":46530706,"uuid":"266096618","full_name":"ArtesiaWater/traval","owner":"ArtesiaWater","description":":chart_with_upwards_trend: Tools for applying automatic error detection schemes to timeseries","archived":false,"fork":false,"pushed_at":"2025-04-11T10:10:44.000Z","size":1250,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-13T21:05:09.863Z","etag":null,"topics":["automatic","binary-classification","comparison","error-detection","timeseries","validation","visualization"],"latest_commit_sha":null,"homepage":"https://traval.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtesiaWater.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-22T11:43:44.000Z","updated_at":"2025-04-11T10:08:29.000Z","dependencies_parsed_at":"2024-03-22T11:40:59.134Z","dependency_job_id":"dd7a6566-df8d-45a2-8938-375956f8b888","html_url":"https://github.com/ArtesiaWater/traval","commit_stats":{"total_commits":134,"total_committers":2,"mean_commits":67.0,"dds":0.007462686567164201,"last_synced_commit":"44b63d15209b33dace30c5952e2f527702824901"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/ArtesiaWater/traval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtesiaWater%2Ftraval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtesiaWater%2Ftraval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtesiaWater%2Ftraval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtesiaWater%2Ftraval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtesiaWater","download_url":"https://codeload.github.com/ArtesiaWater/traval/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtesiaWater%2Ftraval/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259929969,"owners_count":22933535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automatic","binary-classification","comparison","error-detection","timeseries","validation","visualization"],"created_at":"2025-06-15T06:05:51.036Z","updated_at":"2025-06-15T06:05:52.071Z","avatar_url":"https://github.com/ArtesiaWater.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![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\u0026amp;utm_medium=referral\u0026amp;utm_content=ArtesiaWater/traval\u0026amp;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\u0026utm_medium=referral\u0026utm_content=ArtesiaWater/traval\u0026utm_campaign=Badge_Coverage)\n![PyPI](https://img.shields.io/pypi/v/traval)\n\n# traval\n\nTools for applying automatic error detection algorithms to time series.\n\n## Introduction\n\nThis module is set up to provide tools for applying any error detection\nalgorithm to any time series. The module consists of three main components:\n\n- `RuleSet`: the RuleSet object is a highly flexible object for defining error\n  detection algorithms based on (user-defined) functions.\n- `Detector`: a data management object for storing time series and error detection\n  results.\n- `SeriesComparison*`: objects for comparing time series. These objects include plots\n 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 time series data and optionally time series representing the\n   \"truth\" to see how well the algorithms perform.\n3. Initialize Detector objects and apply algorithms to time series.\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: `\u003cyour path here\u003e/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\nimport traval\n```\n\nThe first step is generally to define an error detection algorithm. This is\ndone with the `RuleSet` object:\n\n```python\nruleset = 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\nruleset.add_rule(\n    \"rule1\",\n    traval.rulelib.rule_ufunc_threshold,\n    apply_to=0,\n    kwargs={\"ufunc\": (np.greater,), \"threshold\": 10.0}\n)\n```\n\nTake a look at the ruleset by just typing `ruleset`:\n\n```python\nruleset\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 time series\nand the intermediate and final results after applying an error detection\nalgorithm. Initialize the Detector object with some time series. In this example\nwe assume there is a time series called `raw_series`:\n\n```python\n\u003e\u003e\u003e detect = traval.Detector(raw_series)\n```\n\nApply our first algorithm to the time series.\n\n```python\n\u003e\u003e\u003e 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\u003e\u003e\u003e 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\u003e\u003e\u003e cp.plots.plot_series_comparison()  # plot a comparison\n\u003e\u003e\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartesiawater%2Ftraval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartesiawater%2Ftraval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartesiawater%2Ftraval/lists"}