Skip to content

Commit

Permalink
renamed secondary_result to boot_result
Browse files Browse the repository at this point in the history
  • Loading branch information
phobson committed Oct 15, 2015
1 parent 5692d0c commit c6af038
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions wqio/algo/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self, inputdata, statfxn=np.median, alpha=0.05, NIter=5000,
self._primary_result = None
self._boot_array = None
self._boot_stats = None
self._secondary_result = None
self._boot_result = None

@property
def boot_array(self):
Expand All @@ -94,17 +94,17 @@ def boot_stats(self):
return self._boot_stats

@property
def secondary_result(self):
if self._secondary_result is None:
self._secondary_result = self.boot_stats.mean()
return self._secondary_result
def boot_result(self):
if self._boot_result is None:
self._boot_result = self.boot_stats.mean()
return self._boot_result

@property
def final_result(self):
if self.use_prelim:
return self.primary_result
else:
return self.secondary_result
return self.boot_result

def _make_bootstrap_array(self):
""" Generate an array of bootstrap sample sets
Expand Down Expand Up @@ -195,7 +195,7 @@ def _eval_BCA(self, primary_result=None, boot_stats=None):

# fall back to the standard percentile method if the results
# don't make any sense
if self.secondary_result < CI[0] or CI[1] < self.secondary_result:
if self.boot_result < CI[0] or CI[1] < self.boot_result:
warnings.warn("secondary result outside of CI", UserWarning)
CI = self._eval_percentile(boot_stats)
else:
Expand Down Expand Up @@ -278,7 +278,7 @@ def __init__(self, inputdata, outputdata, curvefitfxn,
self._primary_result = None
self._boot_array = None
self._boot_stats = None
self._secondary_result = None
self._boot_result = None
self.use_prelim = use_prelim


Expand All @@ -305,17 +305,17 @@ def boot_stats(self):
return self._boot_stats

@property
def secondary_result(self):
if self._secondary_result is None:
self._secondary_result = self.boot_stats.mean()
return self._secondary_result
def boot_result(self):
if self._boot_result is None:
self._boot_result = self.boot_stats.mean()
return self._boot_result

@property
def final_result(self):
if self.use_prelim:
return self.primary_result
else:
return self.secondary_result
return self.boot_result


def BCA(self):
Expand Down
6 changes: 3 additions & 3 deletions wqio/tests/algo_tests/bootstrap_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def test_primary_result(self):
assert_true(hasattr(self.bsStat, 'primary_result'))
assert_equal(self.known_primary, self.bsStat.primary_result)

def test_secondary_result(self):
assert_true(hasattr(self.bsStat, 'secondary_result'))
assert_equal(self.known_secondary, self.bsStat.secondary_result)
def test_boot_result(self):
assert_true(hasattr(self.bsStat, 'boot_result'))
assert_equal(self.known_secondary, self.bsStat.boot_result)

def test_final_result(self):
assert_true(hasattr(self.bsStat, 'final_result'))
Expand Down

0 comments on commit c6af038

Please sign in to comment.