@@ -1439,6 +1439,46 @@ def aliased_name(self, s):
1439
1439
aliases = '' .join (' or %s' % x for x in sorted (self .aliasd .get (s , [])))
1440
1440
return s + aliases
1441
1441
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
+
1442
1482
def aliased_name_rest (self , s , target ):
1443
1483
"""
1444
1484
Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME',
@@ -1448,6 +1488,10 @@ def aliased_name_rest(self, s, target):
1448
1488
alias, return 'markerfacecolor or mfc' and for the transform
1449
1489
property, which does not, return 'transform'.
1450
1490
"""
1491
+ # workaround to prevent "reference target not found"
1492
+ if target in self ._NOT_LINKABLE :
1493
+ return f'``{ s } ``'
1494
+
1451
1495
aliases = '' .join (' or %s' % x for x in sorted (self .aliasd .get (s , [])))
1452
1496
return ':meth:`%s <%s>`%s' % (s , target , aliases )
1453
1497
@@ -1501,6 +1545,8 @@ def pprint_setters_rest(self, prop=None, leadingspace=4):
1501
1545
break
1502
1546
else : # No docstring available.
1503
1547
method = getattr (self .o , f"set_{ prop } " )
1548
+ if method .__qualname__ .startswith ('_' ):
1549
+ print (method .__qualname__ )
1504
1550
prop_and_qualnames .append (
1505
1551
(prop , f"{ method .__module__ } .{ method .__qualname__ } " ))
1506
1552
@@ -1708,7 +1754,7 @@ def kwdoc(artist):
1708
1754
"""
1709
1755
ai = ArtistInspector (artist )
1710
1756
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
1712
1758
'Properties:\n ' + '\n ' .join (ai .pprint_setters (leadingspace = 4 )))
1713
1759
1714
1760
# We defer this to the end of them module, because it needs ArtistInspector
0 commit comments