Skip to content

Conversation

@satvshr
Copy link
Contributor

@satvshr satvshr commented Dec 30, 2025

Metadata

Details

  • What does this PR implement/fix? Explain your changes.
    Refactors the configuration handling to centralize state in a single OpenMLConfig.

  • Why is this change necessary? What is the problem it solves?
    This simplifies configuration management and makes it easier to add validation and consistency checks, avoiding scattered logic and direct mutation of module-level globals.

@satvshr satvshr marked this pull request as draft December 30, 2025 06:30
@jgyasu
Copy link

jgyasu commented Dec 30, 2025

Can you please add more details in your PR description?

@satvshr
Copy link
Contributor Author

satvshr commented Dec 30, 2025

It's not ready for review yet! Hence a draft.

@satvshr
Copy link
Contributor Author

satvshr commented Dec 31, 2025

@SimonBlanke if we make the dataclass OpenMLConfig frozen, we will have to change everything from the current openml.config._config.cachedir = _root_cache_directory to _config = replace(_config, cachedir=_root_cache_directory), it is your call. In my opinion, it is a good idea to freeze it and use _config = replace(_config, cachedir=_root_cache_directory) everywhere (hence making it immutable) while I try to find a better fix to the problem.

For anyone else trying to help out, kindly refer to the issue attached to the PR (#1564) to get into the loop on the discussion.

ps: Even though this is a temporary fix it seems like a good step in the right direction for having a proper config. I think I would like to add and remove a few things to build on top of this once ive a better idea though (and once this PR is closed).

@satvshr satvshr marked this pull request as ready for review December 31, 2025 13:54
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 68.35443% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.54%. Comparing base (bd8ae77) to head (7c82054).

Files with missing lines Patch % Lines
openml/config.py 67.74% 20 Missing ⚠️
openml/cli.py 0.00% 2 Missing ⚠️
openml/testing.py 71.42% 2 Missing ⚠️
openml/_api_calls.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1577      +/-   ##
==========================================
+ Coverage   79.14%   79.54%   +0.39%     
==========================================
  Files          36       36              
  Lines        4320     4316       -4     
==========================================
+ Hits         3419     3433      +14     
+ Misses        901      883      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[ENH] Improve Global Config Architecture

3 participants