|
72 | 72 | {
|
73 | 73 | "cell_type": "code",
|
74 | 74 | "execution_count": null,
|
75 |
| - "id": "e26d392f-6afd-4e89-a685-d618065d3caf", |
| 75 | + "id": "27627cd4-c363-4eab-a121-f6c8abbbe5ae", |
76 | 76 | "metadata": {
|
77 | 77 | "tags": []
|
78 | 78 | },
|
79 | 79 | "outputs": [],
|
80 | 80 | "source": [
|
81 |
| - "# for line\n", |
82 |
| - "# a = np.random.rand(10_000_000)\n", |
83 |
| - "\n", |
84 |
| - "# for heatmap\n", |
85 |
| - "# a = np.random.rand(20_000, 20_000)\n", |
86 |
| - "\n", |
87 |
| - "# for line collection\n", |
88 |
| - "# a = np.random.rand(500, 50_000)\n", |
89 |
| - "\n", |
90 |
| - "# for image\n", |
91 |
| - "# a = np.random.rand(7_000, 7_000)\n", |
92 |
| - "\n", |
93 |
| - "# for scatter\n", |
94 |
| - "a = np.random.rand(10_000_000, 3)" |
| 81 | + "graphic = \"scatter\"" |
| 82 | + ] |
| 83 | + }, |
| 84 | + { |
| 85 | + "cell_type": "markdown", |
| 86 | + "id": "d9c10edc-169a-4dd2-bd5b-8a1b67baf3a9", |
| 87 | + "metadata": {}, |
| 88 | + "source": [ |
| 89 | + "### Run the following cells repeatedly to add and remove the graphic" |
95 | 90 | ]
|
96 | 91 | },
|
97 | 92 | {
|
98 | 93 | "cell_type": "code",
|
99 | 94 | "execution_count": null,
|
100 |
| - "id": "31e3027a-56cf-4f7b-ba78-aed4f78eef47", |
| 95 | + "id": "e26d392f-6afd-4e89-a685-d618065d3caf", |
101 | 96 | "metadata": {
|
102 | 97 | "tags": []
|
103 | 98 | },
|
104 | 99 | "outputs": [],
|
105 | 100 | "source": [
|
106 |
| - "print_process_ram_mb()" |
| 101 | + "if graphic == \"line\":\n", |
| 102 | + " a = np.random.rand(10_000_000)\n", |
| 103 | + " g = plot.add_line(a)\n", |
| 104 | + " \n", |
| 105 | + "elif graphic == \"heatmap\":\n", |
| 106 | + " a = np.random.rand(20_000, 20_000)\n", |
| 107 | + " g = plot.add_heatmap(a)\n", |
| 108 | + "\n", |
| 109 | + "elif graphic == \"line_collection\":\n", |
| 110 | + " a = np.random.rand(500, 50_000)\n", |
| 111 | + " g = plot.add_line_collection(a)\n", |
| 112 | + " \n", |
| 113 | + "elif graphic == \"image\":\n", |
| 114 | + " a = np.random.rand(7_000, 7_000)\n", |
| 115 | + " g = plot.add_image(a)\n", |
| 116 | + "\n", |
| 117 | + "elif graphic == \"scatter\":\n", |
| 118 | + " a = np.random.rand(10_000_000, 3)\n", |
| 119 | + " g = plot.add_scatter(a)" |
107 | 120 | ]
|
108 | 121 | },
|
109 | 122 | {
|
110 | 123 | "cell_type": "code",
|
111 | 124 | "execution_count": null,
|
112 |
| - "id": "9cf2ceaa-5b01-4e12-be39-f267cd355833", |
| 125 | + "id": "31e3027a-56cf-4f7b-ba78-aed4f78eef47", |
113 | 126 | "metadata": {
|
114 | 127 | "tags": []
|
115 | 128 | },
|
116 | 129 | "outputs": [],
|
117 | 130 | "source": [
|
118 |
| - "# g = plot.add_line_collection(a)\n", |
119 |
| - "# g = plot.add_heatmap(a)\n", |
120 |
| - "# g = plot.add_line(a)\n", |
121 |
| - "g = plot.add_scatter(a)" |
| 131 | + "print_process_ram_mb()" |
122 | 132 | ]
|
123 | 133 | },
|
124 | 134 | {
|
|
169 | 179 | "plot.delete_graphic(plot.graphics[0])"
|
170 | 180 | ]
|
171 | 181 | },
|
| 182 | + { |
| 183 | + "cell_type": "markdown", |
| 184 | + "id": "47baa487-c66b-4c40-aa11-d819902870e3", |
| 185 | + "metadata": {}, |
| 186 | + "source": [ |
| 187 | + "If there is no serious system memory leak, this value shouldn't really increase after repeated cycles" |
| 188 | + ] |
| 189 | + }, |
172 | 190 | {
|
173 | 191 | "cell_type": "code",
|
174 | 192 | "execution_count": null,
|
|
0 commit comments