Skip to content

ENH Display Methods in HTML representation #31698

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

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

DeaMariaLeon
Copy link
Contributor

@DeaMariaLeon DeaMariaLeon commented Jul 3, 2025

Reference Issues/PRs

Towards #26595

What does this implement/fix? Explain your changes.

Adding a table with the estimator's methods with their signature, and links to their documentation.

Screenshot 2025-07-21 at 17 39 10

Any other comments?

Requested by Guillaume Lemaître.
Tests need to be added, but I'm not sure if this enhancement will actually be accepted. Guillaume mentioned that he needed to discuss it with the team, in order to decide if it should be added to the HTML display.

Copy link

github-actions bot commented Jul 3, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 7807950. Link to the linter CI: here

@DeaMariaLeon DeaMariaLeon marked this pull request as ready for review July 21, 2025 15:24
@DeaMariaLeon DeaMariaLeon changed the title WIP: ENH Display Methods in HTML representation ENH Display Methods in HTML representation Jul 21, 2025
@glemaitre glemaitre self-requested a review July 28, 2025 09:10
@glemaitre
Copy link
Member

A couple of thoughts:

I'm thinking that we should have the parameter next to the functions a bit like below:

image

Otherwise, it looks weird.

When it comes to the tooltip, I think that we need to define a new CSS rule. Since we are going to show only the short summary, I don't think that we need to truncate because we will always have less than 88 characters. So I think that we could show the full short summary on a single line (it means a quite wide tooltip). Then, I would add an empty line and then the "Click to see the online documentation" on a new line. All this text should be left-aligned then.

Regarding the parameter, we sometimes have this rendering:

image

We are missing the closing parenthesis. Then, I think that we can shorten more the value of parameters: I think that more than 15 characters is too much. Usually, we will have only simple types as default parameters.

Now, I think that we can have an additional value on this feature by grouping the methods other than alphabetic order:

  • I think that we could have a group related to fit, transform, predict and friends
  • Another group for the set_params and get_params
  • Another group for metadata routing
  • Another group with other information (e.g. get_feature_names_out)

Potentially, we before each group we could introduce a row with fused cells and add a title for each group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants