Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8acf99b

Browse filesBrowse files
committed
Workaround to prevent "reference target not found" errors in doc builds
This introduces a known blacklist of currently non-linkable items.
1 parent dfadce7 commit 8acf99b
Copy full SHA for 8acf99b

File tree

2 files changed

+50
-1
lines changed
Filter options

2 files changed

+50
-1
lines changed

‎doc/api/axis_api.rst

Copy file name to clipboardExpand all lines: doc/api/axis_api.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ XAxis Specific
181181
XAxis.get_text_heights
182182
XAxis.get_ticks_position
183183
XAxis.set_ticks_position
184+
XAxis.set_label_position
184185
XAxis.tick_bottom
185186
XAxis.tick_top
186187

@@ -197,6 +198,7 @@ YAxis Specific
197198
YAxis.get_ticks_position
198199
YAxis.set_offset_position
199200
YAxis.set_ticks_position
201+
YAxis.set_label_position
200202
YAxis.tick_left
201203
YAxis.tick_right
202204

@@ -264,4 +266,5 @@ specify a matching series of labels. Calling ``set_ticks`` makes a
264266
Tick.set_label1
265267
Tick.set_label2
266268
Tick.set_pad
269+
Tick.set_url
267270
Tick.update_position

‎lib/matplotlib/artist.py

Copy file name to clipboardExpand all lines: lib/matplotlib/artist.py
+47-1Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,46 @@ def aliased_name(self, s):
14391439
aliases = ''.join(' or %s' % x for x in sorted(self.aliasd.get(s, [])))
14401440
return s + aliases
14411441

1442+
_NOT_LINKABLE = {
1443+
# A set of property setter methods that are not available in our
1444+
# current docs. This is a workaround used to prevent trying to link
1445+
# these setters which would lead to "target reference not found"
1446+
# warnings during doc build.
1447+
'matplotlib.image._ImageBase.set_alpha',
1448+
'matplotlib.image._ImageBase.set_array',
1449+
'matplotlib.image._ImageBase.set_data',
1450+
'matplotlib.image._ImageBase.set_filternorm',
1451+
'matplotlib.image._ImageBase.set_filterrad',
1452+
'matplotlib.image._ImageBase.set_interpolation',
1453+
'matplotlib.image._ImageBase.set_resample',
1454+
'matplotlib.image._ImageBase.set_alpha',
1455+
'matplotlib.image._ImageBase.set_array',
1456+
'matplotlib.image._ImageBase.set_data',
1457+
'matplotlib.image._ImageBase.set_filternorm',
1458+
'matplotlib.image._ImageBase.set_filterrad',
1459+
'matplotlib.image._ImageBase.set_interpolation',
1460+
'matplotlib.image._ImageBase.set_resample',
1461+
'matplotlib.image._ImageBase.set_alpha',
1462+
'matplotlib.image._ImageBase.set_array',
1463+
'matplotlib.image._ImageBase.set_filternorm',
1464+
'matplotlib.image._ImageBase.set_filterrad',
1465+
'matplotlib.image._ImageBase.set_interpolation',
1466+
'matplotlib.image._ImageBase.set_resample',
1467+
'matplotlib.image._ImageBase.set_alpha',
1468+
'matplotlib.image._ImageBase.set_array',
1469+
'matplotlib.image._ImageBase.set_filternorm',
1470+
'matplotlib.image._ImageBase.set_filterrad',
1471+
'matplotlib.image._ImageBase.set_resample',
1472+
'matplotlib.image._ImageBase.set_alpha',
1473+
'matplotlib.image._ImageBase.set_array',
1474+
'matplotlib.image._ImageBase.set_filternorm',
1475+
'matplotlib.image._ImageBase.set_filterrad',
1476+
'matplotlib.image._ImageBase.set_interpolation',
1477+
'matplotlib.image._ImageBase.set_resample',
1478+
'matplotlib.text._AnnotationBase.set_annotation_clip',
1479+
'matplotlib.text._AnnotationBase.set_annotation_clip',
1480+
}
1481+
14421482
def aliased_name_rest(self, s, target):
14431483
"""
14441484
Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME',
@@ -1448,6 +1488,10 @@ def aliased_name_rest(self, s, target):
14481488
alias, return 'markerfacecolor or mfc' and for the transform
14491489
property, which does not, return 'transform'.
14501490
"""
1491+
# workaround to prevent "reference target not found"
1492+
if target in self._NOT_LINKABLE:
1493+
return f'``{s}``'
1494+
14511495
aliases = ''.join(' or %s' % x for x in sorted(self.aliasd.get(s, [])))
14521496
return ':meth:`%s <%s>`%s' % (s, target, aliases)
14531497

@@ -1501,6 +1545,8 @@ def pprint_setters_rest(self, prop=None, leadingspace=4):
15011545
break
15021546
else: # No docstring available.
15031547
method = getattr(self.o, f"set_{prop}")
1548+
if method.__qualname__.startswith('_'):
1549+
print(method.__qualname__)
15041550
prop_and_qualnames.append(
15051551
(prop, f"{method.__module__}.{method.__qualname__}"))
15061552

@@ -1708,7 +1754,7 @@ def kwdoc(artist):
17081754
"""
17091755
ai = ArtistInspector(artist)
17101756
return ('\n'.join(ai.pprint_setters_rest(leadingspace=4))
1711-
if mpl.rcParams['docstring.hardcopy'] else
1757+
if mpl.rcParams['docstring.hardcopy'] or True else
17121758
'Properties:\n' + '\n'.join(ai.pprint_setters(leadingspace=4)))
17131759

17141760
# We defer this to the end of them module, because it needs ArtistInspector

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.