Skip to content

Commit dfa8461

Browse files
committed
update function documentation for detrending
1 parent 4a12a5c commit dfa8461

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

pyspi/calculator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ 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-
Detrend the dataset along the time axis before computing SPIs, defaults to True.
40+
If True, detrend the dataset along the time axis before normalising (if enabled), defaults to True.
4141
normalise (bool, optional):
42-
Normalise the dataset along the time axis before computing SPIs, defaults to True.
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.
4344
"""
4445
_optional_dependencies = None
4546

pyspi/data.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ 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, data is detrended along the time dimension, defaults to True.
45+
If True, detrend the dataset along the time axis before normalising (if enabled), defaults to True.
4646
normalise (bool, optional):
47-
If True, data is z-scored (normalised) along the time dimension, defaults to True.
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.
4849
name (str, optional):
4950
Name of the dataset
5051
procnames (list, optional):

tests/test_SPIs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def compute_new_tables():
2424
benchmark_dataset = load_benchmark_dataset()
2525
# Compute new tables on the benchmark dataset
2626
np.random.seed(42)
27-
calc = Calculator(dataset=benchmark_dataset)
27+
calc = Calculator(dataset=benchmark_dataset, normalise=True, detrend=True)
2828
calc.compute()
2929
table_dict = dict()
3030
for spi in calc.spis:

0 commit comments

Comments
 (0)