Skip to content

Commit 30fcbd7

Browse files
authored
Merge pull request #1224 from mathics/release-2.1.0
Update 2.1.0 release notes; bump version
2 parents 9ddd63a + dfbe2d7 commit 30fcbd7

File tree

8 files changed

+77
-51
lines changed

8 files changed

+77
-51
lines changed

CHANGES.rst

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,23 @@ Enhancements
2121

2222
* The Mathics version is checked for builtin modules at load time. A message is given when a builtin doesn't load.
2323
* Automatic detection for the best strategy to numeric evaluation of constants.
24-
* ``FileNameJoin`` - implement ``OperatingSystem`` option
25-
* Mathics functions are accepted by ``Compile[]``. The return value or type will be
26-
``Compile[] and CompiledFunction[]`` every expression can have a compiled form,
27-
as a Python function.
24+
* ``FileNameJoin`` now implements ``OperatingSystem`` option
25+
* Mathics functions are accepted by ``Compile[]``. The return value or
26+
type will be ``Compile[] and CompiledFunction[]``. Every Mathics
27+
Expression can have a compiled form, which may be implemented as a
28+
Python function.
2829
* ``Equal[]`` now compares complex against other numbers properly.
2930
* Improvements in handling products with infinite factors: ``0 Infinity``-> ``Indeterminate``, and ``expr Infinity``-> ``DirectedInfinite[expr]``
30-
* ``$Path`` is now Unprotected by default
31-
* Improving the reading of expressions from files.
32-
* ``StringSplit`` now accepts a list in the first argument.
33-
* ``SetDelayed`` now accepts several conditions imposed both at LHS as well as RHS.
31+
* ``$Path`` is now ``Unprotected`` by default
32+
* ``Read[]`` handles expressions better.
33+
* ``StringSplit[]`` now accepts a list in the first argument.
34+
* ``SetDelayed[]`` now accepts several conditions imposed both at LHS as well as RHS.
3435

3536

3637
Bug fixes
3738
+++++++++
3839

39-
* TeXForm for integrals are now properly formatted.
40+
* ``TeXForm[]`` for integrals are now properly formatted.
4041

4142

4243
Pymathics Modules
@@ -53,18 +54,27 @@ Pymathics Modules
5354
Miscellanea
5455
+++++++++++
5556

56-
* A pass was made to improve Microsoft Windows compatability and testing
57-
Windows under MSYS.
57+
* A pass was made to improve Microsoft Windows compatability and testing Windows under MSYS.
5858
* Include numpy version in version string. Show in CLI
5959
* Small CLI tweaks ``--colors=None`` added to match mathicsscript.
6060
* In the ``BaseExpression`` and derivated classes, the method ``boxes_to_xml`` now are called ``boxes_to_mathml``.
6161
* In the ``format`` method of the class ``Evaluation``, the builtin ``ToString`` is called instead of ``boxes_to_text``
62-
In order to control the final form of boxes from the user space in specific symbols and contexts.
63-
* ``GraphicsBox`` now have two methods: ``to_svg`` and ``to_mathml``. The first produces SVG plain text while the second produces ``<mglyph ...>``
64-
tags with base64 encoded svgs.
62+
* In order to control the final form of boxes from the user space in specific symbols and contexts.
63+
* ``GraphicsBox`` now have two methods: ``to_svg`` and ``to_mathml``. The first produces SVG plain text while the second produces ``<mglyph ...>`` tags with base64 encoded svgs.
6564
* Improving the support for ``Inset`` and ``InsetBox``.
6665

6766

67+
What's to expect in a Future Release
68+
++++++++++++++++++++++++++++++++++++
69+
70+
* Improved ``Equal`` See `PR #1209 <https://github.com/mathics/Mathics/pull/1209/>`_
71+
* Better Unicode support, especially for Mathics operators
72+
* Improved ``D[]`` and ``Derivative[]`` See `PR #1220 <https://github.com/mathics/Mathics/pull/1209/>`_.
73+
* Improved performance
74+
* ``Collect[]`` See `Issue #1194 <https://github.com/mathics/Mathics/issues/1194>`_.
75+
* ``Series[]`` See `Issue #1193 <https://github.com/mathics/Mathics/issues/1194>`_.
76+
77+
6878
2.0.0
6979
-----
7080

