From deef6c4994bf088fb4a44b533ea1f27cbc4598a4 Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Fri, 14 Oct 2016 08:48:38 +0200 Subject: [PATCH] Added doctest to check_random_state and added ci_quantile and ci_sf to FitDistribution --- wafo/misc.py | 22 ++++++++++++++++------ wafo/stats/estimation.py | 36 +++++++++++++++++++++++------------- wafo/tests/test_misc.py | 1 - 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/wafo/misc.py b/wafo/misc.py index 859c116..2ea77b0 100644 --- a/wafo/misc.py +++ b/wafo/misc.py @@ -21,7 +21,6 @@ from numdifftools.extrapolation import dea3 # @UnusedImport from wafo.plotbackend import plotbackend from collections import Callable import numbers - try: from wafo import c_library as clib # @UnresolvedImport except ImportError: @@ -54,6 +53,17 @@ def check_random_state(seed): If seed is an int, return a new RandomState instance seeded with seed. If seed is already a RandomState instance, return it. Otherwise raise ValueError. + + Example + ------- + >>> check_random_state(seed=None) + >> check_random_state(seed=1) + >> check_random_state(seed=np.random.RandomState(1)) +