[ENH] Top-Level Convenience Aliases for Common Operations#1551
[ENH] Top-Level Convenience Aliases for Common Operations#1551Omswastik-11 wants to merge 15 commits intoopenml:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1551 +/- ##
==========================================
+ Coverage 52.73% 52.78% +0.04%
==========================================
Files 37 37
Lines 4399 4403 +4
==========================================
+ Hits 2320 2324 +4
Misses 2079 2079 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
geetu040
left a comment
There was a problem hiding this comment.
Please resolve conflicts with main, otherwise the changes look good.
There was a problem hiding this comment.
Pull request overview
Adds top-level convenience aliases to the openml package so common operations (list/get for datasets, tasks, flows, runs) can be called directly without referencing submodules, and updates examples/tests accordingly.
Changes:
- Re-export
list_*/get_*helpers from datasets/flows/tasks/runs atopenml.<fn>level viaopenml/__init__.py. - Add a unit test verifying the top-level aliases resolve to the intended underlying implementations.
- Update tutorial/example scripts to demonstrate the new top-level API while keeping the old submodule paths as comments.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
openml/__init__.py |
Adds top-level imports + __all__ entries for list/get convenience aliases. |
tests/test_openml/test_openml.py |
Adds a test ensuring the top-level aliases map to the expected implementations. |
examples/Basics/simple_tasks_tutorial.py |
Switches example usage to openml.get_task(...) (with old path commented). |
examples/Basics/simple_flows_and_runs_tutorial.py |
Switches example usage to openml.get_task(...) and fixes a typo in a comment. |
examples/Basics/simple_datasets_tutorial.py |
Switches example usage to openml.list_datasets() / openml.get_dataset(...). |
examples/Advanced/tasks_tutorial.py |
Switches example usage to openml.list_tasks(...) / openml.get_task(...) and updates narrative text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…1/openml-python into docs-for-get-publish
|
@PGijsbers, @joaquinvanschoren, are you happy with this change? This is just aliasing. |
Redundant syntax for getters
In getters, syntax is repeated and redundant, mainly through
the submodule having to be imported or addressed.
API
Implementation Details
Added re-exports in
__init__.pyfor:list_datasets,get_datasetlist_flows,get_flowlist_tasks,get_tasklist_runs,get_runFunctions are imported directly from their respective submodules and exposed via
__all__.All existing submodule-level imports remain fully functional.
No changes to the underlying implementations — these are pure convenience aliases.
Added unit tests to confirm that the aliases reference the correct underlying functions.