Skip to content

Commit 7014328

Browse files
committed
Filter out grid lines
1 parent 77efab2 commit 7014328

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@e2b/code-interpreter",
3-
"version": "0.0.9-beta.67",
3+
"version": "0.0.9-beta.68",
44
"description": "E2B Code Interpreter - Stateful code execution",
55
"homepage": "https://e2b.dev",
66
"license": "MIT",

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "e2b-code-interpreter"
3-
version = "0.0.11b42"
3+
version = "0.0.11b43"
44
description = "E2B Code Interpreter - Stateful code execution"
55
authors = ["e2b <[email protected]>"]
66
license = "Apache-2.0"

template/startup_scripts/0002_data.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from datetime import date
22
import enum
33
import re
4-
from dateutil import parser
54
from typing import Optional, List, Tuple, Literal, Any, Union, Sequence
65

76
import matplotlib
@@ -21,6 +20,21 @@
2120
from traitlets.traitlets import Unicode, ObjectName
2221

2322

23+
def _is_grid_line(line: Line2D) -> bool:
24+
x_data = line.get_xdata()
25+
if len(x_data) != 2:
26+
return False
27+
28+
y_data = line.get_ydata()
29+
if len(y_data) != 2:
30+
return False
31+
32+
if x_data[0] == x_data[1] or y_data[0] == y_data[1]:
33+
return True
34+
35+
return False
36+
37+
2438
class GraphType(str, enum.Enum):
2539
LINE = "line"
2640
SCATTER = "scatter"
@@ -187,6 +201,8 @@ def _extract_info(self, ax: Axes) -> None:
187201
super()._extract_info(ax)
188202

189203
for line in ax.get_lines():
204+
if _is_grid_line(line):
205+
continue
190206
label = line.get_label()
191207
if label.startswith("_child"):
192208
number = int(label[6:])
@@ -377,23 +393,9 @@ def _get_type_of_graph(ax: Axes) -> GraphType:
377393
if all(isinstance(box_or_path, (PathPatch, Line2D)) for box_or_path in objects):
378394
return GraphType.BOX_AND_WHISKER
379395

380-
def is_grid_line(line: Line2D) -> bool:
381-
x_data = line.get_xdata()
382-
if len(x_data) != 2:
383-
return False
384-
385-
y_data = line.get_ydata()
386-
if len(y_data) != 2:
387-
return False
388-
389-
if x_data[0] == x_data[1] or y_data[0] == y_data[1]:
390-
return True
391-
392-
return False
393-
394396
filtered = []
395397
for obj in objects:
396-
if isinstance(obj, Line2D) and is_grid_line(obj):
398+
if isinstance(obj, Line2D) and _is_grid_line(obj):
397399
continue
398400
filtered.append(obj)
399401

0 commit comments

Comments
 (0)