diff --git a/CHANGES.rst b/CHANGES.rst index 1af44ad84..74ec6be2b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -194,7 +194,7 @@ Incompatible changes Scanner API has changed. Options on ``mathics`` CLI have changed. See above for the changes. Location of ``mathics`` in ``mathics.__main__``, the more usual location, rather than ``mathics.main``. -* Mathics scanner exceptions of class TranslateError are incompatible +* Mathics3 scanner exceptions of class TranslateError are incompatible with previous versions, and now store error parameters, "name", "tag", and "args". * The method ``get_sort_key()`` was replaced by two different properties: @@ -223,7 +223,7 @@ This is needed for the PacletManager code to work better. Compatibility ------------- -#. When the result of an evaluation is ``Symbol`Null``, Mathics CLI +#. When the result of an evaluation is ``Symbol`Null``, Mathics3 CLI now does not show an ``Out[...]=`` line, following the behavior of the WMA CLI. #. Asymptote rendering of Platonic solids added. diff --git a/COPYING.txt b/COPYING.txt index 68065d9e8..542a61c75 100644 --- a/COPYING.txt +++ b/COPYING.txt @@ -2,7 +2,7 @@ This file is about the copyright on Mathics3 and all included components. * ORIGINAL MATHICS CODE: - All original Mathics code is distributed under the terms of the + All original Mathics3 code is distributed under the terms of the GNU General Public License, version 3. This code is distributed in the hope that it will be useful, @@ -11,7 +11,7 @@ This file is about the copyright on Mathics3 and all included components. General Public License for more details. The full text of the GPL is available below in this file. Details of -the licenses of the components of Mathics are included below as well. +the licenses of the components of Mathics3 are included below as well. * LICENSES OF INCLUDED DATA: diff --git a/FUTURE.rst b/FUTURE.rst index 9aa7e3a1e..290e36f20 100644 --- a/FUTURE.rst +++ b/FUTURE.rst @@ -132,7 +132,7 @@ This is done largely outside of Mathics-core, although it heavily relies on Math Operator Precedence Tables -------------------------- -This pulls out of Mathics Core any knowledge of Operator Precedence and instead uses tables found in mathics-scanner. +This pulls out of Mathics3 Core any knowledge of Operator Precedence and instead uses tables found in mathics-scanner. This would be based on Robert Jacobson's work. Miscellaneous Small Things @@ -150,7 +150,7 @@ Rocky - Debugger - Compilation - Literal Expressions for performance (e.g., data processing and graphics rendering) -- Mathics Autoloading (with mmatera) +- Mathics3 Autoloading (with mmatera) - Operator Precedence (with mmatera) - Releases (with mmatera) @@ -398,7 +398,7 @@ Documentation ------------- Sometime around release 4.0.0, all of the code related to producing -documentation in LaTeX and in Mathics Django, and running doctests +documentation in LaTeX and in Mathics3 Django, and running doctests will be split off and put into its own git repository. I've spent a lot of time banging on this to try to get to be @@ -427,7 +427,7 @@ Support for External Packages ----------------------------- I would have liked to have seen this going earlier. However right now -Mathics is still at too primitive a level for any serious package to +Mathics3 is still at too primitive a level for any serious package to be run on it. This will change at some point though. Support for Mathematica Language Levels diff --git a/REPORTING-BUGS.md b/REPORTING-BUGS.md index 62379416b..50f7b752e 100644 --- a/REPORTING-BUGS.md +++ b/REPORTING-BUGS.md @@ -15,7 +15,7 @@ Reporting bugs in a thoughtful way is helpful. -However any project that attempts to mimic the Wolfram Language is going fall short. It is easy to find in a matter of minutes some built-in function Mathics doesn't implement but is in WL. Or that is implemented but doesn't match WL. +However any project that attempts to mimic the Wolfram Language is going fall short. It is easy to find in a matter of minutes some built-in function Mathics3 doesn't implement but is in WL. Or that is implemented but doesn't match WL. # Issues and Issue Fixers, Priorities diff --git a/admin-tools/release.sh b/admin-tools/release.sh index d2bb94d32..5b039f996 100755 --- a/admin-tools/release.sh +++ b/admin-tools/release.sh @@ -16,7 +16,7 @@ cd $(dirname ${BASH_SOURCE[0]}) owd=$(pwd) cd .. version=`python -c "import mathics; print(mathics.__version__)"` -echo "Releasing Mathics $version" +echo "Releasing Mathics3 $version" rm -rf build/release python setup.py build diff --git a/examples/symbolic_logic/gries_schneider/GS1.m b/examples/symbolic_logic/gries_schneider/GS1.m index c51af83f8..b19cb40a8 100644 --- a/examples/symbolic_logic/gries_schneider/GS1.m +++ b/examples/symbolic_logic/gries_schneider/GS1.m @@ -36,7 +36,7 @@ | |/ -_) \ / _| || / _` | | \__ \ || | '_ (_-< _| | _| || | _| / _ \ ' \ |_|\___/_\_\\__|\_,_\__,_|_| |___/\_,_|_.__/__/\__|_|\__|\_,_|\__|_\___/_||_| - Mathics gives us direct syntax for Gries & Schneider's (G&S)'s "textual + Mathics3 gives us direct syntax for Gries & Schneider's (G&S)'s "textual substitution:" Gries & Schneider Us Expected Output @@ -57,17 +57,16 @@ "~/some/directory/GS1.m". Then, run mathics at the terminal and load the file; you should see approximately the following: - $ mathics + $ mathics3 - Mathics 1.1.dev0 - on CPython 3.7.6 (default, Jan 8 2020, 19:59:22) - using SymPy 1.6.2, mpmath 1.1.0 + Mathics3 10.0.0 + Running on linux CPython 3.14.3 (main, Mar 30 2026, 06:42:16) [GCC 13.3.0] + using SymPy 1.13.3, mpmath 1.3.0, numpy 2.4.4, cython 3.2.4, scipy 1.17.1, skimage 0.26.0 - Copyright (C) 2011-2020 The Mathics Team. + Copyright (C) 2011-2026 The Mathics3 Team. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. - See the documentation for the full license. Quit by pressing CONTROL-D @@ -193,7 +192,7 @@ (* At this point, Q and x have no values. In most programming languages, a variable with no value is an error. In mathics, however, a variable with no - value is just itself: a symbolic constant. Mathics keeps rewriting + value is just itself: a symbolic constant. Mathics3 keeps rewriting expressions until they don't change any more. Integers evaluate to themselves, strings evaluate to themselves, and symbols that don't have values (or rules) attached to them evaluate to themselves. What does it mean @@ -368,7 +367,7 @@ An "evaluation leak" is an inadvertent early evaluation. Evaluation leaks might not affect the truth value of a theorem, say as when we know on the side that some divisor is non-zero. But evaluation leaks always affect - display of steps of a proof. Mathics applies built-in rules as soon as it + display of steps of a proof. Mathics3 applies built-in rules as soon as it can, interrupting our flow of human reasoning. We must control evaluation ourselves, watching our rules at work and putting them to work explicitly. @@ -383,7 +382,7 @@ On the other hand, if we avoid built-ins, we must write, for example, the inert expression div[2 (j+5), 2] instead of 2 (j + 5) / 2 to prevent early - cancellation. Mathics doesn't have a definition for "div", so can't reduce + cancellation. Mathics3 doesn't have a definition for "div", so can't reduce the expression. The expression just evaluates to itself, and that's what we mean by "inert." We lose pretty syntax, at least until we do something like the following: @@ -396,7 +395,7 @@ (* **************************************************************************** The mathics rule to the right of "/." has pattern variables "a_" and "b_". - Mathics replaces them with "2 (j+5)" and "2", respectively, by matching the + Mathics3 replaces them with "2 (j+5)" and "2", respectively, by matching the pattern expression div[a_, b_] @@ -418,7 +417,7 @@ W H E N I N D O U B T , U S E F U L L F O R M - Mathics has a lot of syntax and it can take a while to learn it. If in + Mathics3 has a lot of syntax and it can take a while to learn it. If in any doubt about the meaning of any syntax, just pop it into a FullForm expression and get more info. FullForm always works, and syntax is never necessary. You can always replace any syntax you don't like with the @@ -632,7 +631,7 @@ aggressively evaluates the right-hand side of the rule, namely a / b, producing just a / b, itself, an expression in terms of symbolic constants that mathics cannot further reduce. The whole "ReplaceAll" expression - produces the expected "42". Mathics replaces the pattern variables "a_" and + produces the expected "42". Mathics3 replaces the pattern variables "a_" and "b_" with actual arguments "1764" and "42", respectively, then evaluates the right-hand side "a / b" again. @@ -718,7 +717,7 @@ application time (later), just as we can write some unnamed rules with "->" neqv[p_, q_] := not[eqv[p, q]] eqv[p_, q_] := not[neqv[p, q]] - Mathics will rewrite an occurrence of neqv as not[eqv[...]], then rewrite + Mathics3 will rewrite an occurrence of neqv as not[eqv[...]], then rewrite the internal occurrence of eqv, producing not[not[neqv[...]]], and so on, forever: @@ -1015,7 +1014,7 @@ over and over (google "don't repeat yourself"), introduce "Postfix notation {sameq[e / c ^ 2, m], sameq[div[e, c ^ 2], m]} - Mathics takes away all our fun, proving the theorem right away in the second + Mathics3 takes away all our fun, proving the theorem right away in the second step. That's ok, we already knew that would happen, and we won't let it interfere with our pedantic, detailed proofs. @@ -1232,7 +1231,7 @@ over and over (google "don't repeat yourself"), introduce "Postfix notation (* **************************************************************************** To write the functional version of Leibiz's law / rule, we don't need to - delete (ClearAll) the old, substitution version. Mathics can distinguish the + delete (ClearAll) the old, substitution version. Mathics3 can distinguish the old version, which has three arguments, from the new version, which has two arguments, when the rule is invoked. @@ -1244,7 +1243,7 @@ over and over (google "don't repeat yourself"), introduce "Postfix notation rewriting. All rules we've define so far are unconditional, with one exception. In defining "substitutionInferenceRule", we stipulated that the terms "f" and "v" must have type "List" (review the definition). We make - greater use of conditions below. Mathics's conditional facility is very + greater use of conditions below. Mathics3's conditional facility is very powerful, encompassing things like "dependent types," which are only recently being researched in statically typed languages like Agda. Because mathics checks types at run-time, it can apply arbitrary conditions: just @@ -1269,7 +1268,7 @@ over and over (google "don't repeat yourself"), introduce "Postfix notation g applied to X (g.X) is E[z := X] if g.z : E defines g of z. - This is a one-shot application of the rule z :> x. Mathics rewrites g once, + This is a one-shot application of the rule z :> x. Mathics3 rewrites g once, not repeatedly until nothing changes. *) @@ -1300,7 +1299,7 @@ g applied to X (g.X) is E[z := X] if g.z : E defines g of z. Two-term leibniz overload. - This is a multi-shot rule. Mathics will rewrite until nothing changes any + This is a multi-shot rule. Mathics3 will rewrite until nothing changes any more. *) @@ -1549,7 +1548,7 @@ calculus is (from page 42) isValid [ hoareTriple [p_, s_, q_] ] := blahblah isValid [ somethingElse [ x_, y_, z_ ] := yaketyyak - Mathics stores these as separate overloads of "isValid" because they have + Mathics3 stores these as separate overloads of "isValid" because they have different patterns, each requiring the evident literal head. The following is "multiple assignments" on page 19. We treat single diff --git a/examples/symbolic_logic/gries_schneider/GS2.m b/examples/symbolic_logic/gries_schneider/GS2.m index 86d831e2a..abced70c9 100644 --- a/examples/symbolic_logic/gries_schneider/GS2.m +++ b/examples/symbolic_logic/gries_schneider/GS2.m @@ -243,7 +243,7 @@ target f(a). The number of different ways to assign ||B|| values to ||A|| *) -(* Mathics has an open bug preventing evaluation of the binary truth table +(* Mathics had an open bug preventing evaluation of the binary truth table when the input is a variable. https://github.com/mathics/Mathics/issues/960 diff --git a/mathics/autoload-cli/settings.m b/mathics/autoload-cli/settings.m index 019b28b01..92d9ba45e 100644 --- a/mathics/autoload-cli/settings.m +++ b/mathics/autoload-cli/settings.m @@ -1,6 +1,6 @@ -(***********************************) -(* Settings for Mathics CLI script *) -(***********************************) +(************************************) +(* Settings for Mathics3 CLI script *) +(************************************) System`$Notebooks::usage = "Set True if the Mathics is being used with a notebook-based front end."; System`$Notebooks = False; diff --git a/mathics/benchmark.py b/mathics/benchmark.py index 23bd39f4a..d58d018ea 100644 --- a/mathics/benchmark.py +++ b/mathics/benchmark.py @@ -25,7 +25,7 @@ def median(li): TESTS_PER_BENCHMARK = None -# Mathics expressions to benchmark +# Mathics3 expressions to benchmark BENCHMARKS = { "NumericQ": [ "NumericQ[Sqrt[2]]", @@ -227,7 +227,7 @@ def benchmark_all_sections(): def main(): global evaluation, TESTS_PER_BENCHMARK - parser = ArgumentParser(description="Mathics benchmark suite.", add_help=False) + parser = ArgumentParser(description="Mathics3 benchmark suite.", add_help=False) parser.add_argument( "--help", "-h", help="show this help message and exit", action="help" @@ -248,7 +248,7 @@ def main(): "-e", dest="expression", metavar="EXPRESSION", - help="benchmark a valid Mathics expression", + help="benchmark a valid Mathics3 expression", ) parser.add_argument( diff --git a/mathics/builtin/__init__.py b/mathics/builtin/__init__.py index ab7d6a7cd..25b2a627e 100755 --- a/mathics/builtin/__init__.py +++ b/mathics/builtin/__init__.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- """ -Mathics Builtin Functions and Variables. +Mathics3 Builtin Functions and Variables. -Mathics has over a thousand Built-in functions and variables, all of +Mathics3 has over a thousand Built-in functions and variables, all of which are defined here. Note that there are other modules to collect specific aspects a @@ -10,7 +10,7 @@ ``mathics.format.render`` for rendering details, or ``mathics.compile`` for compilation details. -A Mathics Builtin is implemented one of a particular kind of Python +A Mathics3 Builtin is implemented one of a particular kind of Python class. Within these classes class variables give properties of the builtin class such as the Builtin's Attributes, its Information text, among other things. diff --git a/mathics/builtin/arithmetic.py b/mathics/builtin/arithmetic.py index 5ee49d020..d5ea760ba 100644 --- a/mathics/builtin/arithmetic.py +++ b/mathics/builtin/arithmetic.py @@ -1097,7 +1097,7 @@ def to_sympy(self, expr, **kwargs) -> Optional[SympyExpression]: var_min_max = index.elements[:3] bounds = [expr.to_sympy(**arg_kwargs) for expr in var_min_max] if evaluation: - # Min and max might be Mathics expressions. If so, evaluate them. + # Min and max might be Mathics3 expressions. If so, evaluate them. for i in (1, 2): min_max_expr = var_min_max[i] if not isinstance(expr, Symbol): @@ -1108,12 +1108,12 @@ def to_sympy(self, expr, **kwargs) -> Optional[SympyExpression]: # FIXME: The below tests on SympyExpression, but really the # test should be broader. if isinstance(f_sympy, sympy.core.basic.Basic): - # sympy.summation() won't be able to handle Mathics functions in + # sympy.summation() won't be able to handle Mathics3 functions in # in its first argument, the function parameter. # For example in Sum[Identity[x], {x, 3}], sympy.summation can't # evaluate Identity[x]. # In general we want to avoid using Sympy if we can. - # If we have integer bounds, we'll use Mathics's iterator Sum + # If we have integer bounds, we'll use Mathics3's iterator Sum # (which is Plus) if evaluation and all( @@ -1122,7 +1122,7 @@ def to_sympy(self, expr, **kwargs) -> Optional[SympyExpression]: for i in bounds[1:] ): # When we have integer bounds, it is better to not use Sympy but - # use Mathics evaluation. We turn: + # use Mathics3 evaluation. We turn: # Sum[f[x], {}] into # MathicsSum[Table[f[x], {}]] # where MathicsSum is self.get_result() our Iteration iterator. diff --git a/mathics/builtin/assignments/assignment.py b/mathics/builtin/assignments/assignment.py index 51877fefd..e553f94c7 100644 --- a/mathics/builtin/assignments/assignment.py +++ b/mathics/builtin/assignments/assignment.py @@ -29,7 +29,7 @@ class LoadModule(Builtin):
'LoadModule'[$module$] -
'Load Mathics definitions from the python module $module$ +
'Load Mathics3 definitions from the python module $module$
>> LoadModule["nomodule"] diff --git a/mathics/builtin/assignments/types.py b/mathics/builtin/assignments/types.py index ef755af5b..14ed82be8 100644 --- a/mathics/builtin/assignments/types.py +++ b/mathics/builtin/assignments/types.py @@ -120,7 +120,7 @@ class NValues(Builtin): >> N[c] = c - Mathics will assign any list of rules to 'NValues'; however, \ + Mathics3 will assign any list of rules to 'NValues'; however, \ inappropriate rules will never be used: >> NValues[d] = {foo -> bar}; >> NValues[d] diff --git a/mathics/builtin/atomic/symbols.py b/mathics/builtin/atomic/symbols.py index a483c9b60..04b77a67b 100644 --- a/mathics/builtin/atomic/symbols.py +++ b/mathics/builtin/atomic/symbols.py @@ -361,7 +361,7 @@ class DownValues(Builtin): >> DownValues[f] = {HoldPattern[f[x_]] ⧴ x ^ 2} - Mathics will sort the rules you assign to a symbol according to \ + Mathics3 will sort the rules you assign to a symbol according to \ their specificity. If it cannot decide which rule is more special, \ the newer one will get higher precedence. >> f[x_Integer] := 2 diff --git a/mathics/builtin/attributes.py b/mathics/builtin/attributes.py index 90c950641..424ed9b23 100644 --- a/mathics/builtin/attributes.py +++ b/mathics/builtin/attributes.py @@ -13,10 +13,6 @@ However in contrast to \\Mathematica, you can set any symbol as an attribute. """ -# This tells documentation how to sort this module -sort_order = "mathics.builtin.definition-attributes" - - from mathics.core.assignment import get_symbol_list from mathics.core.atoms import String from mathics.core.attributes import ( @@ -33,6 +29,9 @@ from mathics.core.list import ListExpression from mathics.core.symbols import Symbol, SymbolNull +# This tells documentation how to sort this module +sort_order = "mathics.builtin.definition-attributes" + SymbolClearAttributes = Symbol("ClearAttributes") SymbolSetAttributes = Symbol("SetAttributes") SymbolProtected = Symbol("Protected") diff --git a/mathics/builtin/box/expression.py b/mathics/builtin/box/expression.py index 8a0410530..e68904aab 100644 --- a/mathics/builtin/box/expression.py +++ b/mathics/builtin/box/expression.py @@ -199,7 +199,7 @@ def replace_vars(self, vars, options=None, in_scoping=True, in_function=True): return result def sameQ(self, expr) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" return expr.sameQ(self.to_expression()) def tex_block(self, tex, only_subsup=False): diff --git a/mathics/builtin/colors/color_operations.py b/mathics/builtin/colors/color_operations.py index 42048e4fc..6280a88bd 100644 --- a/mathics/builtin/colors/color_operations.py +++ b/mathics/builtin/colors/color_operations.py @@ -298,10 +298,10 @@ class DominantColors(Builtin): - The option "ColorCoverage" specifies the minimum amount of coverage needed to \ + The option 'ColorCoverage' specifies the minimum amount of coverage needed to \ include a dominant color in the result. - The option "MinColorDistance" specifies the distance (in LAB color space) up \ + The option 'MinColorDistance' specifies the distance (in LAB color space) up \ to which colors are merged and thus regarded as belonging to the same dominant color. >> img = Import["ExampleData/hedy.tif"] diff --git a/mathics/builtin/datentime.py b/mathics/builtin/datentime.py index 760593b7f..b23e70f66 100644 --- a/mathics/builtin/datentime.py +++ b/mathics/builtin/datentime.py @@ -420,7 +420,7 @@ class AbsoluteTiming(Builtin): attributes = A_HOLD_ALL | A_PROTECTED - summary_text = "get total wall-clock time to run a Mathics command" + summary_text = "get total wall-clock time to run a Mathics3 command" def eval(self, expr: BaseElement, evaluation: Evaluation) -> ListExpression: "AbsoluteTiming[expr_]" diff --git a/mathics/builtin/directories/system_directories.py b/mathics/builtin/directories/system_directories.py index 06c313978..c916b072b 100644 --- a/mathics/builtin/directories/system_directories.py +++ b/mathics/builtin/directories/system_directories.py @@ -46,7 +46,7 @@ class InitialDirectory(Predefined): """ name = "$InitialDirectory" - summary_text = "initial directory when Mathics was started" + summary_text = "initial directory when Mathics3 was started" def evaluate(self, evaluation: Evaluation): return String(INITIAL_DIR) @@ -68,7 +68,7 @@ class InstallationDirectory(Predefined): attributes = A_NO_ATTRIBUTES name = "$InstallationDirectory" - summary_text = "Mathics installation directory" + summary_text = "Mathics3 installation directory" def evaluate(self, evaluation): global ROOT_DIR diff --git a/mathics/builtin/image/base.py b/mathics/builtin/image/base.py index 5fb64e10b..5a45522ce 100644 --- a/mathics/builtin/image/base.py +++ b/mathics/builtin/image/base.py @@ -195,7 +195,7 @@ def options(self): ) def sameQ(self, other) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" if not isinstance(other, Image): return False if self.color_space != other.color_space or self.metadata != other.metadata: diff --git a/mathics/builtin/kernel_sessions.py b/mathics/builtin/kernel_sessions.py index 78105c991..0b464744f 100644 --- a/mathics/builtin/kernel_sessions.py +++ b/mathics/builtin/kernel_sessions.py @@ -68,7 +68,7 @@ class Quit(Builtin):
'Quit'[] -
Terminates the Mathics session. +
Terminates the Mathics3 session.
'Quit'[$n$]
Terminates the mathics session with exit code $n$. @@ -93,7 +93,7 @@ class Exit(Quit):
'Exit'[] -
Terminates the Mathics session. +
Terminates the Mathics3 session.
'Exit'[$n$]
Terminates the mathics session with exit code $n$. diff --git a/mathics/builtin/list/rearrange.py b/mathics/builtin/list/rearrange.py index 1f2abac61..a57d4ed6b 100644 --- a/mathics/builtin/list/rearrange.py +++ b/mathics/builtin/list/rearrange.py @@ -77,7 +77,7 @@ def select(self, elem): return self._hashes[hash(elem)] def sameQ(self, a, b) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" return a.sameQ(b) @@ -284,7 +284,7 @@ def select(self, elem): return self._groups def sameQ(self, a, b) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" return _test_pair(self._test, a, b, self._evaluation, self._name) @@ -781,7 +781,7 @@ def eval(self, expr: BaseElement, n: Number, h, evaluation): n_int = -1 # a negative number indicates an unbounded level else: n_int = n.get_int_value() - # Here we test for negative since in Mathics Flatten[] as opposed to flatten_with_respect_to_head() + # Here we test for negative since in Mathics3 Flatten[] as opposed to flatten_with_respect_to_head() # negative numbers (and None) are not allowed. if n_int is None or n_int < 0: evaluation.message("Flatten", "flpi", n) diff --git a/mathics/builtin/manipulate.py b/mathics/builtin/manipulate.py index 8fa6b6eb5..dde080d6b 100644 --- a/mathics/builtin/manipulate.py +++ b/mathics/builtin/manipulate.py @@ -122,7 +122,7 @@ # self._widgets = [] # the ipywidget widgets to control the manipulated variables # self._parsers = ( # {} -# ) # lambdas to decode the widget values into Mathics expressions +# ) # lambdas to decode the widget values into Mathics3 expressions # def add(self, expression, evaluation): # expr = Expression("System`Private`ManipulateParameter", expression).evaluate( diff --git a/mathics/builtin/no_meaning/infix.py b/mathics/builtin/no_meaning/infix.py index 1a4828893..e1d460a6d 100644 --- a/mathics/builtin/no_meaning/infix.py +++ b/mathics/builtin/no_meaning/infix.py @@ -18,7 +18,7 @@ def create_class_function( ) -> type: """ Returns a Mathics3 Builtin function associated with this module - (mathics.builtin.no_meaning.infix) that implements a Mathics infix operator + (mathics.builtin.no_meaning.infix) that implements a Mathics3 infix operator with no pre-existing meaning. """ return type( diff --git a/mathics/builtin/no_meaning/postfix.py b/mathics/builtin/no_meaning/postfix.py index 08ba4ea59..2242a250f 100644 --- a/mathics/builtin/no_meaning/postfix.py +++ b/mathics/builtin/no_meaning/postfix.py @@ -21,7 +21,7 @@ def create_class_function( ) -> type: """ Returns a Mathics3 Builtin function associated with this module - (mathics.builtin.no_meaning.postfix) that implements a Mathics postfix operator + (mathics.builtin.no_meaning.postfix) that implements a Mathics3 postfix operator with no pre-existing meaning. """ return type( diff --git a/mathics/builtin/no_meaning/prefix.py b/mathics/builtin/no_meaning/prefix.py index 6f48a908e..877f27083 100644 --- a/mathics/builtin/no_meaning/prefix.py +++ b/mathics/builtin/no_meaning/prefix.py @@ -18,7 +18,7 @@ def create_builtin_class_function( ) -> type: """ Returns a Mathics3 Builtin function associated with this module - (mathics.builtin.no_meaning.prefix) that implements a Mathics prefix operator + (mathics.builtin.no_meaning.prefix) that implements a Mathics3 prefix operator with no pre-existing meaning. """ return type( diff --git a/mathics/builtin/numbers/constants.py b/mathics/builtin/numbers/constants.py index c2d87cbc2..60441534f 100644 --- a/mathics/builtin/numbers/constants.py +++ b/mathics/builtin/numbers/constants.py @@ -673,7 +673,7 @@ class Pi(_MPMathConstant, _NumpyConstant, _SympyConstant): >> N[Pi, 20] = 3.1415926535897932385 - Note that the above is not the same thing as the number of digits after the decimal point. This may differ from similar concepts from other mathematical libraries, including those which Mathics uses! + Note that the above is not the same thing as the number of digits after the decimal point. This may differ from similar concepts from other mathematical libraries, including those which Mathics3 uses! Use numpy to compute Pi to 20 digits: >> N[Pi, 20, Method->"numpy"] diff --git a/mathics/builtin/scoping.py b/mathics/builtin/scoping.py index 6472423ed..e826afe4f 100644 --- a/mathics/builtin/scoping.py +++ b/mathics/builtin/scoping.py @@ -112,8 +112,8 @@ class Begin(Builtin): System`Private`$ContextStack = Append[System`Private`$ContextStack, $Context]; Protect[System`Private`$ContextStack]; (*Special case: context begins with a context mark <<`>>*) - $Context = If[StringTake[context, 1]=="`", - $Context<>StringTake[context,{2,-1}], + $Context = If[StringTake[context, 1]=="`", + $Context<>StringTake[context,{2,-1}], context ]; $Context @@ -148,8 +148,8 @@ class BeginPackage(Builtin): rules = { "expr:BeginPackage[context_String, pks_]": "Message[BeginPackage::cxls, context, pks]; expr", "expr:BeginPackage[context_String]": """ - If[Or[StringLength[context]<1, StringTake[context,-1]!="`"], - Message[BeginPackage::"ctx", context];Return[expr], + If[Or[StringLength[context]<1, StringTake[context,-1]!="`"], + Message[BeginPackage::"ctx", context];Return[expr], BeginPackage[context, {}] ]""", "expr:BeginPackage[context_String, pkg_String]": "BeginPackage[context,{pkg}]", @@ -524,7 +524,7 @@ class ModuleNumber_(Predefined):
  • '\$ModuleNumber' is incremented every time 'Module' or 'Unique' is called. -
  • a Mathics session starts with '\$ModuleNumber' set to 1. +2
  • a Mathics3 session starts with '\$ModuleNumber' set to 1.
  • You can reset '\$ModuleNumber' to a positive machine integer, but if \ you do so, naming conflicts may lead to inefficiencies.
  • diff --git a/mathics/builtin/system.py b/mathics/builtin/system.py index d0963ae4b..b082dfa49 100644 --- a/mathics/builtin/system.py +++ b/mathics/builtin/system.py @@ -363,7 +363,7 @@ class MathicsVersion(Predefined):
    'MathicsVersion' -
    this string is the version of Mathics we are running. +
    this string is the version of Mathics3 we are running.
    >> MathicsVersion @@ -552,7 +552,7 @@ class ProcessID(Predefined): """ name = "$ProcessID" - summary_text = "get process id of the Mathics process" + summary_text = "get process id of the Mathics3 process" @not_in_sandboxed_environment def evaluate(self, evaluation: Evaluation) -> Integer: diff --git a/mathics/core/atoms/numerics.py b/mathics/core/atoms/numerics.py index e7cbfec8c..08d6e6c46 100644 --- a/mathics/core/atoms/numerics.py +++ b/mathics/core/atoms/numerics.py @@ -44,7 +44,7 @@ class Number(Atom, ImmutableValueMixin, NumericOperators, Generic[T]): """ - Different kinds of Mathics Numbers, the main built-in subclasses + Different kinds of Mathics3 Numbers, the main built-in subclasses being: Integer, Rational, Real, Complex. """ @@ -198,7 +198,7 @@ class Integer(Number[int]): # Dictionary of Integer constant values defined so far. # We use this for object uniqueness. # The key is the Integer's Python `int` value, and the - # dictionary's value is the corresponding Mathics Integer object. + # dictionary's value is the corresponding Mathics3 Integer object. _integers: Dict[Any, "Integer"] = {} _value: int @@ -345,7 +345,7 @@ def to_sympy(self, **_) -> sympy_numbers.Integer: return self.sympy def sameQ(self, rhs) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" return isinstance(rhs, Integer) and self._value == rhs._value def do_copy(self) -> "Integer": @@ -450,7 +450,7 @@ class MachineReal(Real[float]): # Dictionary of MachineReal constant values defined so far. # We use this for object uniqueness. # The key is the MachineReal's Python `float` value, and the - # dictionary's value is the corresponding Mathics MachineReal object. + # dictionary's value is the corresponding Mathics3 MachineReal object. _machine_reals: Dict[Any, "MachineReal"] = {} _value: Union[float, mpmath.mpf] @@ -545,7 +545,7 @@ def is_zero(self) -> bool: return self._value == 0.0 def sameQ(self, rhs) -> bool: - """Mathics SameQ for MachineReal. + """Mathics3 SameQ for MachineReal. If the rhs comparison value is a MachineReal, the values have to be equal. If the rhs value is a PrecisionReal though, then the two values have to be within 1/2 ** (precision) of @@ -590,7 +590,7 @@ class PrecisionReal(Real[sympy.Float]): # Dictionary of PrecisionReal constant values defined so far. # We use this for object uniqueness. # The key is the PrecisionReal's sympy.Float, and the - # dictionary's value is the corresponding Mathics PrecisionReal object. + # dictionary's value is the corresponding Mathics3 PrecisionReal object. _precision_reals: Dict[Any, "PrecisionReal"] = {} _sympy: sympy.Float @@ -666,7 +666,7 @@ def round(self, d: Optional[int] = None) -> Union[MachineReal, "PrecisionReal"]: return PrecisionReal(sympy.Float(self.value, precision=_prec)) def sameQ(self, rhs) -> bool: - """Mathics SameQ for PrecisionReal""" + """Mathics3 SameQ for PrecisionReal""" if isinstance(rhs, PrecisionReal): other_value = rhs.value elif isinstance(rhs, MachineReal): @@ -710,7 +710,7 @@ class Complex(Number[Tuple[Number[T], Number[T], Optional[int]]]): # Dictionary of Complex constant values defined so far. # We use this for object uniqueness. # The key is the Complex value's real and imaginary parts as a tuple, - # dictionary's value is the corresponding Mathics Complex object. + # dictionary's value is the corresponding Mathics3 Complex object. _complex_numbers: Dict[Any, "Complex"] = {} # The precise value: a real number, an imaginary number, and a @@ -892,7 +892,7 @@ def round(self, d=None) -> "Complex": return Complex(real, imag) def sameQ(self, rhs) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" return ( isinstance(rhs, Complex) and self.real == rhs.real and self.imag == rhs.imag ) @@ -993,7 +993,7 @@ def round(self, d=None) -> Union["MachineReal", "PrecisionReal"]: return PrecisionReal(self.value.n(d)) def sameQ(self, rhs) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" return isinstance(rhs, Rational) and self.value == rhs.value @cache diff --git a/mathics/core/builtin.py b/mathics/core/builtin.py index b54d0c379..0c30758a3 100644 --- a/mathics/core/builtin.py +++ b/mathics/core/builtin.py @@ -650,7 +650,7 @@ def _get_unavailable_function(self) -> Optional[Callable]: def get_option_string(self, *params) -> Tuple[Optional[str], Optional[BaseElement]]: """ Return a tuple of a `str` representing the option name, - and the proper Mathics value of the option. + and the proper Mathics3 value of the option. If the value does not have a name, the name is None. """ s = self.get_option(*params) diff --git a/mathics/core/convert/function.py b/mathics/core/convert/function.py index 7c121dd88..a849893f7 100644 --- a/mathics/core/convert/function.py +++ b/mathics/core/convert/function.py @@ -138,8 +138,8 @@ def expression_to_callable_and_args( ) -> Tuple[Callable, Optional[list]]: """ Return a tuple of Python callable and a list of CompileArgs. - expr: A Mathics Expression object - vars: a list of Symbols or Mathics Lists of the form {Symbol, Type} + expr: A Mathics3 Expression object + vars: a list of Symbols or Mathics3 Lists of the form {Symbol, Type} """ args = collect_args(vars) diff --git a/mathics/core/convert/mpmath.py b/mathics/core/convert/mpmath.py index cf4895667..e0f9d1ae7 100644 --- a/mathics/core/convert/mpmath.py +++ b/mathics/core/convert/mpmath.py @@ -67,7 +67,7 @@ def from_mpmath( def to_mpmath_matrix(data, **kwargs): """ - Convert a Mathics matrix to one that can be used by mpmath. + Convert a Mathics3 matrix to one that can be used by mpmath. None is returned if we can't convert to a mpmath matrix. """ diff --git a/mathics/core/convert/op.py b/mathics/core/convert/op.py index 5f857d5a1..de342050d 100644 --- a/mathics/core/convert/op.py +++ b/mathics/core/convert/op.py @@ -98,7 +98,7 @@ def is_named_operator(str_op): @lru_cache(maxsize=1024) def ascii_op_to_unicode(ascii_op: str, encoding: str) -> str: """ - Convert an ASCII representation of a Mathics operator into its + Convert an ASCII representation of a Mathics3 operator into its Unicode equivalent based on encoding (in Mathics, $CharacterEncoding). If we can't come up with a unicode equivalent, just return "ascii_op". """ diff --git a/mathics/core/convert/python.py b/mathics/core/convert/python.py index 3973d04ef..8e2b5c71f 100644 --- a/mathics/core/convert/python.py +++ b/mathics/core/convert/python.py @@ -77,7 +77,7 @@ def from_complex(arg: complex) -> Complex: def from_python(arg: Any) -> BaseElement: - """Converts a Python expression into a Mathics expression.""" + """Converts a Python expression into a Mathics3 expression.""" from mathics.core.convert.expression import to_mathics_list from mathics.core.expression import Expression from mathics.core.list import ListExpression diff --git a/mathics/core/convert/sympy.py b/mathics/core/convert/sympy.py index c7a3918cb..5a9cf7fe1 100644 --- a/mathics/core/convert/sympy.py +++ b/mathics/core/convert/sympy.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -Converts expressions from SymPy to Mathics expressions. +Converts expressions from SymPy to Mathics3 expressions. Conversion to SymPy is handled directly in BaseElement descendants. """ from typing import TYPE_CHECKING, Dict, List, Optional, Sequence, Tuple, Union, cast @@ -116,7 +116,7 @@ def sympy_decode_mathics_symbol_name(name: str) -> str: """ - Remove the Prefix for Mathics symbols + Remove the Prefix for Mathics3 symbols and restore the context separator character. """ if name.startswith(SYMPY_SYMBOL_PREFIX): @@ -135,7 +135,7 @@ def is_Cn_expr(name: str) -> bool: def to_sympy_matrix(data, **kwargs) -> Optional[sympy.MutableDenseMatrix]: - """Convert a Mathics matrix to one that can be used by Sympy. + """Convert a Mathics3 matrix to one that can be used by Sympy. None is returned if we can't convert to a Sympy matrix. """ if not isinstance(data, list): @@ -147,7 +147,7 @@ def to_sympy_matrix(data, **kwargs) -> Optional[sympy.MutableDenseMatrix]: class SympyExpression(sympy.Expr): - """A Sympy expression with an associated Mathics expression""" + """A Sympy expression with an associated Mathics3 expression""" is_Function = True nargs = None @@ -162,7 +162,7 @@ def __new__(cls, *exprs, **kwargs): obj = super().__new__(cls, *exprs) obj.expr = None elif len(exprs) == 1 and isinstance(exprs[0], Expression): - # called with Mathics argument + # called with Mathics3 argument expr = exprs[0] sympy_head = expr.head.to_sympy() if kwargs.get("convert_functions_for_polynomialq", False): @@ -289,7 +289,7 @@ def symbol_to_sympy(symbol: Symbol, **kwargs) -> Sympy_Symbol: def to_numeric_sympy_args(mathics_args: BaseElement, evaluation) -> list: """ - Convert Mathics arguments, such as the arguments in an evaluation + Convert Mathics3 arguments, such as the arguments in an evaluation method a Python list that is sutiable for feeding as arguments into SymPy. @@ -312,7 +312,7 @@ def from_sympy_matrix( ) -> ListExpression: """ Convert `expr` of the type sympy.Matrix or sympy.ImmutableMatrix to - a Mathics list. + a Mathics3 list. """ if len(expr.shape) == 2 and (expr.shape[1] == 1): # This is a vector (only one column) @@ -345,7 +345,7 @@ def from_sympy_matrix( # def new_from_sympy(expr)->BaseElement: # """ -# converts a SymPy object to a Mathics element. +# converts a SymPy object to a Mathics3 element. # """ # try: # return sympy_singleton_to_mathics[expr] diff --git a/mathics/core/element.py b/mathics/core/element.py index dff595127..2948374d9 100644 --- a/mathics/core/element.py +++ b/mathics/core/element.py @@ -63,13 +63,13 @@ class ElementsProperties: elements_fully_evaluated: bool = False # is_flat: True if none of the elements is an Expression - # Some Mathics functions allow flattening of elements. Therefore + # Some Mathics3 functions allow flattening of elements. Therefore # it can be useful to know if the elements are already flat is_flat: bool = False # is_ordered: True if all of the elements are ordered. Of course this is true, # if there are less than 2 elements. Ordered is an Attribute of a - # Mathics function. + # Mathics3 function. # # In rewrite_eval_apply() if a function is not marked as Ordered this attribute # has no effect which means it doesn't matter how it is set. So @@ -132,7 +132,7 @@ def do_apply_rules( def equal2(self, rhs: Any) -> Optional[bool]: """ - Mathics two-argument Equal (==) + Mathics3 two-argument Equal (==) returns True if self and rhs are identical. """ if self.sameQ(rhs): @@ -318,14 +318,14 @@ def is_inexact(self) -> bool: return self.get_precision() is not None def sameQ(self, rhs) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" return id(self) == id(rhs) def sequences(self): return None def user_hash(self, update) -> None: - # whereas __hash__ is for internal Mathics purposes like using Expressions as dictionary keys and fast + # whereas __hash__ is for internal Mathics3 purposes like using Expressions as dictionary keys and fast # comparison of elements, user_hash is called for Hash[]. user_hash should strive to give stable results # across versions, whereas __hash__ must not. user_hash should try to hash all the data available, whereas # __hash__ might only hash a sample of the data available. @@ -393,7 +393,7 @@ def rewrite_apply_eval_step( return self.evaluate(evaluation), False def sameQ(self, other) -> bool: - """Mathics SameQ + """Mathics3 SameQ Each class should decide what is right here. """ raise NotImplementedError diff --git a/mathics/core/evaluation.py b/mathics/core/evaluation.py index 1c10c61e0..06e0e3be3 100644 --- a/mathics/core/evaluation.py +++ b/mathics/core/evaluation.py @@ -641,7 +641,7 @@ def get_data(self): class Output(ABC): """ - Base class for Mathics output history. + Base class for Mathics3 output history. This needs to be subclassed. """ diff --git a/mathics/core/load_builtin.py b/mathics/core/load_builtin.py index 29479e09f..1cbb0f832 100644 --- a/mathics/core/load_builtin.py +++ b/mathics/core/load_builtin.py @@ -183,7 +183,7 @@ def get_submodule_names(obj) -> list: So in this example then, in the list the modules returned for Python module `mathics.builtin.colors` would be the `mathics.builtin.colors.named_colors` module which contains the - definition and docs for the "Named Colors" Mathics Builtin + definition and docs for the "Named Colors" Mathics3 Builtin Functions. """ modpkgs = [] @@ -223,7 +223,7 @@ def import_and_load_builtins(): # modules that contain Mathics3 Builtin class definitions. # The files_io module handles local file access, reading and writing.. - # In some sandboxed settings, such as running Mathics from as a remote + # In some sandboxed settings, such as running Mathics3 from as a remote # server, we disallow local file access. disable_file_module_names = set() if ENABLE_FILES_MODULE else {"files_io"} diff --git a/mathics/core/number.py b/mathics/core/number.py index 3db5d1cde..2c75c0193 100644 --- a/mathics/core/number.py +++ b/mathics/core/number.py @@ -125,7 +125,7 @@ def get_type(value) -> Optional[str]: def sameQ(v1, v2) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" return get_type(v1) == get_type(v2) and v1 == v2 diff --git a/mathics/core/parser/README.md b/mathics/core/parser/README.md index 343a75ecb..7bf707713 100644 --- a/mathics/core/parser/README.md +++ b/mathics/core/parser/README.md @@ -189,7 +189,7 @@ def p_Integral(self, token): ## Mathics3 implementation ### Precedence Climbing -All the Mathics operators are specified in `mathics/core/parser/operators.py`. The precedence climbing algorithm is implemented in +All the Mathics3 operators are specified in `mathics/core/parser/operators.py`. The precedence climbing algorithm is implemented in `mathics/core/parser/parser.py`. All the special cases are implemented as additional rules. #### P Rules diff --git a/mathics/core/pattern.py b/mathics/core/pattern.py index 3cd30bcd2..9d729e5f4 100644 --- a/mathics/core/pattern.py +++ b/mathics/core/pattern.py @@ -350,7 +350,7 @@ def sameQ(self, other: "BasePattern") -> bool: ... def sameQ(self, other: BaseElement) -> bool: ... def sameQ(self, other) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" if isinstance(other, BasePattern): return self.expr.sameQ(other.expr) return self.expr.sameQ(other) diff --git a/mathics/core/symbols.py b/mathics/core/symbols.py index afae3ace5..9ad8f2bbf 100644 --- a/mathics/core/symbols.py +++ b/mathics/core/symbols.py @@ -40,7 +40,7 @@ class NumericOperators: It adds or "mixes in" numeric functions for these objects like ``round_to_float()``. It also adds methods to the class to facilite building - ``Expression`` s in the Mathics Python code using Python syntax. + ``Expression`` s in the Mathics3 Python code using Python syntax. So for example, instead of writing in Python:: @@ -151,7 +151,7 @@ class Atom(BaseElement): In other words, they are the expression's elements (leaves of the expression) which we cannot dig down deeper structurally. - Of note is the fact that the Mathics ``Part[]`` function of an + Of note is the fact that the Mathics3 ``Part[]`` function of an Atom object does not exist. Atom is not a directly-mentioned WL entity, although conceptually @@ -183,7 +183,7 @@ def copy(self, reevaluate=False) -> "Atom": return result def equal2(self, rhs: Any) -> Optional[bool]: - """Mathics two-argument Equal (==) + """Mathics3 two-argument Equal (==) returns True if self and rhs are identical. """ if self.sameQ(rhs): @@ -348,7 +348,7 @@ class Symbol(Atom, NumericOperators, EvalMixin): # Dictionary of Symbols defined so far. # We use this for object uniqueness. # The key is the Symbol object's string name, and the - # diectionary's value is the Mathics object for the Symbol. + # diectionary's value is the Mathics3 object for the Symbol. _symbols: Dict[str, "Symbol"] = {} class_head_name = "System`Symbol" @@ -418,7 +418,7 @@ def do_copy(self) -> "Symbol": return Symbol(self.name) def equal2(self, rhs: Any) -> Optional[bool]: - """Mathics two-argument Equal (==)""" + """Mathics3 two-argument Equal (==)""" if self is rhs: return True @@ -588,7 +588,7 @@ def replace_vars(self, vars, options={}, in_scoping=True): return var def sameQ(self, rhs: Any) -> bool: - """Mathics SameQ""" + """Mathics3 SameQ""" return self is rhs @property @@ -643,7 +643,7 @@ def to_sympy(self, **kwargs): class SymbolConstant(Symbol): """ - A Symbol Constant is Symbol of the Mathics system whose value can't + A Symbol Constant is Symbol of the Mathics3 system whose value can't be changed and has a corresponding Python representation. Therefore, like an ``Integer`` constant such as ``Integer0``, we don't @@ -669,7 +669,7 @@ class SymbolConstant(Symbol): # Dictionary of SymbolConstants defined so far. # We use this for object uniqueness. # The key is the SymbolConstant's value, and the - # diectionary's value is the Mathics object representing that Python value. + # diectionary's value is the Mathics3 object representing that Python value. _symbol_constants: Dict[str, "SymbolConstant"] = {} # We use __new__ here to unsure that two Integer's that have the same value diff --git a/mathics/core/systemsymbols.py b/mathics/core/systemsymbols.py index 820019838..7cf667bf7 100644 --- a/mathics/core/systemsymbols.py +++ b/mathics/core/systemsymbols.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """ -Symbols for some (but not all) Mathics primitive names +Symbols for some (but not all) Mathics3 primitive names We put all of this in one place to make it easy to find most of them. diff --git a/mathics/core/util.py b/mathics/core/util.py index 2d87a8df4..75b839b25 100644 --- a/mathics/core/util.py +++ b/mathics/core/util.py @@ -123,7 +123,7 @@ def print_expression_tree( expr, indent="", marker=lambda expr: "", file=None, approximate=False ): """ - Print a Mathics Expression as an indented tree. + Print a Mathics3 Expression as an indented tree. Caller may supply a marker function that computes a marker to be displayed in the tree for the given node. The approximate flag causes numbers to be printed with fewer digits diff --git a/mathics/doc/__init__.py b/mathics/doc/__init__.py index 50ff02cfd..d50e2570e 100644 --- a/mathics/doc/__init__.py +++ b/mathics/doc/__init__.py @@ -14,7 +14,7 @@ The command-line utility ``docpipeline.py``, loads the data from Python modules and static files, accesses the functions here. -Mathics Django also uses this library for its HTML-based documentation. +Mathics3 Django also uses this library for its HTML-based documentation. The Mathics3 builtin function ``Information[]`` also uses to provide the information it reports. diff --git a/mathics/doc/doc_entries.py b/mathics/doc/doc_entries.py index 2cb345617..c9354f70c 100644 --- a/mathics/doc/doc_entries.py +++ b/mathics/doc/doc_entries.py @@ -569,7 +569,7 @@ class DocumentationEntry(BaseDocElement): Specialized classes like LaTeXDoc or and DjangoDoc provide methods for getting formatted output. For LaTeXDoc ``latex()`` is added while for DjangoDoc ``html()`` is added - Mathics core also uses this in getting usage strings (`??`). + Mathics3 core also uses this in getting usage strings (`??`). """ @@ -647,7 +647,7 @@ def set_parent_path(self, parent): # For backward compatibility, we need # to reduce this to three fields. # TODO: remove me and ensure that this - # works here and in Mathics Django + # works here and in Mathics3 Django if len(path) > 3: path = path[:2] + [path[-1]] test.key = tuple(path) + (test.index,) diff --git a/mathics/doc/documentation/1-Manual.mdoc b/mathics/doc/documentation/1-Manual.mdoc index 22107ae96..e077ff582 100644 --- a/mathics/doc/documentation/1-Manual.mdoc +++ b/mathics/doc/documentation/1-Manual.mdoc @@ -1310,7 +1310,7 @@ When you enter Mathics in the top after the Mathics logo and the word "Mathics" It looks like this: - + These save and load worksheets, share sessions, run a gallery of examples, go to the GitHub organization page, and provide information about the particular Mathics3 installation. @@ -1343,7 +1343,7 @@ Assuming you are running locally or on a host called 'localhost' using the defau Worksheets exist in the browser window only and are not stored on the server by default. To save all your queries and results, use the Save button, which is the middle graphic of the menu bar. It looks like this: - + Depending on browser, desktop, and OS settings, the "Ctrl+S" key combination may do the same thing. @@ -1351,7 +1351,7 @@ Depending on browser, desktop, and OS settings, the "Ctrl+S" key combination may Saved worksheets can be loaded or deleted using the File Open button, which is the left-most button in the menu bar. It looks like this: - + Depending on browser, desktop, and OS settings, the "Ctrl+O" key combination may do the same thing. @@ -1369,7 +1369,7 @@ It is also shown in the pop-up text that appears when Mathics3 is first run. -
    +
    When you use the Django-based Web interface of \Mathics3, a browser session is created. Cookies have to be enabled to allow this. Your session holds a key that is used to access your definitions that are stored in a database on the server. As long as you do not clear the cookies in your browser, your definitions will remain even when you close and re-open the browser. @@ -1383,7 +1383,7 @@ On the other hand, Definitions as described above do not, unless 'Quit[]' or 'Ex If you want a URL that records the input entered, the Generate Input Hash button does this. The button looks like this: - + For example, assuming you have a \Mathics3 server running at port 8000 on localhost, and you enter the URL http://localhost:8000/#cXVlcmllcz14, you should see a single line of input containing 'x' entered. diff --git a/mathics/doc/gather.py b/mathics/doc/gather.py index 58153d0e7..2cc77830b 100644 --- a/mathics/doc/gather.py +++ b/mathics/doc/gather.py @@ -294,7 +294,7 @@ def get_submodule_names(obj) -> list: So in this example then, in the list the modules returned for Python module `mathics.builtin.colors` would be the `mathics.builtin.colors.named_colors` module which contains the - definition and docs for the "Named Colors" Mathics Builtin + definition and docs for the "Named Colors" Mathics3 Builtin Functions. """ modpkgs = [] diff --git a/mathics/doc/images.sh b/mathics/doc/images.sh index 10a2d3706..08677a908 100755 --- a/mathics/doc/images.sh +++ b/mathics/doc/images.sh @@ -1,7 +1,7 @@ #!/bin/bash # The program create PDF images that can be embedded into the -# Mathics manual. In particular the Mathics heptatom logo and the -# Mathics logo with a shadow that extends a little bit down forward right. +# Mathics3 manual. In particular the Mathics3 heptatom logo and the +# Mathics3 logo with a shadow that extends a little bit down forward right. bs=${BASH_SOURCE[0]} diff --git a/mathics/doc/latex/README.rst b/mathics/doc/latex/README.rst index 4b9f7a83d..10d12a9a1 100644 --- a/mathics/doc/latex/README.rst +++ b/mathics/doc/latex/README.rst @@ -1,7 +1,7 @@ Overview -------- -Here we have document data and scripts for generating the Mathics Reference manual in PDF form. +Here we have document data and scripts for generating the Mathics3 Reference manual in PDF form. The document is a LaTeX file run through XeTeX with Asymptote graphics. @@ -10,7 +10,7 @@ process the graphics. Earlier version may have bugs in them which prevent some images from getting processed. Notable here are the "Filling" ande "Bottom" examples which need opacity to work on various kinds of plots. -inkscape is needed for the Mathics logos if you need to generate these from source. +inkscape is needed for the Mathics3 logos if you need to generate these from source. Workflow -------- diff --git a/mathics/doc/latex/mathics3.tex b/mathics/doc/latex/mathics3.tex index c69cc6543..caa7a3ffb 100644 --- a/mathics/doc/latex/mathics3.tex +++ b/mathics/doc/latex/mathics3.tex @@ -131,8 +131,10 @@ {ö}{{\"o}}1 {~}{{\textasciitilde}}1 {⧦}{{===}}1 + {⩵}{{==}}1 {}{{=>}}1 {⇒}{{$\Rightarrow$}}1 + {⇾}{{$\Rightarrow$}}1 {⊻}{{$\oplus$}}1 {…}{{...}}1 {∫}{{S}}1 @@ -350,6 +352,7 @@ \part*{Appendices} \item[mpmath] \hfill \mpmathVersion \item[NumpyPy] \hfill \NumPyVersion \item[SymPy] \hfill \SymPyVersion + \item[PIL] \hfill \PILVersion \item[Ghostscript] \hfill \GhostscriptVersion \item[lxml] \hfill \lxml \item[matplotlib] \hfill \matplotlib diff --git a/mathics/doc/latex/sed-hack.sh b/mathics/doc/latex/sed-hack.sh index 06723a9fb..d234b1d37 100755 --- a/mathics/doc/latex/sed-hack.sh +++ b/mathics/doc/latex/sed-hack.sh @@ -16,3 +16,7 @@ fi # Greek Symbols sed -i -e 's/Φ/$\\\\Phi$/g' documentation.tex sed -i -e s/μ/$\\\\mu$/g documentation.tex +sed -i -e s/reference-of-built-in-symbols/r/g documentation.tex +sed -i -e s/integer-and-number-theoretical-functions/int-fns/g documentation.tex +sed -i -e s/mathematical-constants/math-consts/g documentation.tex +sed -i -e "s:'[\$]Path':\$Path:g" documentation.tex diff --git a/mathics/doc/latex_doc.py b/mathics/doc/latex_doc.py index 3608a9088..fee1f7314 100644 --- a/mathics/doc/latex_doc.py +++ b/mathics/doc/latex_doc.py @@ -94,7 +94,7 @@ def to_latex(elem, **kwargs) -> str: def escape_latex_code(text) -> str: - """Escape verbatim Mathics input""" + """Escape verbatim Mathics3 input""" text = escape_latex_output(text) escape_char = get_latex_escape_char(text) @@ -363,7 +363,7 @@ def repl_subsection(match): def escape_latex_output(text) -> str: - """Escape Mathics output""" + """Escape Mathics3 output""" text = replace_all( text, @@ -608,7 +608,7 @@ class LaTeXDocumentationEntry(DocumentationEntry): """A class to hold our custom XML-like format. The `latex()` method can turn this into LaTeX. - Mathics core also uses this in getting usage strings (`??`). + Mathics3 core also uses this in getting usage strings (`??`). """ items: Sequence["LaTeXDocumentationEntry"] @@ -857,9 +857,10 @@ def latex(self, doc_data: dict, quiet=False) -> str: sections = "\n\n".join(section.latex(doc_data) for section in self.subsections) slug = f"{self.chapter.part.slug}/{self.chapter.slug}/{self.slug}" + label_string = r"\label{%s}" % latex_label_safe(slug) section_string = ( - "\n\n\\section{%s}{%s}\n" % (title, index) - + "\n\\label{%s}" % latex_label_safe(slug) + (("\n\n\\section{%s" % title) + label_string + "}%") + + ("\n%s\n" % index) + "\n\\sectionstart\n\n" + f"{content}" # + ("\\addcontentsline{toc}{section}{%s}" % title) @@ -1001,9 +1002,12 @@ def latex(self, doc_data: dict, quiet=False, chapters=None) -> str: slug = f"{self.chapter.part.slug}/{self.chapter.slug}/{self.section.slug}/{self.slug}" + label_string = r"\label{%s}" % latex_label_safe(slug) section_string = ( - "\n\n\\subsection{%(title)s}%(index)s\n" - + "\n\\label{%s}" % latex_label_safe(slug) + "\n\n\\subsection{%(title)s" + + label_string + + "}%" + + "\n%(index)s\n" + "\n\\subsectionstart\n\n%(content)s" # "\\addcontentsline{toc}{subsection}{%(title)s}" "%(sections)s" diff --git a/mathics/doc/structure.py b/mathics/doc/structure.py index 2dea91ad7..d34b09783 100644 --- a/mathics/doc/structure.py +++ b/mathics/doc/structure.py @@ -2,7 +2,7 @@ """ Structural elements of Mathics3 Documentation -This module contains the classes representing the Mathics documentation structure, +This module contains the classes representing the Mathics3 documentation structure, and extended regular expressions used to parse it. """ @@ -682,7 +682,7 @@ def parent(self, value): class MathicsMainDocumentation(Documentation): """MathicsMainDocumentation specializes ``Documentation`` by providing the attributes - and methods needed to generate the documentation from the Mathics library. + and methods needed to generate the documentation from the Mathics3 library. The parts of the documentation are loaded from the Markdown files contained in the path specified by ``self.doc_dir``. Files with names starting in numbers @@ -714,7 +714,7 @@ class MathicsMainDocumentation(Documentation): """ def __init__(self): - super().__init__(title="Mathics Main Documentation", doc_dir=settings.DOC_DIR) + super().__init__(title="Mathics3 Main Documentation", doc_dir=settings.DOC_DIR) self.doctest_latex_pcl_path = settings.DOCTEST_LATEX_DATA_PCL self.pymathics_doc_loaded = False self.doc_data_file = settings.get_doctest_latex_data_path( diff --git a/mathics/docpipeline.py b/mathics/docpipeline.py index 2728398e0..7c2389371 100644 --- a/mathics/docpipeline.py +++ b/mathics/docpipeline.py @@ -786,7 +786,7 @@ def write_doctest_data(doctest_pipeline: DocTestPipeline): def build_arg_parser(): """Build the argument parser""" - parser = ArgumentParser(description="Mathics test suite.", add_help=False) + parser = ArgumentParser(description="Mathics3 test suite.", add_help=False) parser.add_argument( "--help", "-h", help="show this help message and exit", action="help" ) diff --git a/mathics/eval/__init__.py b/mathics/eval/__init__.py index a883eda56..33141eba4 100644 --- a/mathics/eval/__init__.py +++ b/mathics/eval/__init__.py @@ -1,5 +1,5 @@ """ -Mathics Evaluation Functions +Mathics3 Evaluation Functions Routines here are core operations or functions that implement evaluation. If there were an instruction interpreter, these functions diff --git a/mathics/eval/drawing/charts.py b/mathics/eval/drawing/charts.py index 28ddc9e64..301329d2a 100644 --- a/mathics/eval/drawing/charts.py +++ b/mathics/eval/drawing/charts.py @@ -1,7 +1,7 @@ """ Evaluation routines for 2D plotting. -These routines build Mathics M-Expressions that describe plots. +These routines build Mathics3 M-Expressions that describe plots. Note that this is distinct from boxing, formatting and rendering e.g. to SVG. That is done as another pass after M-expression evaluation finishes. """ diff --git a/mathics/eval/drawing/plot.py b/mathics/eval/drawing/plot.py index fb5a7af95..6e461f568 100644 --- a/mathics/eval/drawing/plot.py +++ b/mathics/eval/drawing/plot.py @@ -1,7 +1,7 @@ """ Evaluation routines for 2D plotting. -These routines build Mathics M-Expressions that describe plots. +These routines build Mathics3 M-Expressions that describe plots. Note that this is distinct from boxing, formatting and rendering e.g. to SVG. That is done as another pass after M-expression evaluation finishes. """ @@ -476,7 +476,7 @@ def eval_Plot(plot_options, options: dict, evaluation: Evaluation) -> Expression Note: (?) indicates somewhat vague guesses. - functions: is a list of Mathics M-Expressions to be evaluated + functions: is a list of Mathics3 M-Expressions to be evaluated start: minimum x-axis value stop: maximum t x-axis value x_name; the name of the function parameter name used by ``functions`` diff --git a/mathics/eval/files_io/read.py b/mathics/eval/files_io/read.py index 641a2de21..2a04e0b04 100644 --- a/mathics/eval/files_io/read.py +++ b/mathics/eval/files_io/read.py @@ -253,7 +253,7 @@ def read_name_and_stream(stream_designator, evaluation: Evaluation) -> tuple: def read_list_from_types(read_types): - """Return a Mathics List from a list of read_type names or a single read_type""" + """Return a Mathics3 List from a list of read_type names or a single read_type""" # Trun read_types into a list if it isn't already one. if read_types.has_form("List", None): diff --git a/mathics/eval/numeric.py b/mathics/eval/numeric.py index 0e06a779d..f949dd065 100644 --- a/mathics/eval/numeric.py +++ b/mathics/eval/numeric.py @@ -356,7 +356,7 @@ def eval_mpmath_function( working with precision `prec`. If `prec` is `None`, work with machine precision. - Return a Mathics Number or None if the evaluation failed. + Return a Mathics3 Number or None if the evaluation failed. """ if prec is None: # if any argument has machine precision then the entire calculation diff --git a/mathics/eval/pymathics.py b/mathics/eval/pymathics.py index 5cc6764a0..c0ba2642a 100644 --- a/mathics/eval/pymathics.py +++ b/mathics/eval/pymathics.py @@ -46,7 +46,7 @@ def eval_LoadModule(module_name: str, definitions: Definitions) -> str: def load_pymathics_module(definitions: Definitions, module_name: str): """ - Loads Mathics builtin objects and their definitions + Loads Mathics3 builtin objects and their definitions from an external Python module in the pymathics module namespace. """ diff --git a/mathics/eval/quantities.py b/mathics/eval/quantities.py index 58c037c2b..53c1b73d8 100644 --- a/mathics/eval/quantities.py +++ b/mathics/eval/quantities.py @@ -89,7 +89,7 @@ def convert_units( The Python "pint" library mixes in a Python numeric value as a multiplier inside a Mathics Expression. Here we pick out that multiplier and - convert it from a Python numeric to a Mathics numeric. + convert it from a Python numeric to a Mathics3 numeric. """ assert isinstance(magnitude, Number) assert isinstance(src, BaseElement) @@ -222,7 +222,7 @@ def normalize_unit_name_with_magnitude(unit: str, magnitude) -> str: def pint_str_to_expression(unit: str) -> BaseElement: """ - Produce a Mathics Expression from a pint unit expression + Produce a Mathics3 Expression from a pint unit expression """ assert isinstance(unit, str) unit = normalize_unit_name(unit) @@ -252,7 +252,7 @@ def process_factor(factor): def round_if_possible(x_float: float) -> Number: """ - Produce an exact Mathics number from x + Produce an exact Mathics3 number from x when it is possible. If x is integer, return Integer(x) If 1/x is integer, return Rational(1,1/x) diff --git a/mathics/format/form/inputform.py b/mathics/format/form/inputform.py index 5fd1b2564..774ab5984 100644 --- a/mathics/format/form/inputform.py +++ b/mathics/format/form/inputform.py @@ -2,7 +2,7 @@ InputForm-formatted strings. `InputForm` produces textual output suitable for being parsed and -evaluated in Mathics CLI. +evaluated in Mathics3 CLI. `InputForm` is not affected by MakeBox assignment. diff --git a/mathics/format/render/latex.py b/mathics/format/render/latex.py index 974d76449..148584031 100644 --- a/mathics/format/render/latex.py +++ b/mathics/format/render/latex.py @@ -2,7 +2,7 @@ """ Mathics3 box rendering to (AMS)LaTeX strings. -Formatting is usually initiated in Mathics via TeXForm[]. +Formatting is usually initiated in Mathics3 via TeXForm[]. AMS LaTeX is LaTeX with addition mathematical symbols, which we may make use of via the mathics-scanner tables. @@ -421,7 +421,7 @@ def graphics3dbox(box: Graphics3DBox, elements=None, **options) -> str: def graphicsbox(box: GraphicsBox, elements=None, **options) -> str: - """This is the top-level function that converts a Mathics Expression + """This is the top-level function that converts a Mathics3 Expression in to something suitable for AMSLaTeX. However right now the only LaTeX support for graphics is via Asymptote and diff --git a/mathics/format/render/mathml.py b/mathics/format/render/mathml.py index 08ef95b45..5db2f3fed 100644 --- a/mathics/format/render/mathml.py +++ b/mathics/format/render/mathml.py @@ -2,7 +2,7 @@ """ Mathics3 Box rendering to MathML strings. -MathML formatting is usually initiated in Mathics via MathMLForm[]. +MathML formatting is usually initiated in Mathics3 via MathMLForm[]. For readability, and following WMA MathML generated code, tags \ containing sub-tags are split on several lines, one by diff --git a/mathics/session.py b/mathics/session.py index ad9acd628..1dfe23a98 100644 --- a/mathics/session.py +++ b/mathics/session.py @@ -95,7 +95,7 @@ def get_settings_value(definitions: Definitions, setting_name: str): def set_settings_value(definitions: Definitions, setting_name: str, value): - """Set a Mathics Settings` with name "setting_name" from definitions to value + """Set a Mathics3 Settings` with name "setting_name" from definitions to value "value". """ return definitions.set_ownvalue(setting_name, value) diff --git a/mathics/timing.py b/mathics/timing.py index a376f5c45..9fad95014 100644 --- a/mathics/timing.py +++ b/mathics/timing.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """ -Mathics timing method(s) and timing context manager. +Mathics3 timing method(s) and timing context manager. """ import os diff --git a/setup.py b/setup.py index 3740422ab..61396c9cc 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -"""Python Setuptools for Mathics core +"""Python Setuptools for Mathics3 core For the easiest installation: @@ -125,6 +125,6 @@ def run(self): cmdclass=CMDCLASS, ext_modules=EXTENSIONS, dependency_links=DEPENDENCY_LINKS, - # don't pack Mathics in egg because of media files, etc. + # don't pack Mathics3 in egg because of media files, etc. zip_safe=False, ) diff --git a/test/builtin/arithfns/test_basic.py b/test/builtin/arithfns/test_basic.py index 772a2e419..7c3de6c41 100644 --- a/test/builtin/arithfns/test_basic.py +++ b/test/builtin/arithfns/test_basic.py @@ -302,7 +302,7 @@ def test_power(str_expr, str_expected, expected_message, fail_msg): ("Complex[10, 0.]", "10. + 0. I", "build complex"), ("Complex[10, 0]", "10", "build complex"), ("1 + 0. I", "1. + 0. I", None), - # Mathics produces "0." + # Mathics3 produces "0." # For some weird reason, the following tests # pass if we run this unit test alone, but not # if we run it together all the tests diff --git a/test/builtin/assignments/test_assignment.py b/test/builtin/assignments/test_assignment.py index 3eb2b5449..5f7f711eb 100644 --- a/test/builtin/assignments/test_assignment.py +++ b/test/builtin/assignments/test_assignment.py @@ -98,7 +98,7 @@ def test_setdelayed_oneidentity(): ( "Clear[Expand];Options[Expand]=Join[Options[Expand], {MyOption:>Automatic}]; Options[Expand]", "{MyOption ⧴ Automatic, Modulus ⧴ 0, Trig ⧴ False}", - "Mathics stores options in a dictionary. This is why ``MyOption`` appears first.", + "Mathics3 stores options in a dictionary. This is why ``MyOption`` appears first.", ), # ( # "ClearAll[Expand]; Options[Expand]", diff --git a/test/builtin/files_io/test_files.py b/test/builtin/files_io/test_files.py index 7cf17f603..deb73a885 100644 --- a/test/builtin/files_io/test_files.py +++ b/test/builtin/files_io/test_files.py @@ -307,7 +307,7 @@ def test_close(): "{Hold[1 + 2]}", "", ), - ('stream = StringToStream["Mathics is cool!"];', None, "Null", ""), + ('stream = StringToStream["Mathics3 is cool!"];', None, "Null", ""), ("SetStreamPosition[stream, -5]", ("Invalid I/O Seek.",), "0", ""), ( '(strm = StringToStream["abc 123"])//{#1[[0]],#1[[1]]}&', diff --git a/test/builtin/numbers/test_hyperbolic.py b/test/builtin/numbers/test_hyperbolic.py index beae9d0ba..254f5a7ad 100644 --- a/test/builtin/numbers/test_hyperbolic.py +++ b/test/builtin/numbers/test_hyperbolic.py @@ -16,7 +16,7 @@ def test_gudermannian(): ("Gudermannian[Undefined]", "Undefined"), ("Gudermannian[0]", "0"), ("Gudermannian[2 Pi I]", "0"), - # FIXME: Mathics can't handle Rule substitution + # FIXME: Mathics3 can't handle Rule substitution ("Gudermannian[6/4 Pi I]", "DirectedInfinity[-I]"), ("Gudermannian[Infinity]", "Pi/2"), # FIXME: rule does not work diff --git a/test/builtin/string/test_characters.py b/test/builtin/string/test_characters.py index 28e9b276e..875e07a50 100644 --- a/test/builtin/string/test_characters.py +++ b/test/builtin/string/test_characters.py @@ -12,7 +12,7 @@ from mathics.core.list import ListExpression from mathics.session import MathicsSession -# Set up a Mathics session with definitions. +# Set up a Mathics3 session with definitions. # For consistency set the character encoding ASCII which is # the lowest common denominator available on all systems. session = MathicsSession(character_encoding="ASCII") @@ -24,7 +24,7 @@ def check_characters_evaluation( failure_message: Optional[str] = "", ): """ - Helper function to test Mathics expression against + Helper function to test Mathics3 expression against its results. Compares the expressions represented by ``str_expr`` and ``str_expected`` by diff --git a/test/builtin/test_datentime.py b/test/builtin/test_datentime.py index e4236000c..6ba063e70 100644 --- a/test/builtin/test_datentime.py +++ b/test/builtin/test_datentime.py @@ -111,7 +111,12 @@ def test_datestring(): @pytest.mark.parametrize( ("str_expr", "msgs", "str_expected", "fail_msg"), [ - ("AbsoluteTime[1000]", None, "1000", "Mathematica Bug - Mathics gets it right"), + ( + "AbsoluteTime[1000]", + None, + "1000", + "Mathematica Bug - Mathics3 gets it right", + ), ( 'DateList["7/8/9"]', ("The interpretation of 7/8/9 is ambiguous.",), diff --git a/test/builtin/test_rules.py b/test/builtin/test_rules.py index 92932395c..2d5d50bf8 100644 --- a/test/builtin/test_rules.py +++ b/test/builtin/test_rules.py @@ -34,7 +34,7 @@ This set of tests are proposed to drive the behaviour of Rules in -Mathics closer to the one in WMA. In particular, the way in which +Mathics3 closer to the one in WMA. In particular, the way in which `Orderless` and `Flat` attributes affects evaluation are currently tested. diff --git a/test/core/convert/test_sympy.py b/test/core/convert/test_sympy.py index 29ab07b95..0a7341150 100644 --- a/test/core/convert/test_sympy.py +++ b/test/core/convert/test_sympy.py @@ -111,7 +111,7 @@ def test_from_to_sympy_change(expr, result, msg): def test_convert_sympy_singletons(): """ Check conversions between singleton symbols in - SymPy and Mathics Symbols. + SymPy and Mathics3 Symbols. """ for key, val in sympy_singleton_to_mathics.items(): print("equivalence", key, "<->", val) diff --git a/test/core/parser/test_parser.py b/test/core/parser/test_parser.py index c81b16c1a..91f681c5f 100644 --- a/test/core/parser/test_parser.py +++ b/test/core/parser/test_parser.py @@ -90,7 +90,7 @@ def test_Function(self): class AtomTests(ParserTests): def has_unicode_setup_in_scanner(self) -> bool: - """Return True if the Mathics scanner is set up to + """Return True if the Mathics3 scanner is set up to return standard Unicode symbols for various custom WL characters""" return repr(self.parse("\\[ExponentialE]")) != "E" diff --git a/test/core/test_sympy_python_convert.py b/test/core/test_sympy_python_convert.py index 48a586e69..9ac68c3b9 100644 --- a/test/core/test_sympy_python_convert.py +++ b/test/core/test_sympy_python_convert.py @@ -59,7 +59,7 @@ def testSymbol(self): # System` context: self.compare_to_mathics(Symbol("x"), sympy.Symbol("x")) # Notice that a sympy Symbol named "x" is converted - # to the Mathics symbol "System`x", and then, when converted + # to the Mathics3 symbol "System`x", and then, when converted # back to sympy, goes to sympy.Symbol("_uSystem_x"). def testReal(self): diff --git a/test/eval/test_patterns.py b/test/eval/test_patterns.py index 1bb1e2bd4..a3cab4a24 100644 --- a/test/eval/test_patterns.py +++ b/test/eval/test_patterns.py @@ -13,7 +13,7 @@ from mathics.core.pattern import ExpressionPattern from mathics.eval.patterns import Matcher -# Preload the Mathics definitions +# Preload the Mathics3 definitions defintions = Definitions(True) diff --git a/test/format/format_tests-WMA.yaml b/test/format/format_tests-WMA.yaml index 975084146..5e2032eaf 100644 --- a/test/format/format_tests-WMA.yaml +++ b/test/format/format_tests-WMA.yaml @@ -19,7 +19,7 @@ # # Regarding tests for `MathMLForm` and `TeXForm`, WMA does not do it # really well in its conversions, and in several cases just returns an -# error message. On the other hand, in Mathics we want to test them, +# error message. On the other hand, in Mathics3 we want to test them, # because we use both in documentation and in the web interface. # @@ -267,7 +267,7 @@ mathml: InputForm: '(1 + (1 + a^(-1))^(-1))^(-1)' StandardForm: "\n 1\n \n 1\n +\n \n 1\n \n 1\n +\n \n 1\n a\n \n \n \n \n " - TraditionalForm: "\n 1\n \n \n 1\n \n \n 1\n a\n \n +\n 1\n \n \n +\n 1\n \n " + TraditionalForm: "\n 1\n \n \n 1\n \n \n 1\n a\n \n +\n 1\n \n \n +\n 1\n \n " text: InputForm: "(1 + (1 + a^(-1))^(-1))^(-1)" OutputForm: " 1\n---------\n 1\n1 + -----\n 1\n 1 + -\n a" diff --git a/test/format/format_tests.m b/test/format/format_tests.m index 1b20c5416..ac961f5a1 100755 --- a/test/format/format_tests.m +++ b/test/format/format_tests.m @@ -10,7 +10,7 @@ ISMATHICSINTERPRETER=(StringTake[$Version, 8]==="Mathics3"); If[ISMATHICSINTERPRETER, - (*Mathics Interpreter*) + (*Mathics3 Interpreter*) STRIPMATHML[strg_]:= Module[ {start=(StringPosition[strg,""][[1]][[2]]+1), end=(StringPosition[strg,""][[1]][[1]]-1) diff --git a/test/format/test_makeboxes.py b/test/format/test_makeboxes.py index 2d12e2bc3..1da2b8edd 100644 --- a/test/format/test_makeboxes.py +++ b/test/format/test_makeboxes.py @@ -198,7 +198,7 @@ def test_makeboxes_others_fail(str_expr, str_expected, msg): r'RowBox[{"G","[",RowBox[{"{",RowBox[{"\"Formatted f\"",",", RowBox[{"{","3.002","}"}],"," ,"\"Standard\""}],"}"}],"]"}]', "Checking again, with the defined StandardForm format", ), - # InterpretationBox is not used in Mathics = InterpretationBox[PaneBox["\"G[{Formatted f, {3.002}, Standard}]\""], OutputForm[G[F[3.002`]]], Rule[Editable, False]] + # InterpretationBox is not used in Mathics3 = InterpretationBox[PaneBox["\"G[{Formatted f, {3.002}, Standard}]\""], OutputForm[G[F[3.002`]]], Rule[Editable, False]] ( r"MakeBoxes[OutputForm[G[F[3.002]]], StandardForm]", r'RowBox[{"G","[",RowBox[{"{",RowBox[{"\"Formatted f\"",", ", RowBox[{"{","3.002","}"}],", ","\"Standard\""}],"}"}],"]"}]', diff --git a/test/helper.py b/test/helper.py index e80315ace..adf1fc528 100644 --- a/test/helper.py +++ b/test/helper.py @@ -63,7 +63,7 @@ def check_evaluation( encoding: str = SYSTEM_CHARACTER_ENCODING, ): """ - Helper function to test Mathics expression against + Helper function to test Mathics3 expression against its results. Compares the expressions represented by ``str_expr`` and ``str_expected`` by