mcabbott / mcabbott/AxisKeys.jl

Print bug

Open
#173 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
154
Forks
31
PR merge metrics
No merged PRs in 30d

Description

There seems to be a glitch in the printed rows when the number of rows are 20 or greater. Notice the gap between 9-11 in the printout below.

This glitch prevents TerminalPager.jl to work nicely with the KeyedArray https://github.com/ronisbr/TerminalPager.jl/issues/75

julia> N=20; k = KeyedArray(randn(N,N), x=1:N, y=1:N)
julia> sprint(show, MIME"text/plain"(), k) |> println
2-dimensional KeyedArray(NamedDimsArray(...)) with keys:
↓   x ∈ 20-element UnitRange{Int64}
→   y ∈ 20-element UnitRange{Int64}
And data, 20×20 Matrix{Float64}:
       (1)          (2)           (3)          (4)          (5)          (6)          (7)          (8)         (9)          (10)           (11)          (12)         (13)          (14)          (15)          (16)           (17)         (18)         (19)          (20)
  (1)    1.12257      0.490402      0.487161     1.3417      -0.61508      1.00027      0.75978     -1.01997    -0.507342      2.17005       -0.171787     -0.379487    -0.990666     -0.84708       0.0829884     0.911194       0.142935    -2.65874     -0.527115      0.245108
  (2)    2.4968      -0.93532      -0.397074    -0.110128     0.925698    -0.319974    -0.824232    -0.774187    0.163896      0.129388       2.79476      -0.907305     0.539264     -1.3593        0.121594      0.924924       0.619213     0.613901    -0.723006     -0.188586
  (3)    0.0208007   -0.286999      0.593305     1.27435      0.712491     0.409889     0.61506      0.766101   -2.15692      -0.354933       1.62464      -0.622595     0.75396      -1.06038       0.300836     -1.09592        0.684804    -0.462004     0.0621972    -0.111631
  (4)    0.808812     0.446653     -0.2332       0.76007     -1.09043     -0.0431402   -0.927826    -0.628285    0.405432     -0.29322       -1.26878      -0.236054     1.62768       0.918532     -0.0981469     1.54129        1.26642      0.977583     1.83501       0.0320194
  (5)   -0.273673    -0.617164      0.78719      0.693395     1.06863     -0.763251    -0.949814     0.342036   -1.32664       2.20419        0.230068      1.50768     -2.28972       0.0611954    -0.517557      0.261454       0.940659    -0.540622     0.842569      1.76228
  (6)    0.477936     1.53226       1.12786      0.502254     1.3192      -0.275781     0.495464     0.10667    -0.27726      -0.227957      -0.949501     -1.05338      0.611621      0.625151      1.19027      -0.294704       0.368311    -1.1258       0.950899     -1.68034
  (7)    0.570887    -0.586242      0.0604913    1.80167     -0.0126626   -0.726972     0.445168     0.569077    1.54544       0.340749       0.238241      0.807731    -0.728055     -0.166784     -1.81308       0.935487      -1.36998      2.00573      0.499047     -0.250083
  (8)   -0.23281      0.00270028    0.621672     2.33665      0.388242    -0.451793    -0.511436    -1.21374     0.292649     -1.44022       -1.50705      -0.381982     0.934232      0.567087     -0.0416158    -0.373854       1.26558     -0.855522    -0.24484      -1.05762
  (9)   -1.09506     -2.82651      -0.23011      0.169101     0.707845     1.87551      0.326911    -0.79621     0.0405532    -0.108328      -0.458916     -0.49695     -1.21077       1.40631      -0.383105     -0.00819703    -2.0816       0.479381    -1.8039        0.687658
 (11)    0.402395     0.067904      0.505419     1.26774     -0.128122    -0.305771     0.518124     0.320105    0.437461      0.5606         0.142811     -0.187419     1.10411      -1.11426      -1.92751      -0.0533123     -0.71343     -0.695421     0.65695       1.796
 (12)    2.75515      0.838098      0.260278     0.50885     -0.485894     3.41045     -0.189964    -1.64383    -1.23911       0.876434      -2.89447       0.89373     -1.82964       0.64817       0.669421     -1.61013        0.142432     1.05083      1.69808       1.38645
 (13)    0.881214    -1.3055       -0.79923     -0.254773     0.783476     0.342084     0.390894    -0.446912    0.368134      0.441044      -0.450815      0.470341     1.6416       -1.87338       0.0531701     0.123984      -1.54473     -0.780281    -0.36103       1.97403
 (14)    1.57546     -0.356563      0.224456     0.465481    -1.54371      0.034207    -2.17408      0.246078   -1.06823       1.54273       -0.432513      0.541496    -0.481721     -0.536497     -0.934225      0.391173      -0.213335     0.56148     -0.471436     -0.047096
 (15)    1.19577     -0.263914      1.48525      0.801261     1.37071     -0.0483607   -0.193038    -1.10729    -0.362711     -0.290259      -0.621544     -0.024465     0.104764      0.209293      1.79168       1.12739        1.43481     -0.305706     0.544616      1.21018
 (16)   -0.740074     0.486808     -1.21628      1.47814     -1.4511      -0.904593    -0.374184     0.111976    0.0153674     0.0282585     -0.805838     -1.30165     -0.117036      0.585149      0.682102      1.06212       -0.498174    -0.937592    -0.235581     -0.829192
 (17)   -0.486374    -0.0826544    -1.88369     -0.182889    -1.04927      0.568706    -0.982996    -0.405444    0.14416       1.44949        0.939727      0.820213    -0.355105     -1.2758        0.731964     -2.28131        1.18909      0.527651     0.321574      0.131979
 (18)    1.32437     -0.849305      0.354739     0.7182       1.07191     -2.73456      1.14495      0.561979   -1.1518       -1.38035        0.201228     -0.663178    -0.735969     -0.350276     -1.05175      -1.43845        0.154855     1.35661     -1.29657       0.157937
 (19)   -0.0537634   -0.485977     -0.483744    -0.0424855    0.206698    -1.99924      0.274828    -0.368498   -1.87434      -0.00671213     0.0724161     0.575972     0.116639     -0.619535     -0.391665      1.12729        0.934895    -0.810897    -1.77572       0.11368
 (20)    0.166995    -0.390374      1.23389      0.0981188   -0.764152    -0.403233    -0.0290021    1.84925     0.136199      0.321659      -0.513166      0.505695     0.0299045    -1.22091      -1.90267      -0.233389       1.73001      0.293789     0.457946      1.93672

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the output using sprint(show, MIME"text/plain"(), k) with a 20×20 KeyedArray, then trace the text-display entry point responsible for the printed rows. Done means rows 1–20 print without the gap between rows 9 and 11, and the output works well with TerminalPager.jl as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.