25
25
else :
26
26
ASTROPY_INSTALLED = True
27
27
28
+ from astropy .utils import minversion
29
+
28
30
29
31
# -- General configuration ----------------------------------------------------
30
32
@@ -107,10 +109,9 @@ def check_sphinx_version(expected_version):
107
109
# parameter type descriptions that may be confused for classes of the same
108
110
# name. This can be overwritten or modified in packages and is provided here for
109
111
# convenience.
110
- numpydoc_xref_ignore = {
111
- "type" , "optional" , "default" , "or" , "of" , "method" , "instance" ,
112
- "class" , "subclass" , "keyword-only" , "default" , "thereof" ,
113
- }
112
+ numpydoc_xref_ignore = {"or" , "of" , "thereof" ,
113
+ "default" , "optional" , "keyword-only" ,
114
+ "instance" , "type" , "class" , "subclass" , "method" }
114
115
115
116
# Mappings to fully qualified paths (or correct ReST references) for the
116
117
# aliases/shortcuts used when specifying the types of parameters.
@@ -126,8 +127,8 @@ def check_sphinx_version(expected_version):
126
127
# Aliases to Astropy's glossary. In packages these can be turned on with
127
128
# ``numpydoc_xref_aliases.update(numpydoc_xref_aliases_astropy_glossary)``
128
129
# (if astropy is in the intersphinx mapping).
129
- numpydoc_xref_aliases_astropy_glossary = {} # works even if older Astropy
130
- if ASTROPY_INSTALLED and float (astropy . __version__ [: 3 ]) >= 4.3 :
130
+ numpydoc_xref_aliases_astropy_glossary = {} # works even if no Astropy
131
+ if ASTROPY_INSTALLED and minversion (astropy , " 4.3" ) :
131
132
numpydoc_xref_aliases_astropy_glossary = {
132
133
# general
133
134
"-like" : ":term:`astropy:-like`" ,
@@ -147,8 +148,8 @@ def check_sphinx_version(expected_version):
147
148
# Aliases to Astropy's physical types. In packages these can be turned on with
148
149
# ``numpydoc_xref_aliases.update(numpydoc_xref_aliases_astropy_physical_type)``
149
150
# (if astropy is in the intersphinx mapping).
150
- numpydoc_xref_aliases_astropy_physical_type = {} # works even if older astropy
151
- if ASTROPY_INSTALLED and float (astropy . __version__ [: 3 ]) >= 4.3 :
151
+ numpydoc_xref_aliases_astropy_physical_type = {} # works even if no astropy
152
+ if ASTROPY_INSTALLED and minversion (astropy , " 4.3" ) :
152
153
153
154
from astropy .units .physical import _name_physical_mapping
154
155
for ptype in _name_physical_mapping .keys ():
0 commit comments