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

Only print non-default params in class repr #31

Merged
merged 7 commits into from
Oct 15, 2022
Merged

Conversation

rxavier
Copy link
Owner

@rxavier rxavier commented Oct 15, 2022

  • Add the poniard.utils.utils.get_kwargs function, which is used within class __init__ to parse construction parameters.
  • Add the poniard.utils.utils.non_default_repr function, which takes a class instance, checks its init_params attr (obtained from the above), compares with the __init__ default params, and produces a repr which only contains non-default parameters.
  • Modified PoniardBaseEstimator, PoniardPlotFactory and BasePlugin to use these reprs.
  • Custom plugin devs should simply include super().__init__() within initialization to get the new repr.

@rxavier rxavier merged commit 598e83c into develop Oct 15, 2022
@rxavier rxavier deleted the feature/better-repr branch October 19, 2022 13:41
@rxavier rxavier linked an issue Oct 19, 2022 that may be closed by this pull request
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 this pull request may close these issues.

__repr__ is too verbose
1 participant