From 8cdfe142202c62a28f8bdd8bbd0d33e964d42ab8 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Thu, 1 Oct 2020 10:55:26 -0400 Subject: [PATCH] update inheritance diagrams (#1248) * update inheritance diagrams * update release notes * fix layout * fix release notes * fix docs Co-authored-by: bchen1116 --- docs/source/_static/style.css | 9 +-------- docs/source/_templates/class.rst | 7 +++++-- docs/source/_templates/class_with_properties.rst | 7 +++++-- docs/source/_templates/data_check_class.rst | 7 +++++-- docs/source/_templates/data_check_message.rst | 7 +++++-- docs/source/_templates/estimator_class.rst | 7 +++++-- docs/source/_templates/pipeline_base_class.rst | 7 +++++-- docs/source/_templates/pipeline_class.rst | 7 +++++-- docs/source/_templates/transformer_class.rst | 7 +++++-- docs/source/conf.py | 5 +++-- docs/source/release_notes.rst | 1 + 11 files changed, 45 insertions(+), 26 deletions(-) diff --git a/docs/source/_static/style.css b/docs/source/_static/style.css index b54f5b9d95..7753ce9fab 100644 --- a/docs/source/_static/style.css +++ b/docs/source/_static/style.css @@ -1,11 +1,4 @@ div.graphviz { overflow: auto; - max-width: 620px; - max-height: 50px; - text-align: center; + text-align: left; } - -img.inheritance { - max-width: none; - max-height: 30px; -} diff --git a/docs/source/_templates/class.rst b/docs/source/_templates/class.rst index 26e6910d0f..bdad721dc8 100644 --- a/docs/source/_templates/class.rst +++ b/docs/source/_templates/class.rst @@ -2,8 +2,6 @@ .. currentmodule:: {{ module }} -.. inheritance-diagram:: {{ objname }} - .. autoclass:: {{ objname }} {% block methods %} {% if methods %} @@ -18,3 +16,8 @@ {%- endfor %} {% endif %} {% endblock %} + +Class Inheritance +""""""""""""""""" + +.. inheritance-diagram:: {{ objname }} diff --git a/docs/source/_templates/class_with_properties.rst b/docs/source/_templates/class_with_properties.rst index 4617a1aed3..cb5761695e 100644 --- a/docs/source/_templates/class_with_properties.rst +++ b/docs/source/_templates/class_with_properties.rst @@ -2,8 +2,6 @@ .. currentmodule:: {{ module }} -.. inheritance-diagram:: {{ objname }} - .. autoclass:: {{ objname }} {% block methods %} {% if methods %} @@ -29,3 +27,8 @@ ~{{ name }}.{{ item }} {%- endfor %} {% endblock %} + +Class Inheritance +""""""""""""""""" + +.. inheritance-diagram:: {{ objname }} diff --git a/docs/source/_templates/data_check_class.rst b/docs/source/_templates/data_check_class.rst index d59021c259..6a0e10ae40 100644 --- a/docs/source/_templates/data_check_class.rst +++ b/docs/source/_templates/data_check_class.rst @@ -2,8 +2,6 @@ .. currentmodule:: {{ module }} -.. inheritance-diagram:: {{ objname }} - .. autoclass:: {{ objname }} {% set class_attributes = ['name'] %} @@ -41,3 +39,8 @@ {%- endfor %} {% endif %} {% endblock %} + +Class Inheritance +""""""""""""""""" + +.. inheritance-diagram:: {{ objname }} diff --git a/docs/source/_templates/data_check_message.rst b/docs/source/_templates/data_check_message.rst index 59dbfb885d..7db0811ca1 100644 --- a/docs/source/_templates/data_check_message.rst +++ b/docs/source/_templates/data_check_message.rst @@ -2,8 +2,6 @@ .. currentmodule:: {{ module }} -.. inheritance-diagram:: {{ objname }} - .. autoclass:: {{ objname }} {% set class_attributes = ['message_type'] %} {% set special_methods = ['__str__', '__eq__'] %} @@ -34,3 +32,8 @@ {%- endfor %} {% endif %} {% endblock %} + +Class Inheritance +""""""""""""""""" + +.. inheritance-diagram:: {{ objname }} diff --git a/docs/source/_templates/estimator_class.rst b/docs/source/_templates/estimator_class.rst index 727a23a5b1..2fd4a5faf9 100644 --- a/docs/source/_templates/estimator_class.rst +++ b/docs/source/_templates/estimator_class.rst @@ -2,8 +2,6 @@ .. currentmodule:: {{ module }} -.. inheritance-diagram:: {{ objname }} - .. autoclass:: {{ objname }} {% set class_attributes = ['name', 'model_family', 'hyperparameter_ranges', 'supported_problem_types', 'default_parameters'] %} @@ -43,3 +41,8 @@ {%- endfor %} {% endif %} {% endblock %} + +Class Inheritance +""""""""""""""""" + +.. inheritance-diagram:: {{ objname }} diff --git a/docs/source/_templates/pipeline_base_class.rst b/docs/source/_templates/pipeline_base_class.rst index d74a2dba30..eef208688e 100644 --- a/docs/source/_templates/pipeline_base_class.rst +++ b/docs/source/_templates/pipeline_base_class.rst @@ -2,8 +2,6 @@ .. currentmodule:: {{ module }} -.. inheritance-diagram:: {{ objname }} - .. autoclass:: {{ objname }} {% set class_attributes = ['name', 'custom_name', 'summary', 'component_graph', 'problem_type', 'model_family', 'hyperparameters', 'custom_hyperparameters', @@ -45,3 +43,8 @@ {%- endfor %} {% endif %} {% endblock %} + +Class Inheritance +""""""""""""""""" + +.. inheritance-diagram:: {{ objname }} diff --git a/docs/source/_templates/pipeline_class.rst b/docs/source/_templates/pipeline_class.rst index 049a4e0285..bed8f08cd3 100644 --- a/docs/source/_templates/pipeline_class.rst +++ b/docs/source/_templates/pipeline_class.rst @@ -2,8 +2,6 @@ .. currentmodule:: {{ module }} -.. inheritance-diagram:: {{ objname }} - .. autoclass:: {{ objname }} {% set class_attributes = ['name', 'custom_name', 'summary', 'component_graph', 'problem_type', 'model_family', 'hyperparameters', 'custom_hyperparameters', @@ -50,3 +48,8 @@ {%- endfor %} {% endif %} {% endblock %} + +Class Inheritance +""""""""""""""""" + +.. inheritance-diagram:: {{ objname }} diff --git a/docs/source/_templates/transformer_class.rst b/docs/source/_templates/transformer_class.rst index 6b421ff3a4..6f2d7a0784 100644 --- a/docs/source/_templates/transformer_class.rst +++ b/docs/source/_templates/transformer_class.rst @@ -2,8 +2,6 @@ .. currentmodule:: {{ module }} -.. inheritance-diagram:: {{ objname }} - .. autoclass:: {{ objname }} {% set class_attributes = ['name', 'model_family', 'hyperparameter_ranges', 'default_parameters'] %} @@ -42,3 +40,8 @@ {%- endfor %} {% endif %} {% endblock %} + +Class Inheritance +""""""""""""""""" + +.. inheritance-diagram:: {{ objname }} diff --git a/docs/source/conf.py b/docs/source/conf.py index 6961e9d60a..097b42a863 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -214,8 +214,9 @@ nbsphinx_execute = 'always' nbsphinx_timeout = 600 # sphinx defaults each cell to 30 seconds so we need to override here -inheritance_graph_attrs = dict(rankdir="LR", size='"1000, 333"', - fontsize=30, labelfontsize=30, ratio='compress', dpi=960) +inheritance_graph_attrs = dict(rankdir="TB", dpi=192.0, ranksep=0.02) +inheritance_node_attrs = dict(fontsize=6, height=0.15, width=5, fixedsize=True) +inheritance_edge_attrs = dict(arrowsize=0.1) class AccessorLevelDocumenter(Documenter): """ diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index bb171c0e5a..9c8c4b5887 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -9,6 +9,7 @@ Release Notes * Documentation Changes * Fixed and updated code blocks in Release Notes :pr:`1243` * Added DecisionTree estimators to API Reference :pr:`1246` + * Changed class inheritance display to flow vertically :pr:`1248` * Testing Changes