From 3b22c43e4d8eb5dc8f93df8336874822b6550dd7 Mon Sep 17 00:00:00 2001 From: Niklas Selke <n.selke@fz-juelich.de> Date: Tue, 13 Sep 2022 16:43:00 +0200 Subject: [PATCH] Adapted the interface of the trends subpackage. --- toarstats/trends/interface.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/toarstats/trends/interface.py b/toarstats/trends/interface.py index 138acf1..d2787cd 100644 --- a/toarstats/trends/interface.py +++ b/toarstats/trends/interface.py @@ -1,22 +1,25 @@ """This module contains the public interface for the trends subpackage. This module contains the following function: -calculate_quantile_regression - calculate the quantile regression +calculate_trend - calculate the trend using the requested method """ import statsmodels.formula.api as smf -def calculate_quantile_regression(quantiles, data): - """Calculate the quantile regression. +def 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 - quantile regression. + trend analysis. - :param quantiles: a single quantile or a list of quantiles to - calculate, these must be between 0 and 1 + :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 - quantile regression + 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"`` """ -- GitLab