Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove OrderedDict #85

Merged
merged 1 commit into from
Jan 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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