work around change in pandas 0.20
* tests/core/ltlcross4.test: Replace describe() by agg() to work around a backward incompatible change in pandas 0.20.
This commit is contained in:
parent
ae0e84ac9e
commit
526b299de8
1 changed files with 15 additions and 29 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
|
||||
# Copyright (C) 2012-2014, 2017 Laboratoire de Recherche et
|
||||
# Développement de l'Epita (LRDE).
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
|
|
@ -40,49 +40,35 @@ cat >test.py <<EOF
|
|||
import sys
|
||||
try:
|
||||
import pandas
|
||||
import numpy as np
|
||||
except ImportError:
|
||||
sys.exit(77)
|
||||
|
||||
x = pandas.read_csv("output.csv")
|
||||
# We used to call describe() instead of agg(),
|
||||
# but the output of this function was changed
|
||||
# in pandas 0.20.
|
||||
print(x.filter(('formula', 'tool',
|
||||
'states', 'transitions')).groupby('tool').describe())
|
||||
'states', 'transitions')).\
|
||||
groupby('tool').\
|
||||
agg([np.mean, np.std, np.min, np.max]))
|
||||
EOF
|
||||
|
||||
# will exit 77 if panda is not installed
|
||||
$PYTHON test.py >out.1
|
||||
|
||||
# remove trailing whitespace from pandas' output,
|
||||
# and limit to 26 lines, because Pandas 0.13 adds
|
||||
# and limit to 6 lines, because Pandas 0.13 adds
|
||||
# the size of the dataframe afterwards.
|
||||
sed 's/[ \t]*$//g;26q' <out.1 > py.out
|
||||
sed 's/[ \t]*$//g;6q' <out.1 > py.out
|
||||
|
||||
cat >expected <<EOF
|
||||
states transitions
|
||||
states transitions
|
||||
mean std amin amax mean std amin amax
|
||||
tool
|
||||
ltl2tgba any count 4.000000 4.000000
|
||||
mean 2.250000 10.000000
|
||||
std 0.957427 5.163978
|
||||
min 1.000000 4.000000
|
||||
25% 1.750000 7.000000
|
||||
50% 2.500000 10.000000
|
||||
75% 3.000000 13.000000
|
||||
max 3.000000 16.000000
|
||||
ltl2tgba det count 4.000000 4.000000
|
||||
mean 2.250000 9.250000
|
||||
std 0.957427 4.573474
|
||||
min 1.000000 4.000000
|
||||
25% 1.750000 6.250000
|
||||
50% 2.500000 9.500000
|
||||
75% 3.000000 12.500000
|
||||
max 3.000000 14.000000
|
||||
ltl2tgba sma count 4.000000 4.000000
|
||||
mean 2.250000 9.250000
|
||||
std 0.957427 4.573474
|
||||
min 1.000000 4.000000
|
||||
25% 1.750000 6.250000
|
||||
50% 2.500000 9.500000
|
||||
75% 3.000000 12.500000
|
||||
max 3.000000 14.000000
|
||||
ltl2tgba any 2.25 0.957427 1 3 10.00 5.163978 4 16
|
||||
ltl2tgba det 2.25 0.957427 1 3 9.25 4.573474 4 14
|
||||
ltl2tgba sma 2.25 0.957427 1 3 9.25 4.573474 4 14
|
||||
EOF
|
||||
|
||||
diff py.out expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue