airspeed-velocity/asv

`asv compare` can create broken markdown tables when a parameter’s repr is multiple lines

flying-sheep opened this issue · 1 comments

E.g. I currently see:

| Change   | Before [c68557c5] <main>   | After [055b5c56]    |   Ratio | Benchmark (Parameter)                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|----------|----------------------------|---------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -        | 217M                       | 194M                |    0.89 | preprocessing.PreprocessingSuite.peakmem_calculate_qc_metrics(AnnData object with n_obs × n_vars = 700 × 765
    obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score', 'G2M_score', 'phase', 'louvain'
    var: 'n_counts', 'means', 'dispersions', 'dispersions_norm', 'highly_variable'
    uns: 'bulk_labels_colors', 'louvain', 'louvain_colors', 'neighbors', 'pca', 'rank_genes_groups'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'distances', 'connectivities')  |

which isn’t valid markdown.

The problem in fixing this is is that tabulate seems unmaintained, and there is no community fork yet: astanin/python-tabulate#281

So we can’t expect that project to release a fix soon.

Seems like https://github.com/hvalev/py-markdown-table might be useful here.