Skip to content

Commit 6d5b84c

Browse files
committed
set detrend to false and fix documentation to be more specific
1 parent 3571e7b commit 6d5b84c

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

pyspi/calculator.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,15 @@ class Calculator:
3737
configfile (str, optional):
3838
The location of the YAML configuration file for a user-defined subset. See :ref:`Using a reduced SPI set`, defaults to :code:`'</path/to/pyspi>/pyspi/config.yaml'`
3939
detrend (bool, optional):
40-
If True, detrend the dataset along the time axis before normalising (if enabled), defaults to True.
40+
If True, detrend each time series individually along the time axis before normalising (if enabled), defaults to False.
4141
normalise (bool, optional):
42-
If True, z-score normalise the dataset along the time axis before computing SPIs, defaults to True.
43-
Detrending (if enabled) is always applied before normalisation.
42+
If True, z-score normalise each time series in the MTS dataset individually along the time axis before computing SPIs, defaults to True.
4443
"""
4544
_optional_dependencies = None
4645

4746
def __init__(
4847
self, dataset=None, name=None, labels=None, subset="all", configfile=None,
49-
detrend=True, normalise=True
48+
detrend=False, normalise=True
5049
):
5150
self._spis = {}
5251
self._excluded_spis = list()
@@ -511,7 +510,7 @@ def init_from_list(self, datasets, names, labels, **kwargs):
511510
self.add_calculator(calc)
512511

513512
def init_from_yaml(
514-
self, document, detrend=True, normalise=True, n_processes=None, n_observations=None, **kwargs
513+
self, document, detrend=False, normalise=True, n_processes=None, n_observations=None, **kwargs
515514
):
516515
datasets = []
517516
names = []

pyspi/data.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ class Data:
4242
dim_order (str, optional):
4343
Order of dimensions, accepts two combinations of the characters 'p', and 's' for processes and observations, defaults to 'ps'.
4444
detrend (bool, optional):
45-
If True, detrend the dataset along the time axis before normalising (if enabled), defaults to True.
45+
If True, detrend each time series individually along the time axis before normalising (if enabled), defaults to False.
4646
normalise (bool, optional):
47-
If True, z-score normalise the dataset along the time axis before computing SPIs, defaults to True.
48-
Detrending (if enabled) is always applied before normalisation.
47+
If True, z-score normalise each time series in the MTS dataset individually along the time axis before computing SPIs, defaults to True.
4948
name (str, optional):
5049
Name of the dataset
5150
procnames (list, optional):
@@ -61,7 +60,7 @@ def __init__(
6160
self,
6261
data=None,
6362
dim_order="ps",
64-
detrend=True,
63+
detrend=False,
6564
normalise=True,
6665
name=None,
6766
procnames=None,

0 commit comments

Comments
 (0)