Skip to content

Commit

Permalink
Lint found in ListPlot-point checking branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Dec 25, 2024
1 parent 8ca7514 commit bc8a285
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions mathics/eval/drawing/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,21 @@ def eval_ListPlot(
[xx for xx, yy in plot_groups], [xx for xx, yy in plot_groups], x_range
)
plot_groups = [plot_groups]
elif all(isinstance(line, list) for line in plot_groups):
if not all(isinstance(line, list) for line in plot_groups):
elif all(isinstance(line, (list, tuple)) for line in plot_groups):
if not all(isinstance(line, (list, tuple)) for line in plot_groups):
return

# He have a list of plot groups
if all(
isinstance(point, list) and len(point) == 2
for plot_group in plot_groups
isinstance(point, (list, tuple)) and len(point) == 2
for _ in plot_groups
for point in plot_groups
):
pass
elif not is_discrete_plot and all(
not isinstance(point, list) for line in plot_groups for point in line
not isinstance(point, (list, tuple))
for line in plot_groups
for point in line
):
# FIXME: is this right?
y_min = min(plot_groups)[0]
Expand All @@ -229,7 +231,7 @@ def eval_ListPlot(
# Split into plot segments
plot_groups = [[plot_group] for plot_group in plot_groups]
if isinstance(x_range, (list, tuple)):
x_min, m_max = x_range
x_min, x_max = x_range
y_min, y_max = y_range

for lidx, plot_group in enumerate(plot_groups):
Expand Down
2 changes: 1 addition & 1 deletion test/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def evaluate(str_expr: str):
def check_evaluation(
str_expr: Optional[str],
str_expected: Optional[str] = None,
failure_message: str = "",
failure_message: Optional[str] = "",
hold_expected: bool = False,
to_string_expr: Optional[bool] = True,
to_string_expected: bool = True,
Expand Down

0 comments on commit bc8a285

Please sign in to comment.