Skip to content

Commit

Permalink
MNT Warns when reference can not be found. (#13365)
Browse files Browse the repository at this point in the history
* DOC Adds term to column_transformer

* DOC Adjusts sphinx resolution

* DEV Adds comment

* ENH Uses python instead of css
  • Loading branch information
thomasjpfan authored and adrinjalali committed Mar 3, 2019
1 parent 0e9520b commit eeaaf94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion doc/sphinxext/custom_references_resolver.py
Expand Up @@ -54,7 +54,20 @@ def resolve_anyref(self, refdoc, node, contnode):
if py_ref:
return self.create_node(py_ref[0])

# next, do the standard domain (makes this a priority)
# resolve :term:
term_ref = stddomain.resolve_xref(self.env, refdoc, self.app.builder,
'term', target, node, contnode)
if term_ref:
# replace literal nodes with inline nodes
if not isinstance(term_ref[0], nodes.inline):
inline_node = nodes.inline(rawsource=term_ref[0].rawsource,
classes=term_ref[0].get('classes'))
if term_ref[0]:
inline_node.append(term_ref[0][0])
term_ref[0] = inline_node
return self.create_node(("std:term", term_ref))

# next, do the standard domain
std_ref = stddomain.resolve_any_xref(
self.env, refdoc, self.app.builder, target, node, contnode)
if std_ref:
Expand All @@ -77,6 +90,8 @@ def resolve_anyref(self, refdoc, node, contnode):
result = ('%s:%s' % (domain.name, role), res)
return self.create_node(result)

self.warn_missing_reference(refdoc, 'any', target, node, domain)

# no results considered to be <code>
contnode['classes'] = []
return contnode
Expand Down
4 changes: 2 additions & 2 deletions sklearn/compose/_column_transformer.py
Expand Up @@ -81,7 +81,7 @@ class ColumnTransformer(_BaseComposition, TransformerMixin):
the transformers.
By setting ``remainder`` to be an estimator, the remaining
non-specified columns will use the ``remainder`` estimator. The
estimator must support `fit` and `transform`.
estimator must support :term:`fit` and :term:`transform`.
sparse_threshold : float, default = 0.3
If the output of the different transformers contains sparse matrices,
Expand Down Expand Up @@ -759,7 +759,7 @@ def make_column_transformer(*transformers, **kwargs):
the transformers.
By setting ``remainder`` to be an estimator, the remaining
non-specified columns will use the ``remainder`` estimator. The
estimator must support `fit` and `transform`.
estimator must support :term:`fit` and :term:`transform`.
sparse_threshold : float, default = 0.3
If the transformed output consists of a mix of sparse and dense data,
Expand Down

0 comments on commit eeaaf94

Please sign in to comment.