@@ -109,9 +109,17 @@ def check_sphinx_version(expected_version):
109
109
# aliases/shortcuts used when specifying the types of parameters.
110
110
# Numpy provides some defaults
111
111
# https://github.com/numpy/numpydoc/blob/b352cd7635f2ea7748722f410a31f937d92545cc/numpydoc/xref.py#L62-L94
112
- # numpydoc_xref_aliases = {}
112
+ numpydoc_xref_aliases = {
113
+ # Python terms
114
+ "function" : ":term:`python:function`" ,
115
+ "iterator" : ":term:`python:iterator`" ,
116
+ "mapping" : ":term:`python:mapping`" ,
117
+ }
113
118
114
- numpydoc_xref_aliases_astropy_physical_type = {}
119
+ # Aliases to Astropy's physical types. In packages these can be turned on with
120
+ # ``numpydoc_xref_aliases.update(numpydoc_xref_aliases_astropy_physical_type)``
121
+ # (if astropy is in the intersphinx mapping).
122
+ numpydoc_xref_aliases_astropy_physical_type = {} # works even if older astropy
115
123
if float (astropy .__version__ [:3 ]) >= 4.3 :
116
124
117
125
# TODO! refactor if #11678 is implemented
@@ -122,8 +130,8 @@ def check_sphinx_version(expected_version):
122
130
key = f"'{ ptype } '"
123
131
val = f":ref:`:ref: '{ ptype } ' <astropy:{ ptype } >`" # <= intersphinxed.
124
132
numpydoc_xref_aliases_astropy_physical_type [key ] = val
125
-
126
- del ptypes , key , val
133
+
134
+ del ptypes , key , val , _units_and_physical_types
127
135
128
136
# -- Project information ------------------------------------------------------
129
137
0 commit comments