diff options
Diffstat (limited to 'py')
-rw-r--r-- | py/deathtable.py | 3 | ||||
-rw-r--r-- | py/table.py | 19 |
2 files changed, 9 insertions, 13 deletions
diff --git a/py/deathtable.py b/py/deathtable.py index f393cc8..45e4f08 100644 --- a/py/deathtable.py +++ b/py/deathtable.py @@ -1,7 +1,4 @@ from data import trials -print('\\table{') -print('Trial Size& Date& Introduced& Deaths& Pits formed\\cr\\noalign{\\hrule}') for trial in trials: print('& '.join(['$\\times$'.join([str(el) for el in trial.size]), str(trial.date), str(trial.intro), str(trial.dead), str(len(trial.pits))])+'\\cr\\noalign{\\hrule}') -print('}', end='') diff --git a/py/table.py b/py/table.py index 1d11779..8b6b38a 100644 --- a/py/table.py +++ b/py/table.py @@ -1,15 +1,14 @@ from data import trials -print('\\vtable{') -table = ['Dimensions (in)', 'Pit Depth (cm)', 'Pit Width (cm)', 'Nearest Neighbor (cm)','']; -lastsize = 0; for trial in trials: - size = trial.size - table[0] += '&\\multispan{' + str(len(trial.pits)) + '}\\vfil\\line{\\hfil' + '$\\times$'.join([str(el) for el in size]) + '\\hfil}\\vfil\\hrule' + print('\\multirow{' + str(len(trial.pits)) + '}{' + + '$\\times$'.join([str(el) for el in trial.size]) + '}') nei = trial.nearest_neighbor() - for pitind in range(len(trial.pits)): + pitcnt = len(trial.pits) + for pitind in range(pitcnt): pit = trial.pits[pitind] - table[1] += '&' + '%.1f' % pit.depth - table[2] += '&' + '%.1f' % pit.diam - table[3] += '&' + '%.2f' % nei[pitind] -print('\\cr\\noalign{\\vrule}\n'.join(table) + '}', end=''); + print('& %.1f& %.1f& %.2f\\cr' % (pit.depth, pit.diam, nei[pitind])) + if pitind+1 == pitcnt: + break + print('\\cline'); + print('\\multispan{4}\\leaders\\hrule\\hfil\\cr') |