@@ -1439,6 +1439,21 @@ 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.text._AnnotationBase.set_annotation_clip' ,
1455+ }
1456+
14421457 def aliased_name_rest (self , s , target ):
14431458 """
14441459 Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME',
@@ -1448,6 +1463,10 @@ def aliased_name_rest(self, s, target):
14481463 alias, return 'markerfacecolor or mfc' and for the transform
14491464 property, which does not, return 'transform'.
14501465 """
1466+ # workaround to prevent "reference target not found"
1467+ if target in self ._NOT_LINKABLE :
1468+ return f'``{ s } ``'
1469+
14511470 aliases = '' .join (' or %s' % x for x in sorted (self .aliasd .get (s , [])))
14521471 return ':meth:`%s <%s>`%s' % (s , target , aliases )
14531472
0 commit comments