Skip to content

Commit 3fb1302

Browse files
authored
Merge pull request #1446 from mathics/doc-fixes
Address misc doc issues
2 parents 4924b68 + ae89180 commit 3fb1302

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

mathics/builtin/compilation.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# -*- coding: utf-8 -*-
2+
"""Code Compilation
3+
4+
Code compilation allows Mathics functions to be run faster.
5+
6+
When LLVM and Python libraries are available, compilation produces LLVM code.
7+
"""
8+
29

310
import ctypes
411

@@ -21,9 +28,10 @@
2128
class Compile(Builtin):
2229
"""
2330
<dl>
24-
<dt>'Compile[{$x1$, $x2$, ...}, $expr$]'
31+
<dt>'Compile[{$x1$, $x2$, ...}, $expr$]'
2532
<dd>Compiles $expr$ assuming each $xi$ is a $Real$ number.
26-
<dt>'Compile[{{$x1$, $t1$} {$x2$, $t1$} ...}, $expr$]'
33+
34+
<dt>'Compile[{{$x1$, $t1$} {$x2$, $t1$} ...}, $expr$]'
2735
<dd>Compiles assuming each $xi$ matches type $ti$.
2836
</dl>
2937

mathics/builtin/numeric.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,11 +1187,9 @@ def test(expr):
11871187

11881188

11891189
class RealValuedNumericQ(Builtin):
1190-
"""
1191-
#> Internal`RealValuedNumericQ /@ {1, N[Pi], 1/2, Sin[1.], Pi, 3/4, aa, I}
1192-
= {True, True, True, True, True, True, False, False}
1193-
"""
1194-
1190+
# No docstring since this is internal and it will mess up documentation.
1191+
# FIXME: Perhaps in future we will have a more explicite way to indicate not
1192+
# to add something to the docs.
11951193
context = "Internal`"
11961194

11971195
rules = {
@@ -1200,11 +1198,9 @@ class RealValuedNumericQ(Builtin):
12001198

12011199

12021200
class RealValuedNumberQ(Builtin):
1203-
"""
1204-
#> Internal`RealValuedNumberQ /@ {1, N[Pi], 1/2, Sin[1.], Pi, 3/4, aa, I}
1205-
= {True, True, True, True, False, True, False, False}
1206-
"""
1207-
1201+
# No docstring since this is internal and it will mess up documentation.
1202+
# FIXME: Perhaps in future we will have a more explicite way to indicate not
1203+
# to add something to the docs.
12081204
context = "Internal`"
12091205

12101206
rules = {

test/test_numeric.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
from .helper import check_evaluation
33

44

5+
def test_realvalued():
6+
for str_expr, str_expected in (
7+
(
8+
"Internal`RealValuedNumberQ /@ {1, N[Pi], 1/2, Sin[1.], Pi, 3/4, aa, I}",
9+
"{True, True, True, True, False, True, False, False}",
10+
),
11+
(
12+
"Internal`RealValuedNumericQ /@ {1, N[Pi], 1/2, Sin[1.], Pi, 3/4, aa, I}",
13+
"{True, True, True, True, True, True, False, False}",
14+
),
15+
):
16+
check_evaluation(str_expr, str_expected)
17+
18+
519
def test_realdigits():
620
for str_expr, str_expected in (
721
(

0 commit comments

Comments
 (0)