Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[query] pretty boxes #14254

Closed
wants to merge 8 commits into from
Closed

[query] pretty boxes #14254

wants to merge 8 commits into from

Conversation

danking
Copy link
Contributor

@danking danking commented Feb 6, 2024

Stacked on Will's changes, I was inspired.

In [2]: import hail as hl
   ...: from hailtop.utils.box_drawing import *
   ...: 
   ...: hl.utils.range_table(10).annotate(a='abc', b=3.0, c=3).show(10, box=three_dashed_curved)
╭┄┄┄┄┄┄┄┬┄┄┄┄┄┄┄┬┄┄┄┄┄┄┄┄┄┄┬┄┄┄┄┄┄┄╮
┆   idxabc ┆
├┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┤
┆ int32strfloat64int32 ┆
├┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┤
┆     0"abc"3.00e+003 ┆
┆     1"abc"3.00e+003 ┆
┆     2"abc"3.00e+003 ┆
┆     3"abc"3.00e+003 ┆
┆     4"abc"3.00e+003 ┆
┆     5"abc"3.00e+003 ┆
┆     6"abc"3.00e+003 ┆
┆     7"abc"3.00e+003 ┆
┆     8"abc"3.00e+003 ┆
┆     9"abc"3.00e+003 ┆
╰┄┄┄┄┄┄┄┴┄┄┄┄┄┄┄┴┄┄┄┄┄┄┄┄┄┄┴┄┄┄┄┄┄┄╯

In [3]: import hail as hl
   ...: from hailtop.utils.box_drawing import *
   ...: 
   ...: hl.utils.range_table(10).annotate(a='abc', b=3.0, c=3).show(10, box=two_dashed_curved)
╭╌╌╌╌╌╌╌┬╌╌╌╌╌╌╌┬╌╌╌╌╌╌╌╌╌╌┬╌╌╌╌╌╌╌╮
╎   idxabc ╎
├╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
╎ int32strfloat64int32 ╎
├╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
╎     0"abc"3.00e+003 ╎
╎     1"abc"3.00e+003 ╎
╎     2"abc"3.00e+003 ╎
╎     3"abc"3.00e+003 ╎
╎     4"abc"3.00e+003 ╎
╎     5"abc"3.00e+003 ╎
╎     6"abc"3.00e+003 ╎
╎     7"abc"3.00e+003 ╎
╎     8"abc"3.00e+003 ╎
╎     9"abc"3.00e+003 ╎
╰╌╌╌╌╌╌╌┴╌╌╌╌╌╌╌┴╌╌╌╌╌╌╌╌╌╌┴╌╌╌╌╌╌╌╯

In [4]: import hail as hl
   ...: from hailtop.utils.box_drawing import *
   ...: 
   ...: hl.utils.range_table(10).annotate(a='abc', b=3.0, c=3).show(10, box=thick)
┏━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━┓
┃   idxabc ┃
┣━━━━━━━╋━━━━━━━╋━━━━━━━━━━╋━━━━━━━┫
┃ int32strfloat64int32 ┃
┣━━━━━━━╋━━━━━━━╋━━━━━━━━━━╋━━━━━━━┫
┃     0"abc"3.00e+003 ┃
┃     1"abc"3.00e+003 ┃
┃     2"abc"3.00e+003 ┃
┃     3"abc"3.00e+003 ┃
┃     4"abc"3.00e+003 ┃
┃     5"abc"3.00e+003 ┃
┃     6"abc"3.00e+003 ┃
┃     7"abc"3.00e+003 ┃
┃     8"abc"3.00e+003 ┃
┃     9"abc"3.00e+003 ┃
┗━━━━━━━┻━━━━━━━┻━━━━━━━━━━┻━━━━━━━┛

In [5]: import hail as hl
   ...: from hailtop.utils.box_drawing import *
   ...: 
   ...: hl.utils.range_table(10).annotate(a='abc', b=3.0, c=3).show(10, box=standard)
┌───────┬───────┬──────────┬───────┐
│   idxabc │
├───────┼───────┼──────────┼───────┤
│ int32strfloat64int32 │
├───────┼───────┼──────────┼───────┤
│     0"abc"3.00e+003 │
│     1"abc"3.00e+003 │
│     2"abc"3.00e+003 │
│     3"abc"3.00e+003 │
│     4"abc"3.00e+003 │
│     5"abc"3.00e+003 │
│     6"abc"3.00e+003 │
│     7"abc"3.00e+003 │
│     8"abc"3.00e+003 │
│     9"abc"3.00e+003 │
└───────┴───────┴──────────┴───────┘

In [6]: import hail as hl
   ...: from hailtop.utils.box_drawing import *
   ...: 
   ...: hl.utils.range_table(10).annotate(a='abc', b=3.0, c=3).show(10, box=double)
╔═══════╦═══════╦══════════╦═══════╗
║   idxabc ║
╠═══════╬═══════╬══════════╬═══════╣
║ int32strfloat64int32 ║
╠═══════╬═══════╬══════════╬═══════╣
║     0"abc"3.00e+003 ║
║     1"abc"3.00e+003 ║
║     2"abc"3.00e+003 ║
║     3"abc"3.00e+003 ║
║     4"abc"3.00e+003 ║
║     5"abc"3.00e+003 ║
║     6"abc"3.00e+003 ║
║     7"abc"3.00e+003 ║
║     8"abc"3.00e+003 ║
║     9"abc"3.00e+003 ║
╚═══════╩═══════╩══════════╩═══════╝
In [3]: import hail as hl
   ...: from hailtop.utils.box_drawing import *
   ...: 
   ...: hl.utils.range_matrix_table(4, 4).annotate_entries(a='abc', b=3.0, c=3).show(10, box=curved)
╭─────────┬───────┬─────────┬───────┬───────┬─────────┬───────┬───────┬─────────┬───────┬───────┬─────────┬───────╮
│ row_idx0.a0.b0.c1.a1.b1.c2.a2.b2.c3.a3.b3.c │
├─────────┼───────┼─────────┼───────┼───────┼─────────┼───────┼───────┼─────────┼───────┼───────┼─────────┼───────┤
│   int32strfloat64int32strfloat64int32strfloat64int32strfloat64int32 │
├─────────┼───────┼─────────┼───────┼───────┼─────────┼───────┼───────┼─────────┼───────┼───────┼─────────┼───────┤
│       0'abc'3.03'abc'3.03'abc'3.03'abc'3.03 │
│       1'abc'3.03'abc'3.03'abc'3.03'abc'3.03 │
│       2'abc'3.03'abc'3.03'abc'3.03'abc'3.03 │
│       3'abc'3.03'abc'3.03'abc'3.03'abc'3.03 │
╰─────────┴───────┴─────────┴───────┴───────┴─────────┴───────┴───────┴─────────┴───────┴───────┴─────────┴───────╯

@danking
Copy link
Contributor Author

danking commented Feb 7, 2024

I'm gonna close until I have time to properly clean this up and merge.

@danking danking closed this Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants