Skip to content

Commit 7464033

Browse files
committed
CHANGES.rst tweak
1 parent 4b23ef3 commit 7464033

File tree

5 files changed

+44
-30
lines changed

5 files changed

+44
-30
lines changed

CHANGES.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ Enhancements
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.
2424
* ``FileNameJoin`` now implements ``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.
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

mathics/builtin/compilation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ def __str__(self):
163163
return "-PythonizedCode-"
164164
return "-CompiledCode-"
165165

166+
def boxes_to_text(self, leaves=None, **options):
167+
from trepan.api import debug; debug()
168+
if not leaves:
169+
leaves = self._leaves
170+
return "-CompiledCode-"
171+
166172
def do_copy(self):
167173
return CompiledCode(self.cfunc, self.args)
168174

mathics/builtin/files.py

Lines changed: 14 additions & 11 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"

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 $iterval 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 especified 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)

0 commit comments

Comments
 (0)