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

[ENH] option to return BaseObject.get_param_names in the same order as in the __init__ #335

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

fkiraly
Copy link
Contributor

@fkiraly fkiraly commented Jun 5, 2024

Currently, there is no easy method to return a BaseObjects's parameter name in the same order as they appear in the __init__, which is useful in various situations. This is because get_param_names does retrieve them, but sorts them alphabetically before returning.

The default should be not sorting, as sorting is an easy operation for the user, whereas retreving the parameters manually is hard.

This PR therefore introduces a new bool parameter sort to get_param_names which allows the user to specify whether they want the name sorted.

@fkiraly fkiraly added the implementing framework Implementing core skbase framework label Jun 5, 2024
skbase/base/_base.py Fixed Show fixed Hide fixed
skbase/base/_base.py Fixed Show fixed Hide fixed
@fkiraly fkiraly merged commit 7dfd670 into main Jun 20, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implementing framework Implementing core skbase framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant