Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deerlab/bootstrap_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def sample():

# Assert that all outputs are strictly numerical
for var in varargout:
if not all(isnumeric(x) for x in var):
if not all(isnumeric(x) for x in np.atleast_1d(var)):
raise ValueError('Non-numeric output arguments by the analyzed function are not accepted.')

# Check that the full bootstrap analysis will not exceed the memory limits
Expand Down
8 changes: 4 additions & 4 deletions test/test_bootstrap_analysis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import numpy as np
from deerlab import dipolarkernel, whitegaussnoise, bootstrap_analysis, snlls
from deerlab import whitegaussnoise, bootstrap_analysis, snlls
from deerlab.dd_models import dd_gauss
from deerlab.utils import assert_docstring

Expand All @@ -25,7 +25,7 @@ def fitfcn_global(ys):

def fitfcn_multiout(yexp):
fit = snlls(yexp,model,[1,3],uq=False)
return fit.nonlin*fit.lin, fit.model
return fit.nonlin*fit.lin, fit.model, fit.nonlin[0]

def fitfcn_complex(yexp):
fit = snlls(yexp,model,[1,3],uq=False)
Expand Down Expand Up @@ -58,10 +58,10 @@ def test_multiple_ouputs():
# ======================================================================
"Check that both bootstrap handles the correct number outputs"

parfit,yfit = fitfcn_multiout(yexp)
parfit,yfit,_ = fitfcn_multiout(yexp)
paruq = bootstrap_analysis(fitfcn_multiout,yexp,model(parfit),10)

assert len(paruq)==2 and all(abs(paruq[0].mean - parfit)) and all(abs(paruq[1].mean - yfit))
assert len(paruq)==3 and all(abs(paruq[0].mean - parfit)) and all(abs(paruq[1].mean - yfit))
# ======================================================================

def test_multiple_datasets():
Expand Down