Skip to content

Commit

Permalink
Merge pull request #742 from Mathics3/codespell-misspellings
Browse files Browse the repository at this point in the history
Lots of little spelling corrections...
  • Loading branch information
rocky authored Jan 11, 2023
2 parents 5ee4034 + 5de07b4 commit cc86cac
Show file tree
Hide file tree
Showing 33 changed files with 150 additions and 105 deletions.
24 changes: 16 additions & 8 deletions mathics/algorithm/parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,14 @@ def deletecases_with_levelspec(expr, pattern, evaluation, levelspec=1, n=-1):
"""
This function walks the expression `expr` and deleting occurrencies of `pattern`
If levelspec specifies a number, only those positions with `levelspec` "coordinates" are return. By default, it just return occurences in the first level.
If a tuple (nmin, nmax) is provided, it just return those occurences with a number of "coordinates" between nmin and nmax.
n indicates the number of occurrences to return. By default, it returns all the occurences.
If levelspec specifies a number, only those positions with
`levelspec` "coordinates" are return. By default, it just return
occurrences in the first level.
If a tuple (nmin, nmax) is provided, it just return those
occurrences with a number of "coordinates" between nmin and nmax.
n indicates the number of occurrences to return. By default, it
returns all the occurrences.
"""
nothing = SymbolNothing
from mathics.builtin.patterns import Matcher
Expand Down Expand Up @@ -617,12 +621,16 @@ def deletecases_with_levelspec(expr, pattern, evaluation, levelspec=1, n=-1):
def find_matching_indices_with_levelspec(expr, pattern, evaluation, levelspec=1, n=-1):
"""
This function walks the expression `expr` looking for a pattern `pattern`
and returns the positions of each occurence.
and returns the positions of each occurrence.
If levelspec specifies a number, only those positions with `levelspec` "coordinates" are return. By default, it just return occurences in the first level.
If levelspec specifies a number, only those positions with
`levelspec` "coordinates" are return. By default, it just return
occurrences in the first level.
If a tuple (nmin, nmax) is provided, it just return those occurences with a number of "coordinates" between nmin and nmax.
n indicates the number of occurrences to return. By default, it returns all the occurences.
If a tuple (nmin, nmax) is provided, it just return those
occurrences with a number of "coordinates" between nmin and nmax.
n indicates the number of occurrences to return. By default, it
returns all the occurrences.
"""
from mathics.builtin.patterns import Matcher

Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ class Sum(IterationFunction, SympyFunction):
>> Sum[1 / 2 ^ i, {i, 1, Infinity}]
= 1
Leibniz forumla used in computing Pi:
Leibniz formula used in computing Pi:
>> Sum[1 / ((-1)^k (2k + 1)), {k, 0, Infinity}]
= Pi / 4
Expand Down
3 changes: 2 additions & 1 deletion mathics/builtin/assignments/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""
Assignments
Assigments allow you to set or clear variables, indexed variables, structure elements, functions, and general transformations.
Assignments allow you to set or clear variables, indexed variables, \
structure elements, functions, and general transformations.
You can also get assignment and documentation information about symbols.
"""
2 changes: 1 addition & 1 deletion mathics/builtin/atomic/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Representation of Numbers
Integers and Real numbers with any number of digits, automatically tagging \
numerical preceision when appropriate.
numerical precision when appropriate.
Precision is not "guarded" through the evaluation process. Only integer \
precision is supported.
Expand Down
6 changes: 4 additions & 2 deletions mathics/builtin/atomic/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,9 @@ class SystemCharacterEncoding(Predefined):
<dt>$SystemCharacterEncoding
<dd>gives the default character encoding of the system.
On startup, the value of environment variable 'MATHICS_CHARACTER_ENCODING' sets this value. However if that evironment varaible is not set, set the value is set in Python using 'sys.getdefaultencoding()'.
On startup, the value of environment variable 'MATHICS_CHARACTER_ENCODING' \
sets this value. However if that environment variable is not set, set the value \
is set in Python using 'sys.getdefaultencoding()'.
</dl>
>> $SystemCharacterEncoding
Expand All @@ -1056,7 +1058,7 @@ class ToExpression(Builtin):
https://reference.wolfram.com/language/ref/ToExpression.html</url>
<dl>
<dt>'ToExpression[$input$]'
<dd>inteprets a given string as Mathics input.
<dd>interprets a given string as Mathics input.
<dt>'ToExpression[$input$, $form$]'
<dd>reads the given input in the specified $form$.
Expand Down
4 changes: 2 additions & 2 deletions mathics/builtin/binary/bytearray.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ class ByteArray(Builtin):
>> ByteArray["ARkD"]
= ByteArray[<3>]
>> B=ByteArray["asy"]
: The first argument in Bytearray[asy] should be a B64 enconded string or a vector of integers.
: The first argument in Bytearray[asy] should be a B64 encoded string or a vector of integers.
= $Failed
"""

messages = {
"aotd": "Elements in `1` are inconsistent with type Byte",
"lend": "The first argument in Bytearray[`1`] should "
+ "be a B64 enconded string or a vector of integers.",
+ "be a B64 encoded string or a vector of integers.",
}
summary_text = "array of bytes"

Expand Down
32 changes: 19 additions & 13 deletions mathics/builtin/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ class Equal(_EqualityOperator, _SympyComparison):
>> a = b; a == b
= True
Comparision to mismatched types is False:
Comparison to mismatched types is False:
>> Equal[11, "11"]
= False
Expand All @@ -571,8 +571,8 @@ class Equal(_EqualityOperator, _SympyComparison):
>> {1, 2} == {1, 2, 3}
= False
For chains of equalities, the comparison is done amongs all the pairs. The evaluation is successful
only if the equality is satisfied over all the pairs:
For chains of equalities, the comparison is done amongst all the pairs. \
The evaluation is successful only if the equality is satisfied over all the pairs:
>> g[1] == g[1] == g[1]
= True
Expand Down Expand Up @@ -726,7 +726,7 @@ class Less(_ComparisonOperator, _SympyComparison):
>> 2/18 < 1/5 < Pi/10
= True
Using less on an undfined symbol value:
Using less on an undefined symbol value:
>> 1 < 3 < x < 2
= 1 < 3 < x < 2
"""
Expand Down Expand Up @@ -951,13 +951,15 @@ class SameQ(_ComparisonOperator):
<dl>
<dt>'SameQ[$x$, $y$]'
<dt>'$x$ === $y$'
<dd>returns 'True' if $x$ and $y$ are structurally identical.
Commutative properties apply, so if $x$ === $y$ then $y$ === $x$.
<dd>returns 'True' if $x$ and $y$ are structurally identical. \
Commutative properties apply, so if $x$ === $y$ then $y$ === $x$.
</dl>
<ul>
<li>'SameQ' requires exact correspondence between expressions, expet that it still considers 'Real' numbers equal if they differ in their last binary digit.
<li>'SameQ' requires exact correspondence between expressions, expect that \
it still considers 'Real' numbers equal if they differ in their last \
binary digit.
<li>$e1$ === $e2$ === $e3$ gives 'True' if all the $ei$'s are identical.
<li>'SameQ[]' and 'SameQ[$expr$]' always yield 'True'.
</ul>
Expand All @@ -971,7 +973,8 @@ class SameQ(_ComparisonOperator):
>> SameQ[a] === SameQ[] === True
= True
Unlike 'Equal', 'SameQ' only yields 'True' if $x$ and $y$ have the same type:
Unlike 'Equal', 'SameQ' only yields 'True' if $x$ and $y$ have the same \
type:
>> {1==1., 1===1.}
= {True, False}
Expand Down Expand Up @@ -1034,21 +1037,24 @@ class TrueQ(Builtin):

class Unequal(_EqualityOperator, _SympyComparison):
"""
<url>:WMA link:https://reference.wolfram.com/language/ref/Unequal.html</url>
<url>
:WMA link:
https://reference.wolfram.com/language/ref/Unequal.html</url>
<dl>
<dt>'Unequal[$x$, $y$]' or $x$ != $y$ or $x$ \u2260 $y$
<dd>is 'False' if $x$ and $y$ are known to be equal, or 'True' if $x$ and $y$ are known to be unequal.
<dd>is 'False' if $x$ and $y$ are known to be equal, or 'True' if $x$ \
and $y$ are known to be unequal.
Commutative properties apply so if $x$ != $y$ then $y$ != $x$.
For any expression $x$ and $y$, Unequal[$x$, $y$] == Not[Equal[$x$, $y$]].
For any expression $x$ and $y$, 'Unequal[$x$, $y$]' == 'Not[Equal[$x$, $y$]]'.
</dl>
>> 1 != 1.
= False
Comparsion can be chained:
Comparisons can be chained:
>> 1 != 2 != 3
= True
Expand All @@ -1059,7 +1065,7 @@ class Unequal(_EqualityOperator, _SympyComparison):
>> Unequal["11", "11"]
= False
Comparision to mismatched types is True:
Comparison to mismatched types is True:
>> Unequal[11, "11"]
= True
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/distance/numeric.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Numerial Data
Numercial Data
"""

from mathics.builtin.base import Builtin
Expand Down
10 changes: 6 additions & 4 deletions mathics/builtin/drawing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
Showing something visually can be done in a number of ways:
<ul>
<li>Starting with complete images and modifiying them using the 'Image' Built-in function.
<li>Starting with complete images and modifying them using the 'Image' Built-in function.
<li>Use pre-defined 2D or 3D objects like <url>
:'Circle':
/doc/reference-of-built-in-symbols/drawing-graphics/circle</url> and <url>
:'Cuboid': /doc/reference-of-built-in-symbols/graphics-drawing-and-images/three-dimensional-graphics/cuboid/</url> \
and place them in a coordiate space.
:'Cuboid':
/doc/reference-of-built-in-symbols/graphics-drawing-and-images/three-dimensional-graphics/cuboid/</url> \
and place them in a coordinate space.
<li>Compute the points of the space using a function. This is done using functions like <url>
:'Plot':
/doc/reference-of-built-in-symbols/graphics-drawing-and-images/plotting-data/plot</url> \
and <url>
:'ListPlot': /doc/reference-of-built-in-symbols/graphics-drawing-and-images/plotting-data/listplot</url>.
:'ListPlot':
/doc/reference-of-built-in-symbols/graphics-drawing-and-images/plotting-data/listplot</url>.
</ul>
"""

