From 576f708a214e9f22664175b62dcd5c1db8c172ba Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Mon, 20 Nov 2023 16:28:52 +0000 Subject: [PATCH] fixup! fixup! fixup! Port the tree reporter to textual --- src/memray/reporters/tree.py | 2 +- .../__snapshots__/test_tree_reporter.ambr | 282 +++++++++--------- 2 files changed, 142 insertions(+), 142 deletions(-) diff --git a/src/memray/reporters/tree.py b/src/memray/reporters/tree.py index a1dec5cbe3..524227ee5a 100644 --- a/src/memray/reporters/tree.py +++ b/src/memray/reporters/tree.py @@ -130,7 +130,7 @@ class TreeApp(App[None]): grid-size: 1 2; grid-gutter: 1 2; padding: 0 1; - width: 80; + width: 120; height: 40; border: thick $background 80%; background: $surface; diff --git a/tests/unit/__snapshots__/test_tree_reporter.ambr b/tests/unit/__snapshots__/test_tree_reporter.ambr index be0d3881c2..a622c94cbf 100644 --- a/tests/unit/__snapshots__/test_tree_reporter.ambr +++ b/tests/unit/__snapshots__/test_tree_reporter.ambr @@ -346,289 +346,289 @@ font-weight: 700; } - .terminal-4093985635-matrix { + .terminal-2701647287-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-4093985635-title { + .terminal-2701647287-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-4093985635-r1 { fill: #656565 } - .terminal-4093985635-r2 { fill: #3e0a0a } - .terminal-4093985635-r3 { fill: #3e0a0a;font-weight: bold } - .terminal-4093985635-r4 { fill: #c5c8c6 } - .terminal-4093985635-r5 { fill: #0a3e21 } - .terminal-4093985635-r6 { fill: #103030 } - .terminal-4093985635-r7 { fill: #18130c;font-weight: bold } - .terminal-4093985635-r8 { fill: #3b2a12;font-weight: bold } - .terminal-4093985635-r9 { fill: #121212 } - .terminal-4093985635-r10 { fill: #f8f8f2 } - .terminal-4093985635-r11 { fill: #282a36 } - .terminal-4093985635-r12 { fill: #dfe7ed } - .terminal-4093985635-r13 { fill: #e4e5e6 } - .terminal-4093985635-r14 { fill: #dde8f3;font-weight: bold } - .terminal-4093985635-r15 { fill: #ddedf9 } + .terminal-2701647287-r1 { fill: #656565 } + .terminal-2701647287-r2 { fill: #3e0a0a } + .terminal-2701647287-r3 { fill: #3e0a0a;font-weight: bold } + .terminal-2701647287-r4 { fill: #c5c8c6 } + .terminal-2701647287-r5 { fill: #0a3e21 } + .terminal-2701647287-r6 { fill: #103030 } + .terminal-2701647287-r7 { fill: #18130c;font-weight: bold } + .terminal-2701647287-r8 { fill: #3b2a12;font-weight: bold } + .terminal-2701647287-r9 { fill: #121212 } + .terminal-2701647287-r10 { fill: #f8f8f2 } + .terminal-2701647287-r11 { fill: #282a36 } + .terminal-2701647287-r12 { fill: #dfe7ed } + .terminal-2701647287-r13 { fill: #e4e5e6 } + .terminal-2701647287-r14 { fill: #dde8f3;font-weight: bold } + .terminal-2701647287-r15 { fill: #ddedf9 } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - TreeApp + TreeApp - - - - β–Ό πŸ“‚ 1.000KB (100.00 %) <ROOT> - └── β–Ό πŸ“‚ 1.000KB (100.00 %) grandparent2fun2.py:4 - └── β–Ό πŸ“‚ 1.000KB (100.00 %) parent2fun2.py:8 - └── πŸ“„ 1.000KB (100.00 %) me2func2.py:4 - - - - - - β–ˆβ–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–ˆ - β–ˆdef generate_primes():                                              β–ˆ - β–ˆ    numbers = itertools.count(2)                                    β–ˆ - β–ˆ    while True:                                                     β–ˆ - β–ˆ        prime = next(numbers)                                       β–ˆ - β–ˆ        yield primeβ–ˆ - β–ˆ        numbers = filter(lambda x, prime=prime: x % prime, numbers) β–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆπŸ§­ Function: me2β–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆπŸ§­ Location: func2.py:4β–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆπŸ’Ύ Allocations: 1β–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆπŸ“¦ Size: 1.000KBβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆπŸ§΅ Thread: 0x1β–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆPress any key to go backβ–ˆ - β–ˆβ–ˆ - β–ˆβ–ˆ - β–ˆβ–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–ˆ - - - - - - - - - - -  Q  Quit the app  S  Show node information  I  Hide import system  E  Expand li… + + + + β–Ό πŸ“‚ 1.000KB (100.00 %) <ROOT> + └── β–Ό πŸ“‚ 1.000KB (100.00 %) grandparent2fun2.py:4 + └── β–Ό πŸ“‚ 1.000KB (100.00 %) parent2fun2.py:8 + └── πŸ“„ 1.000KB (100.00 %) me2func2.py:4 + + + + + + β–ˆβ–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€ + β–ˆdef generate_primes():                                               + β–ˆ    numbers = itertools.count(2)                                     + β–ˆ    while True:                                                      + β–ˆ        prime = next(numbers)                                        + β–ˆ        yield prime + β–ˆ        numbers = filter(lambda x, prime=prime: x % prime, numbers)  + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆ + β–ˆπŸ§­ Function: me2 + β–ˆ + β–ˆ + β–ˆπŸ§­ Location: func2.py:4 + β–ˆ + β–ˆ + β–ˆπŸ’Ύ Allocations: 1 + β–ˆ + β–ˆ + β–ˆπŸ“¦ Size: 1.000KB + β–ˆ + β–ˆ + β–ˆπŸ§΅ Thread: 0x1 + β–ˆ + β–ˆ + β–ˆPress any key to go back + β–ˆ + β–ˆ + β–ˆβ–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„ + + + + + + + + + + +  Q  Quit the app  S  Show node information  I  Hide import system  E  Expand li…