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

pretty print fails for the RDKitAdaptor Featurizers. #375

Closed
kjappelbaum opened this issue Oct 3, 2022 · 0 comments · Fixed by #413
Closed

pretty print fails for the RDKitAdaptor Featurizers. #375

kjappelbaum opened this issue Oct 3, 2022 · 0 comments · Fixed by #413
Assignees
Milestone

Comments

@kjappelbaum
Copy link
Owner

Output exceeds the [size limit](command:workbench.action.openSettings?[). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?84ca2d1f-2fc2-41a4-826a-51ed8974db9b)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File ~/miniconda3/envs/mofdscribe/lib/python3.8/site-packages/IPython/core/formatters.py:973, in MimeBundleFormatter.__call__(self, obj, include, exclude)
    970     method = get_real_method(obj, self.print_method)
    972     if method is not None:
--> 973         return method(include=include, exclude=exclude)
    974     return None
    975 else:

File ~/miniconda3/envs/mofdscribe/lib/python3.8/site-packages/sklearn/base.py:629, in BaseEstimator._repr_mimebundle_(self, **kwargs)
    627 def _repr_mimebundle_(self, **kwargs):
    628     """Mime bundle used by jupyter kernels to display estimator"""
--> 629     output = {"text/plain": repr(self)}
    630     if get_config()["display"] == "diagram":
    631         output["text/html"] = estimator_html_repr(self)

File ~/miniconda3/envs/mofdscribe/lib/python3.8/site-packages/sklearn/base.py:279, in BaseEstimator.__repr__(self, N_CHAR_MAX)
    271 # use ellipsis for sequences with a lot of elements
    272 pp = _EstimatorPrettyPrinter(
    273     compact=True,
    274     indent=1,
    275     indent_at_name=True,
    276     n_max_elements_to_show=N_MAX_ELEMENTS_TO_SHOW,
    277 )
--> 279 repr_ = pp.pformat(self)
...
--> 211     value = getattr(self, key)
    212     if deep and hasattr(value, "get_params"):
    213         deep_items = value.get_params().items()

AttributeError: 'RDKitAdaptor' object has no attribute 'featurizer'
Output exceeds the [size limit](command:workbench.action.openSettings?[). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?61c71eae-1ecc-4b36-b427-3f5083ab270d)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File ~/miniconda3/envs/mofdscribe/lib/python3.8/site-packages/IPython/core/formatters.py:707, in PlainTextFormatter.__call__(self, obj)
    700 stream = StringIO()
    701 printer = pretty.RepresentationPrinter(stream, self.verbose,
    702     self.max_width, self.newline,
    703     max_seq_length=self.max_seq_length,
    704     singleton_pprinters=self.singleton_printers,
    705     type_pprinters=self.type_printers,
    706     deferred_pprinters=self.deferred_printers)
--> 707 printer.pretty(obj)
    708 printer.flush()
    709 return stream.getvalue()

File ~/miniconda3/envs/mofdscribe/lib/python3.8/site-packages/IPython/lib/pretty.py:410, in RepresentationPrinter.pretty(self, obj)
    407                         return meth(obj, self, cycle)
    408                 if cls is not object \
    409                         and callable(cls.__dict__.get('__repr__')):
--> 410                     return _repr_pprint(obj, self, cycle)
    412     return _default_pprint(obj, self, cycle)
    413 finally:

File ~/miniconda3/envs/mofdscribe/lib/python3.8/site-packages/IPython/lib/pretty.py:778, in _repr_pprint(obj, p, cycle)
    776 """A pprint that just redirects to the normal repr function."""
    777 # Find newlines and replace them with p.break_()
...
--> 211     value = getattr(self, key)
    212     if deep and hasattr(value, "get_params"):
    213         deep_items = value.get_params().items()

AttributeError: 'RDKitAdaptor' object has no attribute 'featurizer'
Output exceeds the [size limit](command:workbench.action.openSettings?[). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?eab5dd02-b6a7-4c55-b08a-88e16a6c58a5)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File ~/miniconda3/envs/mofdscribe/lib/python3.8/site-packages/IPython/core/formatters.py:343, in BaseFormatter.__call__(self, obj)
    341     method = get_real_method(obj, self.print_method)
    342     if method is not None:
--> 343         return method()
    344     return None
    345 else:

File ~/miniconda3/envs/mofdscribe/lib/python3.8/site-packages/sklearn/base.py:625, in BaseEstimator._repr_html_inner(self)
    620 def _repr_html_inner(self):
    621     """This function is returned by the @property `_repr_html_` to make
    622     `hasattr(estimator, "_repr_html_") return `True` or `False` depending
    623     on `get_config()["display"]`.
    624     """
--> 625     return estimator_html_repr(self)

File ~/miniconda3/envs/mofdscribe/lib/python3.8/site-packages/sklearn/utils/_estimator_html_repr.py:385, in estimator_html_repr(estimator)
    383 style_template = Template(_STYLE)
    384 style_with_id = style_template.substitute(id=container_id)
--> 385 estimator_str = str(estimator)
    387 # The fallback message is shown by default and loading the CSS sets
    388 # div.sk-text-repr-fallback to display: none to hide the fallback message.
    389 #
   (...)
...
--> 211     value = getattr(self, key)
    212     if deep and hasattr(value, "get_params"):
    213         deep_items = value.get_params().items()

AttributeError: 'RDKitAdaptor' object has no attribute 'featurizer'
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 a pull request may close this issue.

1 participant