Skip to content

Too late for Valentines Day

Compare
Choose a tag to compare
@rocky rocky released this 25 Feb 19:04
· 797 commits to master since this release

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

  1. 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 information mathics.system_info.mathics_system__system_info() returns and is used in $PythonImplementation
  2. A list of optional software can be found in mathics.optional_software. Versions of that software are included in mathics.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

  1. All Builtins have links to WMA pages.
  2. "Accuracy and Precision" section added to the Tutorial portion.
  3. "Attribute Definitions" section reinstated.
  4. "Expression Structure" split out as a guide section (was "Structure of Expressions").
  5. "Exponential Functional" split out from "Trigonometry Functions"
  6. "Functional Programming" section split out.
  7. "Image Manipulation" has been split off from Graphics and Drawingand turned into a guide section.
  8. Image examples now appear in the LaTeX and therfore the PDF doc
  9. "Logic and Boolean Algebra" section reinstated.
  10. "Forms of Input and Output" is its own guide section.
  11. More URL links to Wiki pages added; more internal cross links added.
  12. "Units and Quantities" section reinstated.
  13. The Mathics3 Modules are now included in LaTeX and therefore the PDF doc.

Internals

  • boxes_to_ methods are now optional for BoxElement subclasses. Most of the code is now moved to the mathics.format submodule, and implemented in a more scalable way.
  • from_mpmath conversion supports a new parameter acc 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 start eval_, 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 name applyis deprecated, when eval is intended.
  • Modularize and improve the way in which Builtin classes are selected to have an associated Definition.
  • _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 in 0`3) is now parsed as 0, 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 and LinePlot.
  • 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 and Accuracycompatibility with WMA. In particular, Precision[0.] and Accuracy[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