From baa5de84ffcae67995736310847e06cd2219709b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 14 Jun 2010 11:37:32 -0400 Subject: [PATCH] Bring hooke.config and hooke.util.peak doctests up to speed --- hooke/config.py | 16 ++++++++++++---- hooke/util/peak.py | 12 ++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/hooke/config.py b/hooke/config.py index 5f9e919..6d9cceb 100644 --- a/hooke/config.py +++ b/hooke/config.py @@ -131,10 +131,18 @@ class HookeConfigParser (configparser.SafeConfigParser): >>> c = HookeConfigParser(paths=DEFAULT_PATHS, ... default_settings=DEFAULT_SETTINGS) >>> c.write(sys.stdout) # doctest: +ELLIPSIS - # Control display appearance: colour, ???, etc. - [display] - colour_ext = None - colour_ret = None + # Default environmental conditions in case they are not specified in + # the force curve data. + [conditions] + # Temperature in Kelvin + temperature = 301 + + # Configure loggers, see + # http://docs.python.org/library/logging.html#configuration-file-format + [loggers] + # Hooke only uses the hooke logger, but other included modules may + # also use logging and you can configure their loggers here as well. + keys = root, hooke ... """ def __init__(self, paths=None, default_settings=None, defaults=None, diff --git a/hooke/util/peak.py b/hooke/util/peak.py index 185f04d..137763b 100644 --- a/hooke/util/peak.py +++ b/hooke/util/peak.py @@ -323,12 +323,12 @@ def above_noise(data, side='both', min_deviations=5.0, mean=None, std=None): -------- >>> data = numpy.arange(-3, 4) - >>> above_noise(data, side='both', min_deviations=1.0, mean=0, std=1.0) - array([ True, False, False, False, False, False, True], dtype=bool) - >>> above_noise(data, side='positive', min_deviations=1.0, mean=0, std=1.0) - array([False, False, False, False, False, False, True], dtype=bool) - >>> above_noise(data, side='negative', min_deviations=1.0, mean=0, std=1.0) - array([ True, False, False, False, False, False, False], dtype=bool) + >>> above_noise(data, side='both', min_deviations=1.1, mean=0, std=1.0) + array([ True, True, False, False, False, True, True], dtype=bool) + >>> above_noise(data, side='positive', min_deviations=1.1, mean=0, std=1.0) + array([False, False, False, False, False, True, True], dtype=bool) + >>> above_noise(data, side='negative', min_deviations=1.1, mean=0, std=1.0) + array([ True, True, False, False, False, False, False], dtype=bool) """ if mean == None: mean = data.mean() -- 2.26.2