Skip to content

Commit

Permalink
We can tolerate PyPy now... (#1139)
Browse files Browse the repository at this point in the history
Fixes #661

---------

Co-authored-by: Juan Mauricio Matera <[email protected]>
  • Loading branch information
rocky and mmatera authored Oct 21, 2024
1 parent eb831c2 commit e7ca026
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mathics/builtin/drawing/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def eval(self, points, evaluation: Evaluation, options: dict):
all_points = (
points.value
if hasattr(points, "value") and points.value is not None
else eval_N(points, evaluation).to_python()
else eval_N(points, evaluation).to_python() # TODO: force tuple-ness?
)

# FIXME: arrange for self to have a .symbolname property or attribute
Expand Down
3 changes: 1 addition & 2 deletions mathics/builtin/scipy_utils/integrators.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-

from mathics.core.builtin import check_requires_list
from mathics.core.util import IS_PYPY

if IS_PYPY or not check_requires_list(["scipy", "numpy"]):
if not check_requires_list(["scipy", "numpy"]):
raise ImportError

import numpy as np
Expand Down
3 changes: 1 addition & 2 deletions mathics/builtin/scipy_utils/optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
from mathics.core.evaluation import Evaluation
from mathics.core.expression import Expression
from mathics.core.systemsymbols import SymbolAutomatic, SymbolFailed, SymbolInfinity
from mathics.core.util import IS_PYPY
from mathics.eval.nevaluator import eval_N

if IS_PYPY or not check_requires_list(["scipy", "numpy"]):
if not check_requires_list(["scipy", "numpy"]):
raise ImportError


Expand Down
3 changes: 2 additions & 1 deletion mathics/eval/drawing/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def quiet_f(*args):


def eval_ListPlot(
plot_groups: list,
# TODO: plot_groups should be a tuple only?
plot_groups: Union[list, tuple],
x_range: list,
y_range: list,
is_discrete_plot: bool,
Expand Down
2 changes: 1 addition & 1 deletion mathics/eval/nevaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def eval_N(
expression: BaseElement,
evaluation: Evaluation,
prec: BaseElement = SymbolMachinePrecision,
) -> BaseElement:
) -> Optional[BaseElement]:
"""
Equivalent to Expression(SymbolN, expression).evaluate(evaluation)
"""
Expand Down

0 comments on commit e7ca026

Please sign in to comment.