Skip to content

Commit

Permalink
mark failing test as full run test, drop print commands used to diagn…
Browse files Browse the repository at this point in the history
…ose issue
  • Loading branch information
jdebacker committed Apr 20, 2018
1 parent 1c2d596 commit 552a763
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 3 additions & 1 deletion ogusa/tests/test_txfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ def test_replace_outliers():

assert np.allclose(act, exp)


@pytest.mark.full_run # only marking as full run because platform
# affects results from scipy.opt that is called in this test - so it'll
# pass if run on Mac with MKL, but not necessarily on other platforms
def test_txfunc_est():
# Test txfunc.txfunc_est() function. The test is that given
# inputs from previous run, the outputs are unchanged.
Expand Down
11 changes: 0 additions & 11 deletions ogusa/txfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,6 @@ def txfunc_est(df, s, t, rate_type, tax_func_type, numparams,
lb_max_y = np.maximum(min_y, 0.0) + 1e-4
bnds = ((1e-12, None), (1e-12, None), (1e-12, None), (1e-12, None),
(lb_max_x, 0.8), (lb_max_y, 0.8), (0, 1))
print('Param_init = ', params_init)
print('mins and shift = ', np.array([min_x, min_y, shift]))
print('Data means = ', X.mean(), Y.mean(), txrates.mean(), wgts.mean())
print('Tax func type etc = ', tax_func_type, rate_type)
params_til = opt.minimize(wsumsq, params_init, args=(tx_objs),
method="L-BFGS-B", bounds=bnds, tol=1e-15)
Atil, Btil, Ctil, Dtil, max_x, max_y, share = params_til.x
Expand All @@ -847,7 +843,6 @@ def txfunc_est(df, s, t, rate_type, tax_func_type, numparams,
shift_x = np.maximum(-min_x, 0.0) + 0.01 * (max_x - min_x)
shift_y = np.maximum(-min_y, 0.0) + 0.01 * (max_y - min_y)
params = np.zeros(numparams)
print('Raw param estimates = ', np.array([Atil, Btil, Ctil, Dtil]))
params[:4] = (np.array([Atil, Btil, Ctil, Dtil]) /
np.array([X2bar, Xbar, Y2bar, Ybar]))
params[4:] = np.array([max_x, min_x, max_y, min_y, shift_x, shift_y,
Expand Down Expand Up @@ -1009,12 +1004,6 @@ def txfunc_est(df, s, t, rate_type, tax_func_type, numparams,
fig.savefig(fullpath, bbox_inches='tight')
plt.close()

print('Params = ', params)
print('wsse = ', wsse)
print('obs = ', obs)
print('tax function type = ', tax_func_type)
print('Checking Y = ', Ybar, Y2bar)
# quit()
return params, wsse, obs


Expand Down

0 comments on commit 552a763

Please sign in to comment.