@@ -837,58 +837,6 @@ def linkcode_resolve(domain, info):
837837 extensions .append ('sphinx.ext.viewcode' )
838838
839839
840- def generate_ScalarMappable_docs ():
841-
842- import matplotlib .colorizer
843- from numpydoc .docscrape_sphinx import get_doc_object
844- from pathlib import Path
845- import textwrap
846- from sphinx .util .inspect import stringify_signature
847- target_file = Path (__file__ ).parent / 'api' / 'scalarmappable.gen_rst'
848- with open (target_file , 'w' ) as fout :
849- fout .write ("""
850- .. class:: ScalarMappable(colorizer, **kwargs)
851- :canonical: matplotlib.colorizer._ScalarMappable
852-
853- """ )
854- for meth in [
855- matplotlib .colorizer ._ScalarMappable .autoscale ,
856- matplotlib .colorizer ._ScalarMappable .autoscale_None ,
857- matplotlib .colorizer ._ScalarMappable .changed ,
858- """
859- .. attribute:: colorbar
860-
861- The last colorbar associated with this ScalarMappable. May be None.
862- """ ,
863- matplotlib .colorizer ._ScalarMappable .get_alpha ,
864- matplotlib .colorizer ._ScalarMappable .get_array ,
865- matplotlib .colorizer ._ScalarMappable .get_clim ,
866- matplotlib .colorizer ._ScalarMappable .get_cmap ,
867- """
868- .. property:: norm
869- """ ,
870- matplotlib .colorizer ._ScalarMappable .set_array ,
871- matplotlib .colorizer ._ScalarMappable .set_clim ,
872- matplotlib .colorizer ._ScalarMappable .set_cmap ,
873- matplotlib .colorizer ._ScalarMappable .set_norm ,
874- matplotlib .colorizer ._ScalarMappable .to_rgba ,
875- ]:
876- if isinstance (meth , str ):
877- fout .write (meth )
878- else :
879- name = meth .__name__
880- sig = stringify_signature (inspect .signature (meth ))
881- docstring = textwrap .indent (
882- str (get_doc_object (meth )),
883- ' '
884- ).rstrip ()
885- fout .write (f"""
886- .. method:: { name } { sig }
887- { docstring }
888-
889- """ )
890-
891-
892840# -----------------------------------------------------------------------------
893841# Sphinx setup
894842# -----------------------------------------------------------------------------
@@ -902,5 +850,4 @@ def setup(app):
902850 app .connect ('autodoc-process-bases' , autodoc_process_bases )
903851 if sphinx .version_info [:2 ] < (7 , 1 ):
904852 app .connect ('html-page-context' , add_html_cache_busting , priority = 1000 )
905- generate_ScalarMappable_docs ()
906853 app .config .autodoc_use_legacy_class_based = True
0 commit comments