Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

List declarations under a public module if applicable #509

Closed
lars-reimann opened this issue May 25, 2022 · 0 comments · Fixed by #645
Closed

List declarations under a public module if applicable #509

lars-reimann opened this issue May 25, 2022 · 0 comments · Fixed by #645
Assignees
Labels
enhancement 💡 New feature or request

Comments

@lars-reimann
Copy link
Member

lars-reimann commented May 25, 2022

Is your feature request related to a problem? Please describe

Currently, we only store the module in the API data that contains a given declaration. However, other modules (particularly the __init__.py files) might import and, thus, also re-export a declaration. This behavior is already checked to determine whether a declaration is public or not. But in the editor, the declarations are still listed in the internal modules that declare them rather than the public ones that should be used instead. Implementation details like this should be hidden.

Desired solution

Store all modules that provide access to a given declaration when the api command is run. In the editor list a declaration under one of the public modules if it exists. Otherwise, pick one of the private ones.

Screenshots (optional)

image

Here we see, for example, the public class SVR listed underneath the private module sklearn._svm.classes. The module is private since one of the segments of its name (_svm) starts with an underscore. However, the class SVR is also available under sklearn.svm. This is the module that should appear in the tree view as its parent.

Additional Context

Maybe store an additional property "reexported_by" in the API data that stores a list of the names of modules that reexport a declaration.

@lars-reimann lars-reimann added the enhancement 💡 New feature or request label May 25, 2022
@lars-reimann lars-reimann moved this to Backlog in API Editor May 25, 2022
@lars-reimann lars-reimann changed the title Store all modules that provide a given declaration List declarations under a public module if applicable May 25, 2022
@lars-reimann lars-reimann self-assigned this Jun 7, 2022
@lars-reimann lars-reimann moved this from Backlog to Todo in API Editor Jun 7, 2022
@lars-reimann lars-reimann moved this from Todo to In Progress in API Editor Jun 14, 2022
@lars-reimann lars-reimann moved this from In Progress to Ready for Review in API Editor Jun 14, 2022
Repository owner moved this from Ready for Review to ✔️ Done in API Editor Jun 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement 💡 New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant