Too late for Valentines Day
A fair bit of code refactoring has gone on so that we might be able to scale the code, get it to be more performant, and more in line with other interpreters. There is greater use of Symbols as opposed to strings.
The builtin Functions have been organized into grouping akin to what is found in WMA. This is not just for documentation purposes, but it better modularizes the code and keep the modules smaller while suggesting where functions below as we scale.
Image Routines have been gone over and fixed. Basically we use Pillow imaging routines and as opposed to home-grown image code.
A number of Built-in functions that were implemented were not accessible for various reasons.
Mathics3 Modules are better integrated into the documentation. Existing Mathics3 modules pymathics.graph
and pymathics.natlang
have had a major overhaul, although more is needed. And will continue after the 6.0.0 release
We have gradually been rolling in more Python type annotations and current Python practices such as using isort
, black
and flake8
.
Evaluation methods of built-in functions start eval_
not apply_
.
API
- New function
mathics.system_info.python_implementation()
shows the Python Implementation, e.g. CPython, PyPy, Pyston that is running Python. This is included in the informationmathics.system_info.mathics_system__system_info()
returns and is used in$PythonImplementation
- A list of optional software can be found in
mathics.optional_software
. Versions of that software are included inmathics.version_info
.
Package update
- SymPy 1.11.1 accepted
- Numpy 1.24.0 accepted
New Builtins
$BoxForms
$OutputForms
$PrintForms
$PythonImplementation
Accuracy
ClebschGordan
Curl
(2-D and 3-D vector forms only)DiscretePlot
Kurtosis
ListLogPlot
LogPlot
$MaxMachineNumber
$MinMachineNumber
NumberLinePlot
PauliMatrix
Remove
SetOptions
SixJSymbol
Skewness
ThreeJSymbol
Documentation
- All Builtins have links to WMA pages.
- "Accuracy and Precision" section added to the Tutorial portion.
- "Attribute Definitions" section reinstated.
- "Expression Structure" split out as a guide section (was "Structure of Expressions").
- "Exponential Functional" split out from "Trigonometry Functions"
- "Functional Programming" section split out.
- "Image Manipulation" has been split off from Graphics and Drawingand turned into a guide section.
- Image examples now appear in the LaTeX and therfore the PDF doc
- "Logic and Boolean Algebra" section reinstated.
- "Forms of Input and Output" is its own guide section.
- More URL links to Wiki pages added; more internal cross links added.
- "Units and Quantities" section reinstated.
- The Mathics3 Modules are now included in LaTeX and therefore the PDF doc.
Internals
boxes_to_
methods are now optional forBoxElement
subclasses. Most of the code is now moved to themathics.format
submodule, and implemented in a more scalable way.from_mpmath
conversion supports a new parameteracc
to set the accuracy of the number.mathics.builtin.inout
was split in several modules (inout
,messages
,layout
,makeboxes
) in order to improve the documentation.mathics.eval
was create to have code that might be put in an instruction interpreter. The opcodes-like functions starteval_
, other functions are helper functions for those.- Operator name to Unicode or ASCII comes from Mathics scanner character tables.
- Builtin instance methods that start
eval
are considered rule matching and function application; the use of the nameapply
is deprecated, wheneval
is intended. - Modularize and improve the way in which
Builtin
classes are selected to have an associatedDefinition
. _SetOperator.assign_elementary
was renamed_SetOperator.assign
. All the special cases are not handled by the_SetOperator.special_cases
dict.isort
run over all Python files. More type annotations and docstrings on functions added.- caching on immutable atoms like,
String
,Integer
,Real
, etc. was improved; the__hash__()
function was sped up. There is asmall speedup overall from this at the expense of increased memory. - more type annotations added to functions, especially builtin functions
- Numerical constants used along the code was renamed using caps, according to the Python's convention.
Bugs
0
with a given precision (like in0`3
) is now parsed as0
, an integer number.- Reading certain GIFs now work again
Random[]
works now.RandomSample
with one list argument now returns a random ordering of the list items. Previously it would return just one item.- Origin placement corrected on
ListPlot
andLinePlot
. - Fix long-standing bugs in Image handling
- Some scikit image routines line
EdgeDetect
were getting omitted due to overly stringent PyPI requirements - Units and Quantities were sometimes failing. Also they were omitted from documentation.
- Better handling of
Infinite
quantities. - Improved
Precision
andAccuracy
compatibility with WMA. In particular,Precision[0.]
andAccuracy[0.]
- Accuracy in numbers using the notation
n.nnn``acc
now is properly handled. - numeric precision in mpmath was not reset after operations that changed these. This cause huges slowdowns after an operation that set the mpmath precison high. This was the source of several-minute slowdowns in testing.
- GIF87a (```MadTeaParty.gif`` or ExampleData) image loading fixed
- Replace non-free Leena image with a a freely distributable image. Issue #728
PyPI Package requirements
Mathics3 aims at a more richer set of functionality.
Therefore NumPy and Pillow (9.10 or later) are required Python packages where they had been optional before. In truth, probably running Mathics without one or both probably did not work well if it worked at all; we had not been testing setups that did not have NumPy.
Enhancements
- Vector restriction on
Norm[]
removed. "Frobinius" p-form allowed. - Better handling of comparisons with finite precision numbers.
- Improved implementation for
Precision
. - Infix operators, like
->
render with their Unicode symbol when$CharacterEncoding
is not "ASCII".
*Grid
compatibility with WMA was improved. Now it supports non-uniform list of lists and lists with general elements. - Support for BigEndian Big TIFF