Skip to content

Commit

Permalink
Merge pull request #13 from ArtesiaWater/dev
Browse files Browse the repository at this point in the history
Release v0.5.0
  • Loading branch information
dbrakenhoff authored Aug 15, 2024
2 parents 3dea557 + 008e83b commit 9577964
Show file tree
Hide file tree
Showing 30 changed files with 3,728 additions and 804 deletions.
45 changes: 37 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,60 @@ on:
- master

jobs:
build:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "pip"
cache-dependency-path: pyproject.toml

- name: Install Python dependencies
run: |
pip install .
- name: ruff-lint
uses: chartboost/ruff-action@v1

- name: ruff-format
uses: chartboost/ruff-action@v1
with:
args: "format --check"

test:
needs: lint
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, "3.10", "3.11"]
python-version: [3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[ci]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics
- name: Run pytest
run: |
pytest
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
with:
Expand Down
5 changes: 1 addition & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
install:
Expand Down
59 changes: 29 additions & 30 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
import os
import sys

sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath("."))
from traval import __version__


# -- Project information -----------------------------------------------------

project = 'traval'
copyright = '2021, Artesia'
author = 'Artesia'
project = "traval"
copyright = "2024, Artesia"
author = "Artesia"

# The short X.Y version
version = __version__
Expand All @@ -34,54 +33,54 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'IPython.sphinxext.ipython_console_highlighting', # lowercase didn't work
'sphinx.ext.autosectionlabel',
'nbsphinx',
'nbsphinx_link'
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.mathjax",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"IPython.sphinxext.ipython_console_highlighting", # lowercase didn't work
"sphinx.ext.autosectionlabel",
"nbsphinx",
"nbsphinx_link",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

html_theme_options = {
'display_version': True,
'prev_next_buttons_location': 'bottom',
"display_version": True,
"prev_next_buttons_location": "bottom",
# 'style_external_links': False,
# 'vcs_pageview_mode': '',
# 'style_nav_header_background': 'white',
# Toc options
'collapse_navigation': False,
'sticky_navigation': False,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False,
"collapse_navigation": False,
"sticky_navigation": False,
"navigation_depth": 4,
"includehidden": True,
"titles_only": False,
"github_url": "https://github.com/ArtesiaWater/traval",
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]
8 changes: 6 additions & 2 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ Examples

The following notebooks contain examples showcasing traval.

The first example shows how to apply the tools contained in traval to detect errors in a single timeseries.
The second example shows how the same can be done for a full dataset with lots of timeseries.
- The first example shows how to apply the tools contained in traval to detect errors in
a single time series.
- The second example shows how the same can be done for a full
dataset with lots of time series.
- The third notebook contains small examples for each of the error detection rules
contained in traval.

.. toctree::
:maxdepth: 1
Expand Down
3 changes: 3 additions & 0 deletions docs/examples/ex03_rules.nblink
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "../../examples/notebooks/ex03_testing_rules.ipynb"
}
15 changes: 6 additions & 9 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ Getting Started
Installation
------------

To install traval, a working version of Python 3.7 or 3.8 has to be installed on
your computer. We recommend using the Anaconda Distribution with Python 3.7 as
it includes most of the python package dependencies and the Jupyter Notebook
software to run the notebooks. However, you are free to install any
Python distribution you want.
To install traval, a working version of Python 3.9 or higher has to be installed on
your computer.

To install traval, use:

Expand Down Expand Up @@ -71,18 +68,18 @@ Take a look at the ruleset by just typing `ruleset`:
1: rule1 0
Next define a Detector object. This object is designed to store a timeseries
Next define a Detector object. This object is designed to store a time series
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`:
algorithm. Initialize the Detector object with some time series. In this example
we assume there is a time series called `raw_series`:


.. code:: python
detect = traval.Detector(raw_series)
Apply our first algorithm to the timeseries.
Apply our first algorithm to the time series.

.. code:: python
Expand Down
12 changes: 6 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
Welcome to traval's documentation!
==================================

Python package for applying automatic error detection algorithms to timeseries.
Python package for applying automatic error detection algorithms to time series.

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

- `Detector`: a data management object for storing timeseries and error detection results.
- `Detector`: a data management object for storing time series and error detection results.
- `RuleSet`: the RuleSet object is a highly flexible object for defining error detection algorithms based on (user-defined) functions.
- `SeriesComparison*`: objects for comparing timeseries. These objects include plots for visualizing the comparisons.
- `SeriesComparison*`: objects for comparing time series. 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.
2. Load data, i.e. raw time series data and optionally time series representing the "truth" to see how well the algorithms perform.
3. Initialize Detector objects and apply algorithms to time series.
4. Store and analyze the results.

For more detailed information and examples, please refer to the notebooks in
Expand Down
8 changes: 4 additions & 4 deletions docs/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Rule Library
:members:


Timeseries Comparison
---------------------
Time Series Comparison
----------------------

.. automodule:: traval.ts_comparison
:members:


Timeseries Utilities
--------------------
Time series Utilities
---------------------

.. automodule:: traval.ts_utils
:members:
Expand Down
Loading

0 comments on commit 9577964

Please sign in to comment.