Skip to content

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

Merged
fkiraly merged 7 commits into
mainfrom
get_param_names-sorted
Jun 20, 2024
Merged

[ENH] option to return BaseObject.get_param_names in the same order as in the __init__#335
fkiraly merged 7 commits into
mainfrom
get_param_names-sorted

Conversation

@fkiraly
Copy link
Copy Markdown
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
Comment thread skbase/base/_base.py Fixed
Comment thread skbase/base/_base.py Fixed
@fkiraly fkiraly merged commit 7dfd670 into main Jun 20, 2024
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.

2 participants