Releases: Mathics3/mathics-core
Get ready for release 5.0.1
Overview
Mostly a release to fix a Python packaging problem.
formatanddo_formatmethods were removed from the interface of
BaseElement, becoming non-member functions.- The class
BoxElementwas introduced as a base for boxing elements.
New Builtin
- 'Inverse Gudermannian'.
Documentation
Hyperbolic functions were split off form trigonometry and exponential functions. More url links were added.
Bugs
*r Creating a complex number from Infinity no longer crashes and returns 'I * Infinity'
Just when you though you had forgotten Mathics3
Table of Contents
This release starts to address some of the performance problems and
terminology confusion that goes back to the very beginning. As a result,
this release is not API compatible with prior releases.
In conjunction with the performance improvement in this release, we
start refactoring some of the core classes and modules to start to get
this to look and act more like other interpreters, and to follow more
current Python practice.
More work will continue in subsequent releases.
New Builtins
- Euler's
Betafunction. Bernoulli.CatalanNumber(Integer arguments only).CompositeQ.Diagonal. Issue #115.Divisible.EllipticEEllipticFEllipticKEllipticPiEulerPhi$Echo. Issue #42.FindRootwas improved for supporting numerical derivatives Issue
#67, as well as the use of scipy libraries when are available.FindRoot(for thenewtonmethod) partially supports
EvaluationMonitorandStepMonitoroptions.FindMinimumandFindMaximumnow have a minimal implementation
for 1D problems and the use of scipy libraries when are available.LogGamma.ModularInverse.NumericFunction.Projection.- Partial support for Graphics option
Opacity. SeriesDataoperations was improved.TraceEvaluation[]shows expression name calls and return values of
it argument.- Pass option
ShowTimeBySteps, to show accumulated time before
each step - The variable
$TraceEvalutionwhen set True will show all
expression evaluations.
- Pass option
TraditionalForm
Enhancements
Dacts overIntegrateandNIntegrate. Issue #130.SameQ(===) handles chaining, e.g.a == b == cor
SameQ[a, b, c].Simplifyhandles expressions of the formSimplify[0^a]Issue
#167.SimplifyandFullSimplifysupport optional parameters
AssumptionsandComplexityFunction.UnsameQ(=!=) handles chaining, e.g.a =!= b =!= cor
UnsameQ[a, b, c].- Assignments to usage messages associated with
Symbolsis allowed
as it is in WMA. With this and other changes, Combinatorica 2.0
works as written. Share[]performs an explicit call to the Python garbage collection
and returns the amount of memory free.- Improve the compatibility of
TeXFormandMathMLFormoutputs with
WMA. MathML tags around numbers appear as "<mn>" tags instead of
"<mtext>", except in the case ofInputFormexpressions. In
TeXForm some quotes around strings have been removed to conform to
WMA. It is not clear whether this is the correct behavior. - Allow
scipyandskimageto be optional. In particular: revise
Nintegrate[]to useMethod="Internal"when scipy isn't
available. - Pyston up to versions from 2.2 to 2.3.4 are supported as are PyPy
versions from 3.7-7.3.9.0 up 3.9-7.3.9. However those Python
interpreters may have limitations and limitations on packages that
they support. - Improved support for
SeriesIssue #46. Cylinderrendering is implemented in Asymptote.
Documentation
- "Testing Expressions" section added.
- "Representation of Numbers" section added.
- "Descriptive Statistics" section added and "Moments" folded into
that. - Many More URL references.
<url>now supports link text. - Referecne Chapter and Sections are now in alphabetical order
- Two-column mode was removed in most sections so the printed PDF
looks nicer. - Printed Error message output in test examples is in typewriter font
and doesn't drop inter-word spaces.
Internals
- Inexplicably, what the rest of the world calls a "nodes" in a tree
or or in WMA "elements" in a tree had been called a "leaves". We
now use the proper term "element". - Lots of predefined
Symbols have been added. Many appear in the
modulemathics.core.systemsymbols. - Attributes are now stored in a bitset instead of a tuple of string.
This speeds up attributes read, and RAM usage, . Symbol.is_numericandExpression.is_numericnow uses the
attributeDefinition.is_numericto determine the returned value.NIntegrateinternal algorithms and interfaces toscipywere
moved tomathics.algorithm.integratorsand
mathics.builtin.scipy_utils.integratorsrespectively.N[Integrate[...]]now is evaluated asNIntegrate[...]- Definitions for symbols
CurrentContextandContextPath[]are
mirrored in themathics.core.definitions.Definitionsobject for
faster access. FullForm[List[...]]is shown as{...}according to the WL
standard.Expression.is_numeric()accepts anEvaluationobject as a
parameter; the definitions attribute of that is used.SameQfirst checks the type, then theid, and then names in
symbols.- In
mathics.builtin.patterns.PatternTest, if the condition is one
of the most used tests (NumberQ,NumericQ,StringQ, etc) the
matchmethod is overwritten to specialized versions that avoid
function calls. mathics.core.patterns.AtomPatternspecializes the comparison
depending of theAtomtype.- To speed up development, you can set
NO_CYTHONto skip Cythonizing
Python modules. If you are using Pyston or PyPy, Cythonization slows
things down. anyandallcalls were unrolled as loops in Cythonized modules:
this avoids the overhead of a function call replacing it by a (C)
for loop, which is faster.- A bug was fixed relating to the order in which
mathics.core.definitionsstores the rules InstanceableBuiltin->BuiltinElementBoxConstruction->BoxExpression- the method
Element.is_true()was removed in favor of
is SymbolTrue N[_,_,Method->method]was reworked. Issue #137.- The methods
boxes_to_*were moved toBoxExpression. - remove
flatten_*from theAtominterface. Definitionhas a new propertyis_numeric.
Speed improvements:
- Creating two
Symbolobjects with the same name will give the same
object. This avoids unnecessary string comparisons, and calls to
ensure_context. - Attributes are now stored in a bitset instead of a tuple of strings.
- The
Definitionsobject has two properties:current_contexand
context_path. This speeds up the lookup of symbols names. These
properties store their values into the corresponding symbols in the
builtindefinitions. eval_Nwas add to speed up the then often-used built-in function
N.Expressionevaluation was gone over and improved. properties on
the collection which can speed up evaluation, such as whether an
expression is fully evaluated, is ordered, or is flat are collected.Listevaluation is customized. There is a newListExpression
class which has a more streamlinedevaluate()method. More of this
kind of thing will followBaseExpression.get_headavoids building a symbol saving two
function calls.
Package update
- SymPy 1.10.1
Compatibility
-
ScriptCommandLinenow returns, as the first element, the name of
the script file (when available), for compatibility with WMA. Issue
#132. -
Expression.numerifyimproved in a way to obtain a behavior closer
to WMA. -
NumericQlhs expressions are now handled as a special case in assignment. For exampleNumericQ[a]=Truetells the interpreter thatamust be considered -
a numeric quantity, so
NumericQ[Sin[a]]evaluates toTrue.
Bugs
First,RestandLastnow handle invalid arguments.Set*: fixed issue #128.SameQ: comparison with MachinePrecision only needs to be exact
within the last bit Issue #148.- Fix a bug in
Simplifythat produced expressions of the form
ConditionalExpression[_,{True}]. - Fix bug in
ClearandClearAll(#194). - Fix base 10 formatting for infix
Times. Issue #266. - Partial fix of
FillSimplify - Streams used in MathicsOpen are now freed and their file descriptors
now released. Issue #326. - Some temporary files that were created are now removed from the
filesystem. Issue #309. - There were a number of small changes/fixes involving
NIntegrate
and its Method options.Nintegratetests have been expanded. - Fix a bug in handling arguments of pythonized expressions, that are
produced byCompilewhen the llvmlite compiler fails. Nnow handles arbitrary precision numbers when the number of
digits is not specified.- [N[Indeterminate]]{.title-ref} now produces
[Indeterminate]{.title-ref} instead a
[PrecisionReal(nan)]{.title-ref}. - Fix crash in
NestWhilewhen supplyingAllas the fourth
argument. - Fix the comparison between
Imageand other expressions. - Fix an issue that prevented that [Collect]{.title-ref} handles
properly polynomials on expressions (issue #285). - Fix a bug in formatting expressions of the form
(-1)^awithout the
parenthesis (issue #332). - Fix a but in failure in the order in which
mathics.core.definitionsstores the rules. - Numeric overflows now do not affect the full evaluation, but inste...