summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Polley <rypolley+github@gmail.com>2021-01-30 10:50:12 -0600
committerGitHub <noreply@github.com>2021-01-30 17:50:12 +0100
commit48808e1a6a775283b2d482d65f93390ddeb534af (patch)
tree694a556d542d0286dd0fd2402440887c5d853fbd
parent11c2c1e4fcd131154d7aaf8bf25bd779bf67ce35 (diff)
downloadnumpy-48808e1a6a775283b2d482d65f93390ddeb534af.tar.gz
DOC: replace 'this platform' with the actual platform in the scalar type documentation (#18085)
In the scalar documentation it's unclear that 'this platform' refers to the platform that the doc build job ran on, so replace it with the name of the platform using python's platform module
-rw-r--r--numpy/core/_add_newdocs_scalars.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/core/_add_newdocs_scalars.py b/numpy/core/_add_newdocs_scalars.py
index b9b151224..d31f0037d 100644
--- a/numpy/core/_add_newdocs_scalars.py
+++ b/numpy/core/_add_newdocs_scalars.py
@@ -6,6 +6,7 @@ platform-dependent information.
from numpy.core import dtype
from numpy.core import numerictypes as _numerictypes
from numpy.core.function_base import add_newdoc
+import platform
##############################################################################
#
@@ -49,6 +50,8 @@ possible_aliases = numeric_type_aliases([
])
+
+
def add_newdoc_for_scalar_type(obj, fixed_aliases, doc):
# note: `:field: value` is rST syntax which renders as field lists.
o = getattr(_numerictypes, obj)
@@ -56,7 +59,7 @@ def add_newdoc_for_scalar_type(obj, fixed_aliases, doc):
character_code = dtype(o).char
canonical_name_doc = "" if obj == o.__name__ else ":Canonical name: `numpy.{}`\n ".format(obj)
alias_doc = ''.join(":Alias: `numpy.{}`\n ".format(alias) for alias in fixed_aliases)
- alias_doc += ''.join(":Alias on this platform: `numpy.{}`: {}.\n ".format(alias, doc)
+ alias_doc += ''.join(":Alias on this platform ({} {}): `numpy.{}`: {}.\n ".format(platform.system(), platform.machine(), alias, doc)
for (alias_type, alias, doc) in possible_aliases if alias_type is o)
docstring = """
{doc}