mathics/builtin/assignment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ class SetDelayed(Set):
550550
= p[3]
551551
>> f[-3]
552552
= f[-3]
553-
It also works if the condition is set in the LHS
553+
It also works if the condition is set in the LHS:
554554
>> F[x_, y_] /; x < y /; x>0 := x / y;
555555
>> F[x_, y_] := y / x;
556556
>> F[2, 3]

mathics/builtin/compilation.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class Compile(Builtin):
2323
<dd>Compiles assuming each $xi$ matches type $ti$.
2424
</dl>
2525
26+
Compilation is performed using llvmlite , or Python's builtin
27+
"compile" function.
28+
29+
2630
>> cf = Compile[{x, y}, x + 2 y]
2731
= CompiledFunction[{x, y}, x + 2 y, -CompiledCode-]
2832
>> cf[2.5, 4.3]
@@ -59,8 +63,7 @@ class Compile(Builtin):
5963
#> cf[0, -2]
6064
= 0.5
6165
62-
Loops and variable assignments are supported as python (not llvmlite)
63-
functions
66+
Loops and variable assignments are supported usinv Python builtin "compile" function:
6467
>> Compile[{{a, _Integer}, {b, _Integer}}, While[b != 0, {a, b} = {b, Mod[a, b]}]; a] (* GCD of a, b *)
6568
= CompiledFunction[{a, b}, a, -PythonizedCode-]
6669
"""
@@ -163,6 +166,12 @@ def __str__(self):
163166
return "-PythonizedCode-"
164167
return "-CompiledCode-"
165168

169+
def boxes_to_text(self, leaves=None, **options):
170+
from trepan.api import debug; debug()
171+
if not leaves:
172+
leaves = self._leaves
173+
return "-CompiledCode-"
174+
166175
def do_copy(self):
167176
return CompiledCode(self.cfunc, self.args)
168177

mathics/builtin/files.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ def reader(stream, word_separators, accepted=None):
796796
if word == "":
797797
continue
798798
if stream.seekable():
799-
# stream.seek(-1, 1) #Python3
799+
# stream.seek(-1, 1) #Python3
800800
stream.seek(stream.tell() - 1)
801801
last_word = word
802802
word = ""
@@ -2597,19 +2597,22 @@ class ToFileName(Builtin):
25972597

25982598
class FileNameJoin(Builtin):
25992599
"""
2600-
<dl>
2601-
<dt>'FileNameJoin[{"$dir_1$", "$dir_2$", ...}]'
2602-
<dd>joins the $dir_i$ togeather into one path.
2603-
</dl>
2600+
<dl>
2601+
<dt>'FileNameJoin[{"$dir_1$", "$dir_2$", ...}]'
2602+
<dd>joins the $dir_i$ together into one path.
26042603
2605-
>> FileNameJoin[{"dir1", "dir2", "dir3"}]
2606-
= ...
2604+
<dt>'FileNameJoin[..., OperatingSystem->"os"]'
2605+
<dd>yields a file name in the format for the specified operating system. Possible choices are "Windows", "MacOSX", and "Unix".
2606+
</dl>
2607+
2608+
>> FileNameJoin[{"dir1", "dir2", "dir3"}]
2609+
= ...
26072610
2608-
>> FileNameJoin[{"dir1", "dir2", "dir3"}, OperatingSystem -> "Unix"]
2609-
= dir1/dir2/dir3
2611+
>> FileNameJoin[{"dir1", "dir2", "dir3"}, OperatingSystem -> "Unix"]
2612+
= dir1/dir2/dir3
26102613
2611-
>> FileNameJoin[{"dir1", "dir2", "dir3"}, OperatingSystem -> "Windows"]
2612-
= dir1\\dir2\\dir3
2614+
>> FileNameJoin[{"dir1", "dir2", "dir3"}, OperatingSystem -> "Windows"]
2615+
= dir1\\dir2\\dir3
26132616
"""
26142617

26152618
attributes = "Protected"
@@ -5090,12 +5093,12 @@ class FileNames(Builtin):
50905093
<dd>Returns a list with the filenames in the current working folder.
50915094
<dt>'FileNames[$form$]'
50925095
<dd>Returns a list with the filenames in the current working folder that matches with $form$.
5093-
<dt>'FileNames[{$form_1$, $form_2$, $\ldots$}]'
5094-
<dd>Returns a list with the filenames in the current working folder that matches with one of $form_1$, $form_2$, $\ldots$.
5095-
<dt>'FileNames[{$form_1$, $form_2$, $\ldots$},{$dir_1$, $dir_2$, $\ldots$}]'
5096-
<dd>Looks into the directories $dir_1$, $dir_2$, $\ldots$.
5097-
<dt>'FileNames[{$form_1$, $form_2$, $\ldots$},{$dir_1$, $dir_2$, $\ldots$}]'
5098-
<dd>Looks into the directories $dir_1$, $dir_2$, $\ldots$.
5096+
<dt>'FileNames[{$form_1$, $form_2$, ...}]'
5097+
<dd>Returns a list with the filenames in the current working folder that matches with one of $form_1$, $form_2$, ....
5098+
<dt>'FileNames[{$form_1$, $form_2$, ...},{$dir_1$, $dir_2$, ...}]'
5099+
<dd>Looks into the directories $dir_1$, $dir_2$, ....
5100+
<dt>'FileNames[{$form_1$, $form_2$, ...},{$dir_1$, $dir_2$, ...}]'
5101+
<dd>Looks into the directories $dir_1$, $dir_2$, ....
50995102
<dt>'FileNames[{$forms$, $dirs$, $n$]'
51005103
<dd>Look for files up to the level $n$.
51015104
</dl>

mathics/builtin/lists.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ class Normal(Builtin):
198198
class ByteArray(Builtin):
199199
r"""
200200
<dl>
201-
<dt>'ByteArray[{$b_1$, $b_2$, $\ldots$}]'
202-
<dd> Represents a sequence of Bytes $b_1$, $b_2$, $\ldots$
201+
<dt>'ByteArray[{$b_1$, $b_2$, ...}]'
202+
<dd> Represents a sequence of Bytes $b_1$, $b_2$, ...
203203
<dt>'ByteArray["string"]'
204204
<dd> Constructs a byte array where bytes comes from decode a b64 encoded String
205205
</dl>
@@ -6274,10 +6274,10 @@ class Failure(Builtin):
62746274
class FirstCase(Builtin):
62756275
"""
62766276
<dl>
6277-
<dt> FirstCase[{$e1$, $e2$, $\\ldots$}, $pattern$]
6277+
<dt> FirstCase[{$e1$, $e2$, ...}, $pattern$]
62786278
<dd>gives the first $ei$ to match $pattern$, or $Missing[\"NotFound\"]$ if none matching pattern is found.
62796279
6280-
<dt> FirstCase[{$e1$,$e2$, $\\ldots$}, $pattern$ -> $rhs$]
6280+
<dt> FirstCase[{$e1$,$e2$, ...}, $pattern$ -> $rhs$]
62816281
<dd> gives the value of $rhs$ corresponding to the first $ei$ to match pattern.
62826282
<dt> FirstCase[$expr$, $pattern$, $default$]
62836283
<dd> gives $default$ if no element matching $pattern$ is found.

mathics/builtin/numeric.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -418,33 +418,37 @@ def ff(*z):
418418
class NIntegrate(Builtin):
419419
"""
420420
<dl>
421-
<dt>'NIntegrate[$expr$, $interval$]'
422-
<dd>evaluates the definite integral of $expr$ numerically
423-
with a precision of $prec$ digits.
421+
<dt>'NIntegrate[$expr$, $interval$]'
422+
<dd>returns a numeric approximation to the definite integral of $expr$ with limits $interval$ and with a precision of $prec$ digits.
423+
424+
<dt>'NIntegrate[$expr$, $interval1$, $interval2$, ...]'
425+
<dd>returns a numeric approximation to the multiple integral of $expr$ with limits $interval1$, $interval2$ and with a precision of $prec$ digits.
424426
</dl>
425427
426-
>> Table[1./NIntegrate[x^k,{x,0,1},Tolerance->1*^-6], {k,0,6}]
427-
: The especified method failed to return a number. Falling back into the internal evaluator.
428-
= {1., 2., 3., 4., 5., 6., 7.}
429428
>> NIntegrate[Exp[-x],{x,0,Infinity},Tolerance->1*^-6]
430429
= 1.
431430
>> NIntegrate[Exp[x],{x,-Infinity, 0},Tolerance->1*^-6]
432431
= 1.
433432
>> NIntegrate[Exp[-x^2/2.],{x,-Infinity, Infinity},Tolerance->1*^-6]
434433
= 2.50663
435434
435+
>> Table[1./NIntegrate[x^k,{x,0,1},Tolerance->1*^-6], {k,0,6}]
436+
: The specified method failed to return a number. Falling back into the internal evaluator.
437+
= {1., 2., 3., 4., 5., 6., 7.}
438+
436439
>> NIntegrate[1 / z, {z, -1 - I, 1 - I, 1 + I, -1 + I, -1 - I}, Tolerance->1.*^-4]
437440
: Integration over a complex domain is not implemented yet
438441
= NIntegrate[1 / z, {z, -1 - I, 1 - I, 1 + I, -1 + I, -1 - I}, Tolerance -> 0.0001]
439442
## = 6.2832 I
440443
441444
Integrate singularities with weak divergences:
442-
>> Table[NIntegrate[x^(1./k-1.),{x,0,1.},Tolerance->1*^-6], {k,1,7.}]
445+
>> Table[ NIntegrate[x^(1./k-1.), {x,0,1.}, Tolerance->1*^-6], {k,1,7.} ]
443446
= {1., 2., 3., 4., 5., 6., 7.}
444447
445-
Iterated Integral:
446-
>> NIntegrate[x * y,{x, 0, 1},{y, 0, 1}]
448+
Mutiple Integrals :
449+
>> NIntegrate[x * y,{x, 0, 1}, {y, 0, 1}]
447450
= 0.25
451+
448452
"""
449453

450454
messages = {
@@ -457,7 +461,7 @@ class NIntegrate(Builtin):
457461
"nlim": "`1` = `2` is not a valid limit of integration.",
458462
"ilim": "Invalid integration variable or limit(s) in `1`.",
459463
"mtdfail": (
460-
"The especified method failed to return a "
464+
"The specified method failed to return a "
461465
+ "number. Falling back into the internal "
462466
+ "evaluator."
463467
),
@@ -1807,7 +1811,7 @@ class Hash(Builtin):
18071811
<dd>returns an integer hash of the specified $type$ for the given $expr$.</dd>
18081812
<dd>The types supported are "MD5", "Adler32", "CRC32", "SHA", "SHA224", "SHA256", "SHA384", and "SHA512".</dd>
18091813
<dt>'Hash[$expr$, $type$, $format$]'
1810-
<dd>Returns the hash in the especified format.</dd>
1814+
<dd>Returns the hash in the specified format.</dd>
18111815
</dl>
18121816
18131817
> Hash["The Adventures of Huckleberry Finn"]

mathics/core/expression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ def __getnewargs__(self):
20322032
SymbolMakeBoxes = Symbol("MakeBoxes")
20332033
SymbolN = Symbol("N")
20342034
SymbolRule = Symbol("Rule")
2035-
SymbolSequence = Symbol("Sequence")
2035+
SymbolSequence = Symbol("Sequence")
20362036

20372037

20382038
@lru_cache(maxsize=1024)

mathics/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# This file is suitable for sourcing inside POSIX shell as
55
# well as importing into Python. That's why there is no
66
# space around "=" below.
7-
__version__="2.0.1.dev" # noqa
7+
__version__="2.1.0" # noqa

0 commit comments

Comments
 (0)