Skip to content

Commit

Permalink
Remove some lint in mathics.drawing.plot
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Sep 27, 2024
1 parent 0fc71d5 commit 1d063a8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mathics/builtin/drawing/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class _ListPlot(Builtin, ABC):
def eval(self, points, evaluation: Evaluation, options: dict):
"%(name)s[points_, OptionsPattern[%(name)s]]"

plot_name = self.get_name()
class_name = self.__class__.__name__

# Scale point values down by Log 10. Tick mark values will be adjusted to be 10^n in GraphicsBox.
if self.use_log_scale:
Expand All @@ -312,7 +312,6 @@ def eval(self, points, evaluation: Evaluation, options: dict):
# FIXME: arrange for self to have a .symbolname property or attribute
expr = Expression(Symbol(self.get_name()), points, *options_to_rules(options))

class_name = self.__class__.__name__
if class_name == "ListPlot":
plot_type = ListPlotType.ListPlot
elif class_name == "ListLinePlot":
Expand Down Expand Up @@ -367,7 +366,7 @@ def eval(self, points, evaluation: Evaluation, options: dict):
joined_option = self.get_option(options, "Joined", evaluation)
is_joined_plot = joined_option.to_python()
if is_joined_plot not in [True, False]:
evaluation.message(plot_name, "joind", joined_option, expr)
evaluation.message(class_name, "joind", joined_option, expr)
is_joined_plot = False

return eval_ListPlot(
Expand Down Expand Up @@ -1646,7 +1645,7 @@ def eval(
# This includes the plot data, and overall graphics directives
# like the Hue.

for index, f in enumerate(functions):
for f in functions:
# list of all plotted points for a given function
plot_points = []

Expand All @@ -1666,8 +1665,8 @@ def apply_fn(fn: Callable, x_value: int) -> Optional[float]:
plot_points.append((x_value, point))

x_range = get_plot_range(
[xx for xx, yy in base_plot_points],
[xx for xx, yy in plot_points],
[xx for xx, _ in base_plot_points],
[xx for xx, _ in plot_points],
x_range,
)
plot_groups.append(plot_points)
Expand Down

0 comments on commit 1d063a8

Please sign in to comment.