You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a more powerful pre-processing before parsing doctypes #114
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.
Activity
lagru commentedon Nov 4, 2026
The requested "pre-processing" should be possible now with the new plugin system from #130. 😊
I explicitly included an example in the plugin writing guide on how to implement an expansion expression like described above: Example: Expansion expression for qualnames.