Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mathics.builtin.base -> mathics.core.builtin #900

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin-tools/build_and_check_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sys

from mathics.builtin.base import Builtin
from mathics.core.builtin import Builtin
from mathics.core.load_builtin import (
import_and_load_builtins,
modules,
Expand Down
14 changes: 7 additions & 7 deletions mathics/builtin/arithfns/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
"""

from mathics.builtin.arithmetic import create_infix
from mathics.builtin.base import (
BinaryOperator,
Builtin,
MPMathFunction,
PrefixOperator,
SympyFunction,
)
from mathics.core.atoms import (
Complex,
Integer,
Expand All @@ -37,6 +30,13 @@
A_PROTECTED,
A_READ_PROTECTED,
)
from mathics.core.builtin import (
BinaryOperator,
Builtin,
MPMathFunction,
PrefixOperator,
SympyFunction,
)
from mathics.core.convert.expression import to_expression
from mathics.core.convert.sympy import from_sympy
from mathics.core.expression import Expression
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/arithfns/sums.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""


from mathics.builtin.base import Builtin
from mathics.core.builtin import Builtin


class Accumulate(Builtin):
Expand Down
18 changes: 9 additions & 9 deletions mathics/builtin/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@

import sympy

from mathics.builtin.base import (
Builtin,
IterationFunction,
MPMathFunction,
Predefined,
SympyFunction,
SympyObject,
Test,
)
from mathics.builtin.inference import get_assumptions_list
from mathics.builtin.numeric import Abs
from mathics.builtin.scoping import dynamic_scoping
Expand All @@ -41,6 +32,15 @@
A_NUMERIC_FUNCTION,
A_PROTECTED,
)
from mathics.core.builtin import (
Builtin,
IterationFunction,
MPMathFunction,
Predefined,
SympyFunction,
SympyObject,
Test,
)
from mathics.core.convert.sympy import SympyExpression, from_sympy, sympy_symbol_prefix
from mathics.core.element import BaseElement
from mathics.core.evaluation import Evaluation
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/assignments/assign_binaryop.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"""


from mathics.builtin.base import BinaryOperator, PostfixOperator, PrefixOperator
from mathics.core.attributes import A_HOLD_FIRST, A_PROTECTED, A_READ_PROTECTED
from mathics.core.builtin import BinaryOperator, PostfixOperator, PrefixOperator


class AddTo(BinaryOperator):
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/assignments/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""


from mathics.builtin.base import BinaryOperator, Builtin
from mathics.core.assignment import (
ASSIGNMENT_FUNCTION_MAP,
AssignmentException,
Expand All @@ -18,6 +17,7 @@
A_PROTECTED,
A_SEQUENCE_HOLD,
)
from mathics.core.builtin import BinaryOperator, Builtin
from mathics.core.symbols import SymbolNull
from mathics.core.systemsymbols import SymbolFailed
from mathics.eval.pymathics import PyMathicsLoadException, eval_LoadModule
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/assignments/clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""


from mathics.builtin.base import Builtin, PostfixOperator
from mathics.core.assignment import is_protected
from mathics.core.atoms import String
from mathics.core.attributes import (
Expand All @@ -16,6 +15,7 @@
A_PROTECTED,
A_READ_PROTECTED,
)
from mathics.core.builtin import Builtin, PostfixOperator
from mathics.core.expression import Expression
from mathics.core.symbols import Atom, Symbol, SymbolNull, symbol_set
from mathics.core.systemsymbols import (
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/assignments/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"""


from mathics.builtin.base import Builtin
from mathics.core.assignment import get_symbol_values
from mathics.core.attributes import A_HOLD_ALL, A_PROTECTED
from mathics.core.builtin import Builtin


class DefaultValues(Builtin):
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/assignments/upvalues.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
https://reference.wolfram.com/language/tutorial/TransformationRulesAndDefinitions.html#6972</url>.
"""

from mathics.builtin.base import Builtin
from mathics.core.assignment import get_symbol_values
from mathics.core.attributes import A_HOLD_ALL, A_PROTECTED
from mathics.core.builtin import Builtin


# In Mathematica 5, this appears under "Types of Values".
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/atomic/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Atomic Primitives
"""

from mathics.builtin.base import Builtin, Test
from mathics.core.atoms import Atom
from mathics.core.builtin import Builtin, Test


class AtomQ(Test):
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/atomic/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import mpmath
import sympy

from mathics.builtin.base import Builtin, Predefined
from mathics.core.atoms import Integer, Integer0, Integer10, MachineReal, Rational
from mathics.core.attributes import A_LISTABLE, A_PROTECTED
from mathics.core.builtin import Builtin, Predefined
from mathics.core.convert.python import from_python
from mathics.core.expression import Expression
from mathics.core.list import ListExpression
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/atomic/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

from mathics_scanner import TranslateError

from mathics.builtin.base import Builtin, Predefined, PrefixOperator, Test
from mathics.core.atoms import Integer, Integer0, Integer1, String
from mathics.core.attributes import A_LISTABLE, A_PROTECTED
from mathics.core.builtin import Builtin, Predefined, PrefixOperator, Test
from mathics.core.convert.expression import to_mathics_list
from mathics.core.convert.python import from_bool
from mathics.core.convert.regex import to_regex
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/atomic/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from mathics_scanner import is_symbol_name

from mathics.builtin.base import Builtin, PrefixOperator, Test
from mathics.core.assignment import get_symbol_values
from mathics.core.atoms import String
from mathics.core.attributes import (
Expand All @@ -22,6 +21,7 @@
A_SEQUENCE_HOLD,
attributes_bitset_to_list,
)
from mathics.core.builtin import Builtin, PrefixOperator, Test
from mathics.core.convert.expression import to_mathics_list
from mathics.core.convert.regex import to_regex
from mathics.core.evaluation import Evaluation
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
sort_order = "mathics.builtin.definition-attributes"


from mathics.builtin.base import Builtin, Predefined
from mathics.core.assignment import get_symbol_list
from mathics.core.atoms import String
from mathics.core.attributes import (
Expand All @@ -29,6 +28,7 @@
attribute_string_to_number,
attributes_bitset_to_list,
)
from mathics.core.builtin import Builtin, Predefined
from mathics.core.expression import Expression
from mathics.core.list import ListExpression
from mathics.core.symbols import Symbol, SymbolNull
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/binary/bytearray.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Byte Arrays
"""

from mathics.builtin.base import Builtin
from mathics.core.atoms import ByteArrayAtom, Integer, String
from mathics.core.builtin import Builtin
from mathics.core.convert.expression import to_mathics_list
from mathics.core.expression import Expression
from mathics.core.systemsymbols import SymbolByteArray, SymbolFailed
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/binary/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import mpmath
import sympy

from mathics.builtin.base import Builtin
from mathics.core.atoms import Complex, Integer, MachineReal, Real, String
from mathics.core.builtin import Builtin
from mathics.core.convert.expression import to_expression, to_mathics_list
from mathics.core.convert.mpmath import from_mpmath
from mathics.core.expression import Expression
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/binary/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import sys

from mathics.builtin.base import Predefined
from mathics.core.atoms import Integer, Integer1, IntegerM1
from mathics.core.builtin import Predefined


class ByteOrdering(Predefined):
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/binary/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""


from mathics.builtin.base import Builtin
from mathics.core.builtin import Builtin


class Byte(Builtin):
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/box/expression.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This is never intended to go in Mathics3 docs
no_doc = True

from mathics.builtin.base import BuiltinElement
from mathics.core.attributes import A_PROTECTED, A_READ_PROTECTED
from mathics.core.builtin import BuiltinElement
from mathics.core.element import BoxElementMixin
from mathics.core.expression import Expression
from mathics.core.list import ListExpression
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/box/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
collection of Expressions usually contained in boxes.
"""

from mathics.builtin.base import Builtin
from mathics.builtin.box.expression import BoxExpression
from mathics.builtin.options import options_to_rules
from mathics.core.atoms import Atom, String
from mathics.core.attributes import A_HOLD_ALL_COMPLETE, A_PROTECTED, A_READ_PROTECTED
from mathics.core.builtin import Builtin
from mathics.core.element import BoxElementMixin
from mathics.core.evaluation import Evaluation
from mathics.core.exceptions import BoxConstructError
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/colors/color_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

from math import atan2, cos, exp, pi, radians, sin, sqrt

from mathics.builtin.base import Builtin
from mathics.builtin.colors.color_internals import convert_color
from mathics.builtin.drawing.graphics_internals import _GraphicsDirective, get_class
from mathics.core.atoms import Integer, MachineReal, Real, String
from mathics.core.builtin import Builtin
from mathics.core.convert.expression import to_expression, to_mathics_list
from mathics.core.convert.python import from_python
from mathics.core.element import ImmutableValueMixin
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/colors/color_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import itertools
from math import floor

from mathics.builtin.base import Builtin
from mathics.builtin.colors.color_directives import ColorError, RGBColor, _ColorObject
from mathics.builtin.colors.color_internals import convert_color
from mathics.builtin.image.base import Image
from mathics.core.atoms import Integer, MachineReal, Rational, Real, String
from mathics.core.builtin import Builtin
from mathics.core.convert.expression import to_expression, to_mathics_list
from mathics.core.evaluation import Evaluation
from mathics.core.expression import Expression
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/colors/named_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Mathics has definitions for the most common color names which can be used in a graphics or style specification.
"""

from mathics.builtin.base import Builtin
from mathics.core.builtin import Builtin
from mathics.core.symbols import strip_context


Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import ctypes
from types import FunctionType

from mathics.builtin.base import Builtin
from mathics.builtin.box.compilation import CompiledCodeBox
from mathics.core.atoms import Integer, String
from mathics.core.attributes import A_HOLD_ALL, A_PROTECTED
from mathics.core.builtin import Builtin
from mathics.core.convert.expression import to_mathics_list
from mathics.core.convert.function import (
CompileDuplicateArgName,
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import base64
import zlib

from mathics.builtin.base import Builtin
from mathics.core.atoms import String
from mathics.core.builtin import Builtin
from mathics.core.evaluation import Evaluation


Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/datentime.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

import dateutil.parser

from mathics.builtin.base import Builtin, Predefined
from mathics.core.atoms import Integer, Real, String
from mathics.core.attributes import (
A_HOLD_ALL,
A_NO_ATTRIBUTES,
A_PROTECTED,
A_READ_PROTECTED,
)
from mathics.core.builtin import Builtin, Predefined
from mathics.core.convert.expression import to_expression, to_mathics_list
from mathics.core.convert.python import from_python
from mathics.core.element import ImmutableValueMixin
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/directories/directory_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import os
import os.path as osp

from mathics.builtin.base import Builtin
from mathics.core.atoms import String
from mathics.core.builtin import Builtin
from mathics.core.convert.expression import to_expression
from mathics.core.convert.python import from_python
from mathics.core.evaluation import Evaluation
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/directories/directory_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import shutil
import tempfile

from mathics.builtin.base import Builtin
from mathics.core.atoms import String
from mathics.core.attributes import A_LISTABLE, A_PROTECTED
from mathics.core.builtin import Builtin
from mathics.core.convert.expression import to_expression
from mathics.core.evaluation import Evaluation
from mathics.core.symbols import SymbolNull
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/directories/system_directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
System File Directories
"""

from mathics.builtin.base import Predefined
from mathics.core.atoms import String
from mathics.core.attributes import A_NO_ATTRIBUTES
from mathics.core.builtin import Predefined
from mathics.core.evaluation import Evaluation
from mathics.core.streams import ROOT_DIR
from mathics.eval.directories import INITIAL_DIR, SYS_ROOT_DIR, TMP_DIR
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/directories/user_directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import os

from mathics.builtin.base import Predefined
from mathics.core.atoms import String
from mathics.core.attributes import A_NO_ATTRIBUTES
from mathics.core.builtin import Predefined
from mathics.core.convert.expression import to_mathics_list
from mathics.core.evaluation import Evaluation
from mathics.core.streams import HOME_DIR, PATH_VAR
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/distance/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
kmeans,
optimize,
)
from mathics.builtin.base import Builtin
from mathics.builtin.options import options_to_rules
from mathics.core.atoms import FP_MANTISA_BINARY_DIGITS, Integer, Real, String, min_prec
from mathics.core.builtin import Builtin
from mathics.core.convert.expression import to_mathics_list
from mathics.core.evaluation import Evaluation
from mathics.core.expression import Expression
Expand Down
Loading
Loading