Skip to content

Commit

Permalink
Merge pull request #85 from Chilipp/dict
Browse files Browse the repository at this point in the history
remove OrderedDict
  • Loading branch information
Chilipp authored Jan 15, 2023
2 parents e06ce19 + 12a335c commit bbf5052
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions autodocsumm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ def force_decode(string: str, encoding: str) -> str:
return string


try:
from cyordereddict import OrderedDict
except ImportError:
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict

from . import _version
__version__ = _version.get_versions()['version']

Expand Down Expand Up @@ -262,7 +254,7 @@ def get_grouped_documenters(self, all_members=False):
except AttributeError: # sphinx<3.0
pass

documenters = OrderedDict()
documenters = {}
for e in memberdocumenters:
section = self.member_sections.get(
e[0].member_order, 'Miscellaneous')
Expand Down Expand Up @@ -350,13 +342,13 @@ class AutoSummModuleDocumenter(ModuleDocumenter, AutosummaryDocumenter):
option_spec['autosummary-' + _option] = option_spec[_option]
del _option

member_sections = OrderedDict([
(ad.ClassDocumenter.member_order, 'Classes'),
(ad.ExceptionDocumenter.member_order, 'Exceptions'),
(ad.FunctionDocumenter.member_order, 'Functions'),
(ad.DataDocumenter.member_order, 'Data'),
])
""":class:`~collections.OrderedDict` that includes the autosummary sections
member_sections = {
ad.ClassDocumenter.member_order: 'Classes',
ad.ExceptionDocumenter.member_order: 'Exceptions',
ad.FunctionDocumenter.member_order: 'Functions',
ad.DataDocumenter.member_order: 'Data',
}
""":class:`dict` that includes the autosummary sections
This dictionary defines the sections for the autosummmary option. The
values correspond to the :attr:`sphinx.ext.autodoc.Documenter.member_order`
Expand Down Expand Up @@ -400,12 +392,12 @@ class AutoSummClassDocumenter(ClassDocumenter, AutosummaryDocumenter):
option_spec['autosummary-' + _option] = option_spec[_option]
del _option

member_sections = OrderedDict([
(ad.ClassDocumenter.member_order, 'Classes'),
(ad.MethodDocumenter.member_order, 'Methods'),
(ad.AttributeDocumenter.member_order, 'Attributes'),
])
""":class:`~collections.OrderedDict` that includes the autosummary sections
member_sections = {
ad.ClassDocumenter.member_order: 'Classes',
ad.MethodDocumenter.member_order: 'Methods',
ad.AttributeDocumenter.member_order: 'Attributes',
}
""":class:`dict` that includes the autosummary sections
This dictionary defines the sections for the autosummmary option. The
values correspond to the :attr:`sphinx.ext.autodoc.Documenter.member_order`
Expand Down

0 comments on commit bbf5052

Please sign in to comment.