Expand Down
4 changes: 2 additions & 2 deletions mathics/builtin/drawing/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2124,15 +2124,15 @@ class PieChart(_Chart):
<li>SectorSpacing" (default Automatic)
</ul>
A hypothetical comparsion between types of pets owned:
A hypothetical comparison between types of pets owned:
>> PieChart[{30, 20, 10}, ChartLabels -> {Dogs, Cats, Fish}]
= -Graphics-
A doughnut chart for a list of values:
>> PieChart[{8, 16, 2}, SectorOrigin -> {Automatic, 1.5}]
= -Graphics-
A Pie chart with multple datasets:
A Pie chart with multiple datasets:
>> PieChart[{{10, 20, 30}, {15, 22, 30}}]
= -Graphics-
Expand Down
10 changes: 5 additions & 5 deletions mathics/builtin/files_io/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ class FilePrint(Builtin):
: File specification Sin[1] is not a string of one or more characters.
= FilePrint[Sin[1]]
#> FilePrint["somenonexistantpath_h47sdmk^&h4"]
: Cannot open somenonexistantpath_h47sdmk^&h4.
= FilePrint[somenonexistantpath_h47sdmk^&h4]
#> FilePrint["somenonexistentpath_h47sdmk^&h4"]
: Cannot open somenonexistentpath_h47sdmk^&h4.
= FilePrint[somenonexistentpath_h47sdmk^&h4]
#> FilePrint[""]
: File specification is not a string of one or more characters.
Expand Down Expand Up @@ -927,7 +927,7 @@ class Read(Builtin):
= 5
>> Close[stream];
Reading a comment however will return the empy list:
Reading a comment however will return the empty list:
>> stream = StringToStream["(* ::Package:: *)"];
>> Read[stream, Hold[Expression]]
Expand Down Expand Up @@ -1686,7 +1686,7 @@ class Streams(Builtin):
#> Streams[%[[1]]]
= {OutputStream[...]}
#> Streams["some_nonexistant_name"]
#> Streams["some_nonexistent_name"]
= {}
"""

Expand Down
12 changes: 8 additions & 4 deletions mathics/builtin/files_io/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,9 @@ def eval(self, pathlist, evaluation, options):

class FileType(Builtin):
"""
<url>:WMA link:https://reference.wolfram.com/language/ref/FileType.html</url>
<url>
:WMA link:
https://reference.wolfram.com/language/ref/FileType.html</url>
<dl>
<dt>'FileType["$file$"]'
Expand All @@ -1168,7 +1170,7 @@ class FileType(Builtin):
= File
>> FileType["ExampleData"]
= Directory
>> FileType["ExampleData/nonexistant"]
>> FileType["ExampleData/nonexistent"]
= None
#> FileType[x]
Expand Down Expand Up @@ -1901,11 +1903,13 @@ def evaluate(self, evaluation):

