Skip to content

Add a more powerful pre-processing before parsing doctypes #114

@lagru

Description

@lagru

After talking with @glemaitre on what scikit-learn might need to make use of docstub, we had the idea to allow users to to regex substitution on doctests.

This would be useful to address the following doctype that scikit-learn is using in many places:

{array-like, sparse matrix} of shape (n_samples, n_features)

This should be translated to

array-like of shape (n_samples, n_features) | sparse-matrix of shape (n_samples, n_features)

which could be done with regex substitution and capture groups.

Another way would be to define a proper union type that combines array-like | sparse-matrix but we weren't sure how that should be named to be still expressive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or functionalityimportantImportant or blocking other issues

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions