Skip to content

Commit e7ca026

Browse files
rockymmatera
andauthored
We can tolerate PyPy now... (#1139)
Fixes #661 --------- Co-authored-by: Juan Mauricio Matera <matera@fisica.unlp.edu.ar>
1 parent eb831c2 commit e7ca026

5 files changed

Lines changed: 6 additions & 7 deletions

File tree

mathics/builtin/drawing/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def eval(self, points, evaluation: Evaluation, options: dict):
316316
all_points = (
317317
points.value
318318
if hasattr(points, "value") and points.value is not None
319-
else eval_N(points, evaluation).to_python()
319+
else eval_N(points, evaluation).to_python() # TODO: force tuple-ness?
320320
)
321321

322322
# FIXME: arrange for self to have a .symbolname property or attribute

mathics/builtin/scipy_utils/integrators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# -*- coding: utf-8 -*-
22

33
from mathics.core.builtin import check_requires_list
4-
from mathics.core.util import IS_PYPY
54

6-
if IS_PYPY or not check_requires_list(["scipy", "numpy"]):
5+
if not check_requires_list(["scipy", "numpy"]):
76
raise ImportError
87

98
import numpy as np

mathics/builtin/scipy_utils/optimizers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
from mathics.core.evaluation import Evaluation
66
from mathics.core.expression import Expression
77
from mathics.core.systemsymbols import SymbolAutomatic, SymbolFailed, SymbolInfinity
8-
from mathics.core.util import IS_PYPY
98
from mathics.eval.nevaluator import eval_N
109

11-
if IS_PYPY or not check_requires_list(["scipy", "numpy"]):
10+
if not check_requires_list(["scipy", "numpy"]):
1211
raise ImportError
1312

1413

mathics/eval/drawing/plot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ def quiet_f(*args):
134134

135135

136136
def eval_ListPlot(
137-
plot_groups: list,
137+
# TODO: plot_groups should be a tuple only?
138+
plot_groups: Union[list, tuple],
138139
x_range: list,
139140
y_range: list,
140141
is_discrete_plot: bool,

mathics/eval/nevaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def eval_N(
2929
expression: BaseElement,
3030
evaluation: Evaluation,
3131
prec: BaseElement = SymbolMachinePrecision,
32-
) -> BaseElement:
32+
) -> Optional[BaseElement]:
3333
"""
3434
Equivalent to Expression(SymbolN, expression).evaluate(evaluation)
3535
"""

0 commit comments

Comments
 (0)