Skip to content
Snippets Groups Projects
Commit a13aa4e1 authored by Niklas Selke's avatar Niklas Selke
Browse files

Updated everything to the v0.3.0 release.

parent d4b4a037
No related branches found
No related tags found
No related merge requests found
# Changelog # Changelog
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## v0.2.0 - 2022-01-03 - second experimental release of the package ## v0.3.0 - 2022-12-20 - quantile regression, new package structure
### general:
* added trend detection methods
* restructured the package
* performance enhancements
### new features:
* added quantile regression
* added ordinary least squares regression
### technical:
* added new tests for better coverage
* use series objects internally
* metrics and trends are subpackages of toarstats
## v0.2.0 - 2022-01-03 - new interface, user input checks
### general: ### general:
* new interface: calculate_statistics * new interface: calculate_statistics
...@@ -13,7 +29,7 @@ All notable changes to this project will be documented in this file. ...@@ -13,7 +29,7 @@ All notable changes to this project will be documented in this file.
### technical: ### technical:
* constants and defaults are in their own separate modules * constants and defaults are in their own separate modules
## v0.1.0 - 2021-09-05 - first experimental release of the package ## v0.1.0 - 2021-09-05 - first experimental release, 50 metrics included
### general: ### general:
* first working version is implemented * first working version is implemented
......
...@@ -121,3 +121,38 @@ calculate_statistics( ...@@ -121,3 +121,38 @@ calculate_statistics(
missing in the ``metadata`` argument missing in the ``metadata`` argument
""" """
``` ```
## trends
This subpackage contains a collection of regression methods.
### Import
To use the package import `calculate_trend` with:
```
from toarstats.trends import calculate_trend # or
from toarstats.trends import * # or
import toarstats.trends
```
### Interface
The `calculate_trend` interface is defined like this:
```
calculate_trend(method, data, formula="value ~ datetime", quantiles=None):
"""Calculate the trend using the requested method.
This function is the public interface for the ``trends`` subpackage.
It takes all the user inputs and returns the result of the requested
trend analysis.
:param method: either ``"OLS"`` or ``"quant"``
:param data: data containing a list of date time values and
associated parameter values on which to calculate the
trend
:param formula: the formula specifying the model
:param quantiles: a single quantile or a list of quantiles to
calculate, these must be between 0 and 1; only
needed when ``method="quant"``
"""
```
File added
# Configuration file for the Sphinx documentation builder. # Configuration file for the Sphinx documentation builder.
# #
# This file only contains a selection of the most common options. For a full # For the full list of built-in configuration values, see the documentation:
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html # https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'toarstats' project = 'toarstats'
copyright = '2021, Forschungszentrum Jülich GmbH' copyright = '2021, Forschungszentrum Jülich GmbH'
author = 'Niklas Selke' author = 'Niklas Selke'
release = '0.3.0'
# The full version, including alpha/beta/rc tags # -- General configuration ---------------------------------------------------
release = '0.2.0' # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
import os
import sys
# -- General configuration --------------------------------------------------- sys.path.insert(0, os.path.abspath('..'))
# Add any Sphinx extension module names here, as strings. They can be extensions = ['sphinx.ext.autodoc']
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc'
]
# 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 ------------------------------------------------- # -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#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 = 'alabaster' html_theme = 'alabaster'
# 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']
...@@ -3,6 +3,8 @@ Welcome to toarstats's documentation! ...@@ -3,6 +3,8 @@ Welcome to toarstats's documentation!
.. autofunction:: toarstats.metrics.interface.calculate_statistics .. autofunction:: toarstats.metrics.interface.calculate_statistics
.. autofunction:: toarstats.trends.interface.calculate_trend
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
:caption: Contents: :caption: Contents:
......
numpy==1.22.0 numpy==1.24.0
pandas==1.3.5 pandas==1.5.2
statsmodels==0.13.5
[metadata] [metadata]
name = toarstats name = toarstats
version = 0.2.0 version = 0.3.0
author = Niklas Selke author = Niklas Selke
author_email = n.selke@fz-juelich.de author_email = n.selke@fz-juelich.de
description = Collection of statistics for the TOAR community description = Collection of statistics for the TOAR community
...@@ -8,17 +8,23 @@ long_description = file: README.md ...@@ -8,17 +8,23 @@ long_description = file: README.md
long_description_content_type = text/markdown long_description_content_type = text/markdown
url = https://gitlab.jsc.fz-juelich.de/esde/toar-public/toarstats url = https://gitlab.jsc.fz-juelich.de/esde/toar-public/toarstats
classifiers = classifiers =
Development Status :: 4 - Beta
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.6 Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.10
License :: OSI Approved :: MIT License Programming Language :: Python :: 3.11
Operating System :: OS Independent
[options] [options]
packages = toarstats packages =
python_requires = >=3.6 toarstats
toarstats/metrics
toarstats/trends
python_requires = >=3.7
install_requires = install_requires =
pandas>=1.0 pandas>=1.0
statsmodels>=0.13
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment