Skip to content

Commit 33b37df

Browse files
authored
tweaks
1 parent c3861a7 commit 33b37df

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ checks = [
293293
"all", # report on all checks, except the below
294294
"EX01", # most docstrings do not need an example
295295
"SA01", # data-apis/array-api-extra#87
296-
"SA04", # Missing description for See Also cross-reference
297296
"ES01", # most docstrings do not need an extended summary
298297
]
299298
exclude = [ # don't report on objects that match any of these regex

src/array_api_extra/_delegation.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ def isclose(
4343
Return a boolean array where two arrays are element-wise equal within a tolerance.
4444
4545
The tolerance values are positive, typically very small numbers. The relative
46-
difference `(rtol * abs(b))` and the absolute difference atol are added together to
47-
compare against the absolute difference between a and b.
46+
difference ``(rtol * abs(b))`` and the absolute difference `atol` are added together to
47+
compare against the absolute difference between `a` and `b`.
4848
49-
NaNs are treated as equal if they are in the same place and if equal_nan=True. Infs
49+
NaNs are treated as equal if they are in the same place and if ``equal_nan=True``. Infs
5050
are treated as equal if they are in the same place and of the same sign in both
5151
arrays.
5252
@@ -67,17 +67,17 @@ def isclose(
6767
Returns
6868
-------
6969
Array
70-
A boolean array of shape broadcasted from `a` and `b`, containing `True` where
71-
``a`` is close to ``b``, and `False` otherwise.
70+
A boolean array of shape broadcasted from `a` and `b`, containing ``True`` where
71+
`a` is close to `b`, and ``False`` otherwise.
7272
7373
Warnings
7474
--------
75-
The default atol is not appropriate for comparing numbers with magnitudes much
76-
smaller than one ) (see notes).
75+
The default `atol` is not appropriate for comparing numbers with magnitudes much
76+
smaller than one (see notes).
7777
7878
See Also
7979
--------
80-
math.isclose
80+
math.isclose : Similar function in stdlib for Python scalars.
8181
8282
Notes
8383
-----
@@ -86,22 +86,22 @@ def isclose(
8686
8787
absolute(a - b) <= (atol + rtol * absolute(b))
8888
89-
Unlike the built-in `math.isclose`, the above equation is not symmetric in a and b,
90-
so that `isclose(a, b)` might be different from `isclose(b, a)` in some rare
89+
Unlike the built-in `math.isclose`, the above equation is not symmetric in `a` and `b`,
90+
so that ``isclose(a, b)`` might be different from ``isclose(b, a)`` in some rare
9191
cases.
9292
9393
The default value of `atol` is not appropriate when the reference value `b` has
9494
magnitude smaller than one. For example, it is unlikely that ``a = 1e-9`` and
95-
``b = 2e-9`` should be considered "close", yet ``isclose(1e-9, 2e-9)`` is `True`
96-
with default settings. Be sure to select atol for the use case at hand, especially
95+
``b = 2e-9`` should be considered "close", yet ``isclose(1e-9, 2e-9)`` is ``True``
96+
with default settings. Be sure to select `atol` for the use case at hand, especially
9797
for defining the threshold below which a non-zero value in `a` will be considered
9898
"close" to a very small or zero value in `b`.
9999
100100
The comparison of `a` and `b` uses standard broadcasting, which means that `a` and
101-
`b` need not have the same shape in order for `isclose(a, b)` to evaluate to
102-
`True`.
101+
`b` need not have the same shape in order for ``isclose(a, b)`` to evaluate to
102+
``True``.
103103
104-
`isclose` is not defined for non-numeric data types. `bool` is considered a numeric
104+
`isclose` is not defined for non-numeric data types. ``bool`` is considered a numeric
105105
data-type for this purpose.
106106
"""
107107
xp = array_namespace(a, b) if xp is None else xp

src/array_api_extra/_lib/_testing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def xp_assert_equal(actual: Array, desired: Array, err_msg: str = "") -> None:
7474
7575
See Also
7676
--------
77-
xp_assert_close
78-
numpy.testing.assert_array_equal
77+
xp_assert_close : Similar function for inexact equality checks.
78+
numpy.testing.assert_array_equal : Similar function for NumPy arrays.
7979
"""
8080
xp = _check_ns_shape_dtype(actual, desired)
8181

@@ -130,9 +130,9 @@ def xp_assert_close(
130130
131131
See Also
132132
--------
133-
xp_assert_equal
134-
isclose
135-
numpy.testing.assert_allclose
133+
xp_assert_equal : Similar function for exact equality checks.
134+
isclose : Public function for checking closeness.
135+
numpy.testing.assert_allclose : Similar function for NumPy arrays.
136136
137137
Notes
138138
-----

0 commit comments

Comments
 (0)