Skip to content

Unify methods of the DocstringProcessor#19

Merged
Chilipp merged 20 commits intomasterfrom
unify-methods
Aug 26, 2020
Merged

Unify methods of the DocstringProcessor#19
Chilipp merged 20 commits intomasterfrom
unify-methods

Conversation

@Chilipp
Copy link
Owner

@Chilipp Chilipp commented Aug 26, 2020

This PR unifies how we name the various methods of the docstring processor. Multiple methods accept both, functions and strings

Changed

  • The following methods of the DocstringProcessor class have been deprecated:

    docstring update methods for strings:

    • dedents in favor of DocstringProcessor.dedent
    • with_indents in favor of DocstringProcessor.with_indent

    docstring analysis decorators

    • get_sectionsf in favor of DocstringProcessor.get_sections
    • get_summaryf in favor of DocstringProcessor.get_summary
    • get_full_descriptionf in favor of DocstringProcessor.get_full_description
    • get_extended_summaryf in favor of DocstringProcessor.get_extended_summary
    • save_docstring in favor of DocstringProcessorget_docstring

    docstring parameter and type extractors for strings

    • delete_params_s in favor of docrep.delete_params
    • delete_types_s in favor of docrep.delete_types
    • delete_kwargs_s in favor of docrep.delete_kwargs
    • keep_params_s in favor of docrep.keep_params
    • keep_types_s in favor of docrep.keep_types

Migrating from 0.2.8 to 0.3.0

Migration is possible using the following steps:

  • For the deprecated update methods,
    just use the above-mentioned replacement. They work for both, as
    decorators and with strings.
  • For the analysis decorators (get_sectionsf for instance, use the
    replacement) but you need to explicitly state the [base]{.title-ref}
    parameter. @get_sectionsf('something') for instance needs to be
    replaced with @get_sections(base='something')
  • for the parameter and type extractor functions, just use the
    corresponding module level function mentioned
    above

Chilipp added 18 commits July 10, 2020 14:59
this commit depreceates all methods ending with `f` (get_sectionsf for instance) or `_s` (keep_params_s for instance). Instead we use  overloaded functions that can be used as a decorator or with strings as input
and add new tests for deprecated functions
to ensure python 2.7 compatibility (for the last time...)
in favor of get_docstring
using the autosummary by autodocsumm
into on single decorator: deprecated
the call is now keep_params(s, *params), not anymore keep_params(s, params)
@Chilipp Chilipp self-assigned this Aug 26, 2020
@coveralls
Copy link

Coverage Status

Coverage decreased (-3.002%) to 93.333% when pulling e849ee2 on unify-methods into 6ae96d5 on master.

@Chilipp Chilipp merged commit 4c0d82d into master Aug 26, 2020
@Chilipp Chilipp deleted the unify-methods branch August 26, 2020 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants