Skip to content

Commit 7b5aa5c

Browse files
committed
black
1 parent b6ab4fe commit 7b5aa5c

File tree

6 files changed

+21
-29
lines changed

6 files changed

+21
-29
lines changed

pymathics/vectorizedplot/__init__.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,24 @@
2222
</ul>
2323
"""
2424

25-
2625
from pymathics.vectorizedplot.version import __version__
26+
2727
try:
28-
from pymathics.vectorizedplot.plot_plot3d import ContourPlot3D, ParametricPlot3D, SphericalPlot3D
28+
from pymathics.vectorizedplot.plot_plot3d import (
29+
ContourPlot3D,
30+
ParametricPlot3D,
31+
SphericalPlot3D,
32+
)
2933

3034
__all__ = (
3135
"ContourPlot3D",
3236
"ParametricPlot3D",
3337
"SphericalPlot3D",
3438
"__version__",
35-
"pymathics_version_data"
39+
"pymathics_version_data",
3640
)
3741
except ModuleNotFoundError:
38-
__all__ = (
39-
"__version__",
40-
"pymathics_version_data"
41-
)
42+
__all__ = ("__version__", "pymathics_version_data")
4243

4344
# To be recognized as an external mathics module, the following variable
4445
# is required:
@@ -51,5 +52,3 @@
5152

5253
# This tells documentation how to sort this module
5354
sort_order = "mathics.builtin.plotting-graphing-and-drawing"
54-
55-

pymathics/vectorizedplot/eval/colors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from typing import Optional
77

88
import palettable
9-
109
from mathics.core.atoms import Integer0, Integer1, MachineReal, String
1110
from mathics.core.convert.expression import to_expression
1211
from mathics.core.element import BaseElement

pymathics/vectorizedplot/eval/plot3d_vectorized.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
import math
77

88
import numpy as np
9-
109
from mathics.builtin.colors.color_internals import convert_color
1110
from mathics.core.evaluation import Evaluation
1211
from mathics.core.expression import Expression
13-
from mathics.core.symbols import strip_context, Symbol
14-
from mathics.core.systemsymbols import (
15-
# TODO: uncomment me after adding this symbol to mathics.core.systemsymbols
16-
# SymbolAbsoluteThickness,
12+
from mathics.core.symbols import Symbol, strip_context
13+
from mathics.core.systemsymbols import ( # TODO: uncomment me after adding this symbol to mathics.core.systemsymbols; SymbolAbsoluteThickness,
1714
SymbolEqual,
1815
SymbolFull,
1916
SymbolNone,
@@ -25,9 +22,8 @@
2522
from .colors import palette2, palette3, palette_color_directive
2623
from .util import GraphicsGenerator, compile_exprs
2724

28-
2925
# TODO: remove me after adding this symbol to mathics.core.systemsymbols
30-
SymbolAbsoluteThickness= Symbol("System`AbsoluteThickness")
26+
SymbolAbsoluteThickness = Symbol("System`AbsoluteThickness")
3127

3228

3329
def make_surfaces(

pymathics/vectorizedplot/plot.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
points, as another parameter, and plot or show the function applied to the data.
77
"""
88

9-
109
import palettable
11-
1210
from mathics.builtin.graphics import Graphics
1311
from mathics.builtin.options import options_to_rules
1412
from mathics.core.atoms import Integer, Integer0, MachineReal, String
@@ -33,10 +31,11 @@
3331
SymbolStyle,
3432
)
3533
from mathics.eval.drawing.colors import COLOR_PALETTES, get_color_palette
36-
from pymathics.vectorizedplot.eval.plot import get_plot_range
37-
import pymathics.vectorizedplot.eval.plot3d_vectorized as plot_module
3834
from mathics.eval.nevaluator import eval_N
3935

36+
import pymathics.vectorizedplot.eval.plot3d_vectorized as plot_module
37+
from pymathics.vectorizedplot.eval.plot import get_plot_range
38+
4039
# The vectorized plot function generates GraphicsComplex using NumericArray,
4140
# which no consumer will currently understand. So lets make it opt-in for now.
4241
# If it remains opt-in we'll probably want some combination of env variables,
@@ -45,9 +44,6 @@
4544
# TODO: work out exactly how to deploy.
4645

4746

48-
49-
50-
5147
# get the plot eval function for the given class,
5248
# depending on whether vectorized plot functions are enabled
5349
def get_plot_eval_function(cls):
@@ -197,7 +193,8 @@ def to_numbers(li):
197193

198194
from math import ceil
199195

200-
from mpmath import ceil as mpceil, floor as mpfloor
196+
from mpmath import ceil as mpceil
197+
from mpmath import floor as mpfloor
201198

202199
class Distribution:
203200
def __init__(self, data, n_bins):

pymathics/vectorizedplot/plot_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
from typing import Callable
1010

1111
import numpy as np
12-
1312
from mathics.builtin.graphics import Graphics
1413
from mathics.core.attributes import A_HOLD_ALL, A_PROTECTED, A_READ_PROTECTED
1514
from mathics.core.builtin import Builtin
1615
from mathics.core.convert.expression import to_mathics_list
1716
from mathics.core.evaluation import Evaluation
1817
from mathics.core.symbols import SymbolTrue
1918
from mathics.core.systemsymbols import SymbolLogPlot, SymbolPlotRange, SymbolSequence
19+
2020
from pymathics.vectorizedplot.eval.drawing.plot import eval_Plot
2121
from pymathics.vectorizedplot.eval.drawing.plot_vectorized import eval_Plot_vectorized
2222

pymathics/vectorizedplot/plot_plot3d.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
"""
1212

1313
import numpy as np
14-
15-
from pymathics.vectorizedplot import plot
1614
from mathics.builtin.drawing.graphics3d import Graphics3D
1715
from mathics.builtin.graphics import Graphics
1816
from mathics.builtin.options import filter_from_iterable, options_to_rules
@@ -22,6 +20,8 @@
2220
from mathics.core.evaluation import Evaluation
2321
from mathics.core.systemsymbols import Symbol, SymbolPlotRange, SymbolSequence
2422

23+
from pymathics.vectorizedplot import plot
24+
2525
# This tells documentation how to sort this module
2626
sort_order = "mathics.builtin.custom-plots"
2727

@@ -176,13 +176,14 @@ class ComplexPlot3D(_Plot3D):
176176
>> ComplexPlot3D[(z^2 + 1)/(z^2 - 1), {z, -2 - 2 I, 2 + 2 I}]
177177
= ...
178178
"""
179+
179180
expected_args = 2
180181
graphics_class = Graphics3D
181182
many_functions = True
182183
num_plot_points = 2 # different from number of ranges
183184
options = _Plot3D.options3d | {"Mesh": "None"}
184185
summary_text = "plot one or more complex functions as a 3D surface"
185-
186+
186187
def apply_function(self, function, names, us, vs):
187188
parms = {str(names[0]): us + vs * 1j}
188189
return us, vs, function(**parms)

0 commit comments

Comments
 (0)