Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions mathics/builtin/files_io/importexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,6 @@ class Import(Builtin):
= ...
#> Import["ExampleData/Middlemarch.txt"];
: An invalid unicode sequence was encountered and ignored.
#> StringTake[Import["ExampleData/Middlemarch.txt", CharacterEncoding -> "ISO8859-1"], {21, 69}]
= Le sentiment de la fausseté des plaisirs présents

## JSON
>> Import["ExampleData/colors.json"]
Expand Down
5 changes: 2 additions & 3 deletions mathics/builtin/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

from mathics.version import __version__ # noqa used in loading to check consistency.
from mathics.builtin.base import Builtin
from mathics.core.expression import Expression, Integer, Number, from_python
from mathics.core.convert import sympy_symbol_prefix, SympyExpression, from_sympy
from mathics.core.rules import Pattern
from mathics.core.expression import Expression, from_python
from mathics.core.convert import from_sympy

import sympy

Expand Down
2 changes: 2 additions & 0 deletions mathics/builtin/tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
In mathematics, a tensor is an algebraic object that describes a (multilinear) relationship between sets of algebraic objects related to a vector space. Objects that tensors may map between include vectors and scalars, and even other tensors.

There are many types of tensors, including scalars and vectors (which are the simplest tensors), dual vectors, multilinear maps between vector spaces, and even some operations such as the dot product. Tensors are defined independent of any basis, although they are often referred to by their components in a basis related to a particular coordinate system.

Mathics represents tensors of vectors and matrices as lists; tensors of any rank can be handled.
"""

from mathics.version import __version__ # noqa used in loading to check consistency.
Expand Down
5 changes: 4 additions & 1 deletion mathics/docpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ def fail(why):
f"""{sep}Test failed: {section} in {part} / {chapter}
{part}
n{why}
""".encode("utf-8"))
""".encode(
"utf-8"
)
)
return False

if not quiet:
Expand Down
14 changes: 14 additions & 0 deletions test/test_importexport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
from .helper import check_evaluation


def test_import():
eaccent = "\xe9"
for str_expr, str_expected, message in (
(
"""StringTake[Import["ExampleData/Middlemarch.txt", CharacterEncoding -> "ISO8859-1"], {49, 69}]""",
f"des plaisirs pr{eaccent}sents",
"accented characters in Import"
),
):
check_evaluation(str_expr, str_expected, message)