class PathnameSeparator(Predefined):
"""
<url>:WMA link:https://reference.wolfram.com/language/ref/$PathnameSeparator.html</url>
<url>
:WMA link:
https://reference.wolfram.com/language/ref/$PathnameSeparator.html</url>
<dl>
<dt>'$PathnameSeparator'
<dd>returns a string for the seperator in paths.
<dd>returns a string for the separator in paths.
</dl>
>> $PathnameSeparator
Expand Down
33 changes: 19 additions & 14 deletions mathics/builtin/files_io/importexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,13 +1043,18 @@ class RegisterImport(Builtin):
<dl>
<dt>'RegisterImport["$format$", $defaultFunction$]'
<dd>register '$defaultFunction$' as the default function used when importing from a file of type '"$format$"'.
<dt>'RegisterImport["$format$", {"$elem1$" :> $conditionalFunction1$, "$elem2$" :> $conditionalFunction2$, ..., $defaultFunction$}]'
<dd>registers multiple elements ($elem1$, ...) and their corresponding converter functions ($conditionalFunction1$, ...) in addition to the $defaultFunction$.
<dt>'RegisterImport["$format$", {"$conditionalFunctions$, $defaultFunction$, "$elem3$" :> $postFunction3$, "$elem4$" :> $postFunction4$, ...}]'
<dd>also registers additional elements ($elem3$, ...) whose converters ($postFunction3$, ...) act on output from the low-level funcions.
<dd>register '$defaultFunction$' as the default function used when \
importing from a file of type '"$format$"'.
<dt>'RegisterImport["$format$", {"$elem1$" :> $conditionalFunction1$, \
"$elem2$" :> $conditionalFunction2$, ..., $defaultFunction$}]'
<dd>registers multiple elements ($elem1$, ...) and their corresponding \
converter functions ($conditionalFunction1$, ...) in addition to the $defaultFunction$.
<dt>'RegisterImport["$format$", {"$conditionalFunctions$, $defaultFunction$, \
"$elem3$" :> $postFunction3$, "$elem4$" :> $postFunction4$, ...}]'
<dd>also registers additional elements ($elem3$, ...) whose converters \
($postFunction3$, ...) act on output from the low-level functions.
</dl>
First, define the default function used to import the data.
Expand Down Expand Up @@ -1210,17 +1215,17 @@ class RegisterExport(Builtin):
context = "ImportExport`"

options = {
"Path": "Automatic",
"FunctionChannels": '{"FileNames"}',
"Sources": "None",
"DefaultElement": "None",
"AlphaChannel": "False",
"AvailableElements": "None",
"Options": "{}",
"OriginalChannel": "False",
"BinaryFormat": "False",
"DefaultElement": "None",
"Encoding": "False",
"Extensions": "{}",
"AlphaChannel": "False",
"FunctionChannels": '{"FileNames"}',
"Options": "{}",
"OriginalChannel": "False",
"Path": "Automatic",
"Sources": "None",
}

def eval(self, formatname: String, function, evaluation: Evaluation, options):
Expand Down
4 changes: 2 additions & 2 deletions mathics/builtin/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ class Arrow(Builtin):
>> Graphics[{Circle[], Arrow[{{2, 1}, {0, 0}}, 1]}]
= -Graphics-
Arrows can also be drawn in 3D by giving poing in three dimensions:
Arrows can also be drawn in 3D by giving point in three dimensions:
>> Graphics3D[Arrow[{{1, 1, -1}, {2, 2, 0}, {3, 3, -1}, {4, 4, 0}}]]
= -Graphics3D-
Expand Down Expand Up @@ -1401,7 +1401,7 @@ class Rectangle(Builtin):
<dd>represents a unit square with bottom-left corner at {$xmin$, $ymin$}.
<dt>'Rectangle[{$xmin$, $ymin$}, {$xmax$, $ymax$}]
<dd>is a rectange extending from {$xmin$, $ymin$} to {$xmax$, $ymax$}.
<dd>is a rectangle extending from {$xmin$, $ymin$} to {$xmax$, $ymax$}.
</dl>
>> Graphics[Rectangle[]]
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/image/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class Colorize(Builtin):
<dl>
<dt>'Colorize[$values$]'
<dd>returns an image where each number in the rectangular matrix \
$values$ is a pixel and each occurence of the same number is \
$values$ is a pixel and each occurrence of the same number is \
displayed in the same unique color, which is different from the \
colors of all non-identical numbers.
Expand Down
Loading

0 comments on commit cc86cac

Please sign in to comment.