Skip to content

Commit c727fc0

Browse files
committed
isort imports on all Python files
1 parent 690908c commit c727fc0

File tree

179 files changed

+502
-1015
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+502
-1015
lines changed

admin-tools/build_and_check_manifest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python
22

3-
from mathics.builtin import name_is_builtin_symbol, modules, Builtin
43
import sys
54

5+
from mathics.builtin import Builtin, modules, name_is_builtin_symbol
6+
67

78
def generate_available_builtins_names():
89
msg = ""

admin-tools/time-mathmp-sympy-fns.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
Program to time mpmath pi vs sympy pi
44
"""
55

6+
import math
67
from timeit import timeit
8+
79
import mpmath
8-
import math
910
import sympy
1011

1112
PRECISION = 100

mathics/__init__.py

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

3-
import sys
43
import platform
5-
import sympy
4+
import sys
5+
66
import mpmath
77
import numpy
8+
import sympy
89

910
from mathics.version import __version__
1011

mathics/algorithm/clusters.py

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

33

4-
import random
5-
from itertools import chain, islice
64
import bisect
75
import math
6+
import random
7+
from itertools import chain, islice
88

99
from mpmath import fsum
1010

mathics/algorithm/integrators.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,11 @@
22

33
import numpy as np
44

5-
from mathics.core.number import machine_epsilon
5+
from mathics.core.atoms import Integer, Integer0, Number
66
from mathics.core.expression import Expression
7-
from mathics.core.atoms import (
8-
Integer,
9-
Integer0,
10-
Number,
11-
)
12-
137
from mathics.core.list import ListExpression
8+
from mathics.core.number import machine_epsilon
149
from mathics.core.symbols import Symbol, SymbolPlus, SymbolSequence, SymbolTimes
15-
16-
1710
from mathics.core.systemsymbols import (
1811
SymbolBlank,
1912
SymbolComplex,

mathics/algorithm/introselect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ def introselect(a, k): # changes a
164164

165165

166166
if __name__ == "__main__":
167-
import random
168167
import itertools
168+
import random
169169

170170
def test_algorithm(l, r_max, name, f):
171171
a = [random.randint(-r_max, r_max) for _ in range(l)]

mathics/algorithm/optimizers.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,22 @@
33
from typing import Optional
44

55
from mathics.builtin.scoping import dynamic_scoping
6-
7-
86
from mathics.core.atoms import (
9-
String,
107
Integer,
118
Integer0,
12-
IntegerM1,
139
Integer1,
1410
Integer2,
1511
Integer3,
1612
Integer10,
13+
IntegerM1,
1714
Number,
1815
Real,
16+
String,
1917
)
2018
from mathics.core.convert.python import from_python
2119
from mathics.core.evaluation import Evaluation
22-
from mathics.eval.nevaluator import eval_N
2320
from mathics.core.expression import Expression
24-
from mathics.core.symbols import (
25-
BaseElement,
26-
SymbolPlus,
27-
SymbolTimes,
28-
SymbolTrue,
29-
)
30-
21+
from mathics.core.symbols import BaseElement, SymbolPlus, SymbolTimes, SymbolTrue
3122
from mathics.core.systemsymbols import (
3223
SymbolAutomatic,
3324
SymbolD,
@@ -37,6 +28,7 @@
3728
SymbolLog,
3829
SymbolNone,
3930
)
31+
from mathics.eval.nevaluator import eval_N
4032

4133

4234
def find_minimum_newton1d(f, x0, x, opts, evaluation) -> (Number, bool):

mathics/algorithm/parts.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
)
1818
from mathics.core.expression import Expression
1919
from mathics.core.list import ListExpression
20+
from mathics.core.subexpression import SubExpression
2021
from mathics.core.symbols import Atom, Symbol, SymbolList
2122
from mathics.core.systemsymbols import SymbolDirectedInfinity, SymbolInfinity
22-
from mathics.core.subexpression import SubExpression
23-
2423

2524
SymbolNothing = Symbol("Nothing")
2625

mathics/algorithm/series.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
from mathics.core.symbols import (
2-
Atom,
3-
Symbol,
4-
SymbolPlus,
5-
SymbolPower,
6-
SymbolTimes,
7-
)
8-
91
from mathics.core.atoms import Integer, Integer0, Rational
10-
from mathics.core.expression import Expression
112
from mathics.core.convert.expression import to_mathics_list
3+
from mathics.core.expression import Expression
124
from mathics.core.list import ListExpression
135
from mathics.core.rules import Pattern
6+
from mathics.core.symbols import Atom, Symbol, SymbolPlus, SymbolPower, SymbolTimes
147
from mathics.core.systemsymbols import (
158
SymbolComplexInfinity,
169
SymbolD,

mathics/benchmark.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@
55
import time
66
from argparse import ArgumentParser
77

8-
98
try:
10-
from statistics import mean
11-
from statistics import median_low as median
9+
from statistics import mean, median_low as median
1210
except ImportError:
1311
mean = lambda l: sum(l) / len(l)
1412
median = lambda l: sorted(l)[len(l) // 2]
1513

1614

1715
import mathics
18-
from mathics.core.parser import parse, MathicsMultiLineFeeder, MathicsSingleLineFeeder
1916
from mathics.core.definitions import Definitions
2017
from mathics.core.evaluation import Evaluation
21-
18+
from mathics.core.parser import MathicsMultiLineFeeder, MathicsSingleLineFeeder, parse
2219

2320
# Default number of times to repeat each benchmark. None -> Automatic
2421
TESTS_PER_BENCHMARK = None

0 commit comments

Comments
 (0)