There seems to be some crazy change in the multiindex logic that causes the alpha_s code to produce different results.
~/n/n/validphys2 (master) $ py.test (vp2)
================================================ test session starts =================================================
platform linux -- Python 3.6.4, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /home/zah/nngit/nnpdf/validphys2, inifile:
plugins: hypothesis-3.38.5
collected 3 items
src/validphys/tests/test_tableloader.py F. [ 66%]
src/validphys/tests/test_utils.py . [100%]
====================================================== FAILURES ======================================================
________________________________________________ test_min_combination ________________________________________________
def test_min_combination():
nan = np.nan
dfdicts = [
{('NNPDF31_nlo_as_0130_uncorr__combined',
'chi2'): {('NMC', 'NMC', 204, 394): nan, ('NMC',
'NMC',
204,
400): 679.78465060721771, ('NMC', 'NMCPD', 121, 394): nan, ('NMC',
'NMCPD',
121,
400): 226.73557951005108, ('NMC', 'Total', 325, 394): nan, ('NMC',
'Total',
325,
400): 906.52023011726862, ('SLAC', 'SLACD', 34, 394): nan, ('SLAC',
'SLACD',
34,
400): 55.48265988454024, ('SLAC', 'SLACP', 33, 394): nan, ('SLAC',
'SLACP',
33,
400): 56.765548408772041, ('SLAC', 'Total', 67, 394): nan, ('SLAC',
'Total',
67,
400): 110.50940462648715}},
{('NNPDF31_nlo_as_0130_uncorr__combined', 'chi2'):
{('NMC', 'NMC', 204, 394): 572.89990139102679, ('NMC','NMC', 204,
400): 643.10896957499369, ('NMC',
'NMCPD',
121,
394): 228.66185589823439, ('NMC', 'NMCPD', 121, 400): 232.87411189255329, ('NMC',
'Total',
325,
394): 801.56175728926098, ('NMC',
'Total',
325,
400): 875.98308146754709, ('SLAC', 'SLACD', 34, 394): 62.071957514383364, ('SLAC',
'SLACD',
34,
400): 44.278821773436725, ('SLAC',
'SLACP',
33,
394): 70.465557968855123, ('SLAC', 'SLACP', 33, 400): 57.213453384186352, ('SLAC',
'Total',
67,
394): 126.25943979466223, ('SLAC', 'Total', 67, 400): 101.69776217874313}},
]
dfs = [pd.DataFrame.from_dict(df) for df in dfdicts]
res = tableloader.combine_pseudorreplica_tables(dfs, ['NNPDF31_nlo_as_0130_uncorr__combined'], )
assert pd.isnull(res.loc[pd.IndexSlice[:,:,:,394],:]).all().all()
assert (res.loc[pd.IndexSlice[:,:,:,400],:] == dfs[1].loc[pd.IndexSlice[:,:,:,400],:]).all().all()
res2 = tableloader.combine_pseudorreplica_tables(
dfs, ['NNPDF31_nlo_as_0130_uncorr__combined'], min_points_required=1)
> assert not pd.isnull(res2.loc[pd.IndexSlice[:,:,:,394],:]).all().all()
E assert not True
E + where True = <bound method Series.all of NNPDF31_nlo_as_0130_uncorr__combined chi2 True\ndtype: bool>()
E + where <bound method Series.all of NNPDF31_nlo_as_0130_uncorr__combined chi2 True\ndtype: bool> = NNPDF31_nlo_as_0130_uncorr__combined chi2 True\ndtype: bool.all
E + where NNPDF31_nlo_as_0130_uncorr__combined chi2 True\ndtype: bool = <bound method DataFrame.all of NNPDF31_nlo_as_0130_uncorr__combined\n ... True\n SLACP 33 394 True\n Total 67 394 True>()
E + where <bound method DataFrame.all of NNPDF31_nlo_as_0130_uncorr__combined\n ... True\n SLACP 33 394 True\n Total 67 394 True> = NNPDF31_nlo_as_0130_uncorr__combined\n chi2\nNMC N... True\n SLACP 33 394 True\n Total 67 394 True.all
E + where NNPDF31_nlo_as_0130_uncorr__combined\n chi2\nNMC N... True\n SLACP 33 394 True\n Total 67 394 True = <function isna at 0x7f0dc7648ea0>( NNPDF31_nlo_as_0130_uncorr__combined\n chi2\nNMC N... NaN\n SLACP 33 394 NaN\n Total 67 394 NaN)
E + where <function isna at 0x7f0dc7648ea0> = pd.isnull
src/validphys/tests/test_tableloader.py:60: AssertionError
================================================== warnings summary ==================================================
src/validphys/tests/test_tableloader.py::test_extrasum_slice
/home/zah/nngit/nnpdf/validphys2/src/validphys/tableloader.py:54: FutureWarning: from_csv is deprecated. Please use read_csv(...) instead. Note that some of the default arguments are different, so please refer to the documentation for from_csv when changing your function calls
return sane_load(filename, header=[0,1], index_col=[0,1])
-- Docs: http://doc.pytest.org/en/latest/warnings.html
=================================== 1 failed, 2 passed, 1 warnings in 1.78 seconds ===================================
The same tests pass with exactly the same environment except for downgrading pandas to 0.20.
I need to look into this in some detail, but it seems clear that it's pandas breaking its API here. So in summary:
In total the bads are very bad and the good don't compensate. I still need to understand this.