| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,4 +7,20 @@ | |||
| 7 | 7 | :undoc-members: | |
| 8 | 8 | :show-inheritance: | |
| 9 | 9 | ||
| 10 | - .. include:: scalarmappable.gen_rst | ||
| 10 | + .. class:: ScalarMappable(colorizer, **kwargs) | ||
| 11 | + :canonical: matplotlib.colorizer._ScalarMappable | ||
| 12 | + | ||
| 13 | + .. automethod:: autoscale | ||
| 14 | + .. automethod:: autoscale_None | ||
| 15 | + .. automethod:: changed | ||
| 16 | + .. autoproperty:: colorbar | ||
| 17 | + .. automethod:: get_alpha | ||
| 18 | + .. automethod:: get_array | ||
| 19 | + .. automethod:: get_clim | ||
| 20 | + .. automethod:: get_cmap | ||
| 21 | + .. autoproperty:: norm | ||
| 22 | + .. automethod:: set_array | ||
| 23 | + .. automethod:: set_clim | ||
| 24 | + .. automethod:: set_cmap | ||
| 25 | + .. automethod:: set_norm | ||
| 26 | + .. automethod:: to_rgba | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -837,58 +837,6 @@ def linkcode_resolve(domain, info): | |||
| 837 | 837 | extensions.append('sphinx.ext.viewcode') | |
| 838 | 838 | ||
| 839 | 839 | ||
| 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 | - | ||
| 892 | 840 | # ----------------------------------------------------------------------------- | |
| 893 | 841 | # Sphinx setup | |
| 894 | 842 | # ----------------------------------------------------------------------------- | |
@@ -902,5 +850,4 @@ def setup(app): | |||
| 902 | 850 | app.connect('autodoc-process-bases', autodoc_process_bases) | |
| 903 | 851 | if sphinx.version_info[:2] < (7, 1): | |
| 904 | 852 | app.connect('html-page-context', add_html_cache_busting, priority=1000) | |
| 905 | - generate_ScalarMappable_docs() | ||
| 906 | 853 | app.config.autodoc_use_legacy_class_based = True | |
| Back | FazBrowse Home | New Git URL |
0 commit comments