Skip to content

Commit

Permalink
fixing typos discovered by codespell (#1045)
Browse files Browse the repository at this point in the history
As suggested by @rocky, I passed over all the folders except
`mathics.builtins` and `test.builtins` with codespell and I corrected
several typos.
In another round, I will pass through the remaining modules.
  • Loading branch information
mmatera authored Aug 1, 2024
1 parent 038eea9 commit b816347
Show file tree
Hide file tree
Showing 42 changed files with 79 additions and 79 deletions.
8 changes: 4 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Documentation
#. "Exponential Functional" split out from "Trigonometry Functions"
#. "Functional Programming" section split out.
#. "Image Manipulation" has been split off from Graphics and Drawing and turned into a guide section.
#. Image examples now appear in the LaTeX and therfore the PDF doc
#. Image examples now appear in the LaTeX and therefore the PDF doc
#. "Logic and Boolean Algebra" section reinstated.
#. "Forms of Input and Output" is its own guide section.
#. More URL links to Wiki pages added; more internal cross links added.
Expand Down Expand Up @@ -183,7 +183,7 @@ Bugs
#. Better handling of ``Infinite`` quantities.
#. Improved ``Precision`` and ``Accuracy``compatibility 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.
#. numeric precision in mpmath was not reset after operations that changed these. This cause huges slowdowns after an operation that set the mpmath precision 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

Expand Down Expand Up @@ -1061,7 +1061,7 @@ New features (50+ builtins)
#. ``SubsetQ`` and ``Delete[]`` #688, #784,
#. ``Subsets`` #685
#. ``SystemTimeZone`` and correct ``TimeZone`` #924
#. ``System\`Byteordering`` and ``System\`Environemnt`` #859
#. ``System\`Byteordering`` and ``System\`Environment`` #859
#. ``$UseSansSerif`` #908
#. ``randchoice`` option for ``NoNumPyRandomEnv`` #820
#. Support for ``MATHICS_MAX_RECURSION_DEPTH``
Expand Down Expand Up @@ -1411,7 +1411,7 @@ New features
#. ``PolarPlot``
#. IPython style (coloured) input
#. ``VectorAnalysis`` Package
#. More special functions (Bessel functions and othogonal polynomials)
#. More special functions (Bessel functions and orthogonal polynomials)
#. More NumberTheory functions
#. ``Import``, ``Export``, ``Get``, ``Needs`` and other IO related functions
#. PyPy compatibility
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

Expand Down
8 changes: 4 additions & 4 deletions PAST.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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 buitin Functions have been organized into grouping akind to what is found in WMA.
The builtin Functions have been organized into grouping akind 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.

Expand All @@ -34,14 +34,14 @@ Boxing and Formatting
While some work on formatting is done has been made and the change in API reflects a little of this.
However a lot more work needs to be done.

Excecution Performance
Execution Performance
----------------------

This has improved a slight bit, but not because it has been a focus, but
rather because in going over the code organization, we are doing this
less dumb, e.g. using Symbols more where symbols are intended. Or
fixing bugs like resetting mpmath numeric precision on operations that
need to chnage it temporarily.
need to change it temporarily.

Simpler Things
--------------
Expand All @@ -50,6 +50,6 @@ A number of items here remain, but should not be thought as independent items, b
"Forms, Boxing and Formatting".

"Making StandardOutput of polynomials match WMA" is really are Forms, Boxing and Formatting issue;
"Working on Jupyter integrations" is also very dependant this.
"Working on Jupyter integrations" is also very dependent this.

So the next major refactor will be on Forms, Boxing and Formatting.
2 changes: 1 addition & 1 deletion examples/symbolic_logic/gries_schneider/GS1.m
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@
right-hand side of the rule now, while parsing the rule itself, only later,
after doing the pattern substitutions specified by the rule."
Remember, evaluation is really aggressive. When you write a rule withe "->",
Remember, evaluation is really aggressive. When you write a rule with a "->",
mathics will try to evaluate the right-hand side.
Sometimes, it doesn't matter which of the two you use. In the example
Expand Down
4 changes: 2 additions & 2 deletions examples/symbolic_logic/gries_schneider/GS2.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<< "../../test_driver.m"

(* Chaper 2, Boolean Expressions, page 25
(* Chapter 2, Boolean Expressions, page 25
Section 2.1, Syntax and evaluation of Boolean expression, page 25
___ _ ___ _
Expand Down Expand Up @@ -110,7 +110,7 @@ target f(a). The number of different ways to assign ||B|| values to ||A||
there are 2 ** 4 == sixteen different binary functions.
I start with inert "true" and "false" to avoid evaluation leaks, i.e., to
prevent mathics from reducing expessions that have active "True" and
prevent mathics from reducing expressions that have active "True" and
"False".
*************************************************************************** *)
Expand Down
2 changes: 1 addition & 1 deletion examples/symbolic_logic/gries_schneider/GS3.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*************************************************************************** *)

(* Chaper 3, Propositional Calculus, page 41 **********************************
(* Chapter 3, Propositional Calculus, page 41 **********************************
___ _ _ _ _
| _ \_ _ ___ _ __ ___ __(_) |_(_)___ _ _ __ _| |
| _/ '_/ _ \ '_ \/ _ (_-< | _| / _ \ ' \/ _` | |
Expand Down
2 changes: 1 addition & 1 deletion mathics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# version_info contains a list of Python packages
# and the versions infsalled or "Not installed"
# if the package is not installed and "No version information"
# if we can't get version infomation.
# if we can't get version information.
version_info: Dict[str, str] = {
"mathics": __version__,
"mpmath": mpmath.__version__,
Expand Down
4 changes: 2 additions & 2 deletions mathics/core/convert/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
Routines here convert between various internal representations such as
between ``Expressions``, LLVM functions, SymPy Arguments, MPMath datattypes and
so on. However this does not include the inital conversion a parsed string into
between ``Expressions``, LLVM functions, SymPy Arguments, MPMath datatypes and
so on. However this does not include the initial conversion a parsed string into
one of the internal representations. That is done in the parser.
"""
6 changes: 3 additions & 3 deletions mathics/core/convert/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def from_bool(arg: bool) -> BooleanType:
# Expression class which tried to handle anything given it using
# conversions.
# Also, through vague or lazy coding this cause a lot of
# unecessary conversions.
# unnecessary conversions.

# We may be out of those days, but we should still
# be mindful that this routine can be the source
Expand All @@ -43,7 +43,7 @@ def from_python(arg: Any) -> BaseElement:
"""Converts a Python expression into a Mathics expression.
TODO: I think there are number of subtleties to be explained here.
In particular, the expression might beeen the result of evaluation
In particular, the expression might been the result of evaluation
a sympy expression which contains sympy symbols.
If the end result is to go back into Mathics for further
Expand All @@ -62,7 +62,7 @@ def from_python(arg: Any) -> BaseElement:
number_type = get_type(arg)

# We should investigate whether this could be sped up
# using a disctionary lookup on type.
# using a dictionary lookup on type.
if arg is None:
return SymbolNull
if isinstance(arg, bool):
Expand Down
2 changes: 1 addition & 1 deletion mathics/core/convert/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def to_regex_internal(

def recurse(x: Expression, quantifiers=q) -> Tuple[Optional[str], str]:
"""
Shortend way to call to_regexp_internal -
Shortened way to call to_regexp_internal -
only the expr and quantifiers change here.
"""
return to_regex_internal(
Expand Down
2 changes: 1 addition & 1 deletion mathics/core/parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
There is a separate `README
<https://github.com/Mathics3/mathics-core/blob/master/mathics/core/parser/README.md>`_
for decribing how this works.
for describing how this works.
"""


Expand Down
2 changes: 1 addition & 1 deletion mathics/eval/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
evaluation. If there were an instruction interpreter, these functions
that start "eval_" would be the interpreter instructions.
These operatations then should include the most commonly-used Builtin-functions like
These operations then should include the most commonly-used Builtin-functions like
``N[]`` and routines in support of performing those evaluation operations/instructions.
Performance of the operations here can be important for overall interpreter performance.
Expand Down
2 changes: 1 addition & 1 deletion mathics/eval/files_io/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from mathics.core.util import canonic_filename

# Python representation of $InputFileName. On Windows platforms, we
# canonicalize this to its Posix equvivalent name.
# canonicalize this to its Posix equivalent name.
# FIXME: Remove this as a module-level variable and instead
# define it in a session definitions object.
# With this, multiple sessions will have separate
Expand Down
6 changes: 3 additions & 3 deletions mathics/eval/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def extract_exif(image, evaluation: Evaluation) -> Optional[Expression]:

# EXIF has the following types: Short, Long, Rational, Ascii, Byte
# (see http://www.exiv2.org/tags.html). we detect the type from the
# Python type Pillow gives us and do the appropiate MMA handling.
# Python type Pillow gives us and do the appropriate MMA handling.

if isinstance(v, tuple) and len(v) == 2: # Rational
value = Rational(v[0], v[1])
Expand Down Expand Up @@ -298,7 +298,7 @@ def resize_width_height(

return image.filter(lambda im: im.resize((width, height), resample=resample))

# The Below code is hand-crapted Guassian resampling code, which is what
# The Below code is hand-crapted Gaussian resampling code, which is what
# WMA does. For now, are going to punt on this, and we use PIL methods only.

# Gaussian need sto unrounded values to compute scaling ratios.
Expand Down Expand Up @@ -330,7 +330,7 @@ def resize_width_height(
# kwargs = {"downscale": (1.0 / s)}
# # scikit_image in version 0.19 changes the resize parameter deprecating
# # "multichannel". scikit_image also doesn't support older Pythons like 3.6.15.
# # If we drop suport for 3.6 we can probably remove
# # If we drop support for 3.6 we can probably remove
# if skimage_version >= "0.19":
# # Not totally sure that we want channel_axis=1, but it makes the
# # test work. multichannel is deprecated in scikit-image-19.2
Expand Down
6 changes: 3 additions & 3 deletions mathics/eval/makeboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _boxed_string(string: str, **options):


# 640 = sys.int_info.str_digits_check_threshold.
# Someday when 3.11 is the minumum version of Python supported,
# Someday when 3.11 is the minimum version of Python supported,
# we can replace the magic value 640 below with sys.int.str_digits_check_threshold.
def int_to_string_shorter_repr(value: Integer, form: Symbol, max_digits=640):
"""Convert value to a String, restricted to max_digits characters.
Expand All @@ -94,7 +94,7 @@ def int_to_string_shorter_repr(value: Integer, form: Symbol, max_digits=640):
# Estimate the number of decimal digits
num_digits = int(value.bit_length() * 0.3)

# If the estimated number is bellow the threshold,
# If the estimated number is below the threshold,
# return it as it is.
if num_digits <= max_digits:
if is_negative:
Expand All @@ -103,7 +103,7 @@ def int_to_string_shorter_repr(value: Integer, form: Symbol, max_digits=640):

# estimate the size of the placeholder
size_placeholder = len(str(num_digits)) + 6
# Estimate the number of avaliable decimal places
# Estimate the number of available decimal places
avaliable_digits = max(max_digits - size_placeholder, 0)
# how many most significative digits include
len_msd = (avaliable_digits + 1) // 2
Expand Down
2 changes: 1 addition & 1 deletion mathics/eval/nevaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def eval_NValues(

# Here we look for the NValues associated to the
# lookup_name of the expression.
# If a rule is found and successfuly applied,
# If a rule is found and successfully applied,
# reevaluate the result and apply `eval_NValues` again.
# This should be implemented as a loop instead of
# recursively.
Expand Down
6 changes: 3 additions & 3 deletions mathics/eval/numbers/calculus/optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ def is_zero(
eps_expr: BaseElement = Integer10 ** (-prec_goal) if prec_goal else Integer0
if acc_goal:
eps_expr = eps_expr + Integer10 ** (-acc_goal) / abs(val)
threeshold_expr = Expression(SymbolLog, eps_expr)
threeshold: Real = eval_N(threeshold_expr, evaluation)
return threeshold.to_python() > 0
threshold_expr = Expression(SymbolLog, eps_expr)
threshold: Real = eval_N(threshold_expr, evaluation)
return threshold.to_python() > 0


def determine_epsilon(x0: Real, options: dict, evaluation: Evaluation) -> Real:
Expand Down
2 changes: 1 addition & 1 deletion mathics/eval/numbers/calculus/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def same_monomial(expr, x, x0):
# coeffs_powers = []
# coeffs_x = []
# for element in elements:
# if x.sameQ(elemnt):
# if x.sameQ(element):
# coeffs_x.append(x)
# elif isinstance(element, Atom):
# coeffs_free.append(element)
Expand Down
6 changes: 3 additions & 3 deletions mathics/eval/parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_subpart(sub_expression: BaseElement, sub_indices: List[int]) -> BaseElem


def set_part(expression, indices: List[int], new_atom: Atom) -> BaseElement:
"""Replace all parts of ``expression`` specified by ``indicies`` with
"""Replace all parts of ``expression`` specified by ``indices`` with
``new_atom`. Return the modified compound expression.
"""

Expand Down Expand Up @@ -435,7 +435,7 @@ def python_seq(start, stop, step, length):
if start == 0 or stop == 0:
return None

# wrap negative values to postive and convert from 1-based to 0-based
# wrap negative values to positive and convert from 1-based to 0-based
if start < 0:
start += length
else:
Expand Down Expand Up @@ -547,7 +547,7 @@ def sliced(x, s):

def deletecases_with_levelspec(expr, pattern, evaluation, levelspec=1, n=-1):
"""
This function walks the expression `expr` and deleting occurrencies of `pattern`
This function walks the expression `expr` and deleting occurrences of `pattern`
If levelspec specifies a number, only those positions with
`levelspec` "coordinates" are return. By default, it just return
Expand Down
2 changes: 1 addition & 1 deletion mathics/eval/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def eval_ListPlot(

is_axis_filling = is_discrete_plot
if filling == "System`Axis":
# TODO: Handle arbitary axis intercepts
# TODO: Handle arbitrary axis intercepts
filling = 0.0
is_axis_filling = True
elif filling == "System`Bottom":
Expand Down
2 changes: 1 addition & 1 deletion mathics/format/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
For example, in graphics we may be several different kinds of
renderers, SVG, or Asymptote for a particular kind of graphics Box.
The front-end nees to decides which format it better suited for it.
The front-end needs to decides which format it better suited for it.
The Box, however, is created via a particular high-level Form.
As another example, front-end may decide to use MathJaX to render
Expand Down
2 changes: 1 addition & 1 deletion mathics/format/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def graphics3dbox(self, elements=None, **options) -> str:

# TODO: Intelligently place the axes on the longest non-middle edge.
# See algorithm used by web graphics in mathics/web/media/graphics.js
# for details of this. (Projection to sceen etc).
# for details of this. (Projection to screen etc).

# Choose axes placement (boundbox edge vertices)
axes_indices = []
Expand Down
8 changes: 4 additions & 4 deletions mathics/format/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def density_plot_box(self, **options):
# since it is a cute idea, it is worthy of comment space... Put
# two triangles together to get a parallelogram. Compute the
# midpoint color in the enter and along all four sides. Then use
# two overlayed rectangular gradients each at opacity 0.5
# two overlaid rectangular gradients each at opacity 0.5
# to go from the center to each of the (square) sides.

svg_data = ["<--DensityPlot-->"]
Expand Down Expand Up @@ -258,10 +258,10 @@ def graphics_box(self, elements=None, **options: dict) -> str:
``elements`` could be a ``GraphicsElements`` object,
a tuple or a list.
Options is a dictionary of Graphics options dictionary. Intersting Graphics options keys:
Options is a dictionary of Graphics options dictionary. Interesting Graphics options keys:
``data``: a tuple bounding box information as well as a copy of ``elements``. If given
this supercedes the information in the ``elements`` parameter.
this supersedes the information in the ``elements`` parameter.
``evaluation``: an ``Evaluation`` object that can be used when further evaluation is needed.
"""
Expand Down Expand Up @@ -310,7 +310,7 @@ def graphics_box(self, elements=None, **options: dict) -> str:

tooltip_text = self.tooltip_text if hasattr(self, "tooltip_text") else ""
if self.background_color is not None:
# FIXME: tests don't seem to cover this secton of code.
# FIXME: tests don't seem to cover this section of code.
# Wrap svg_elements in a rectangle

background = "rgba(100%,100%,100%,100%)"
Expand Down
2 changes: 1 addition & 1 deletion mathics/format/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def gridbox(self, elements=None, **box_options) -> str:

cells = [
[
# TODO: check if this evaluation is necesary.
# TODO: check if this evaluation is necessary.
boxes_to_text(item, **box_options).splitlines()
for item in row
]
Expand Down
2 changes: 1 addition & 1 deletion mathics/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def main() -> int:

argparser.add_argument(
"--strict-wl-output",
help="Most WL-output compatible (at the expense of useability).",
help="Most WL-output compatible (at the expense of usability).",
action="store_true",
)

Expand Down
Loading

0 comments on commit b816347

Please sign in to comment.