Skip to content

Commit fefea59

Browse files
authored
[ENH] move utils module to folder (#1612)
This is a minimal refactor preparatory PR. It changes the `utils` module from a file to a folder, in anticipation of other PR that may add further utils - to avoid that everyone works on the same file.
1 parent d18ca42 commit fefea59

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

openml/utils/__init__.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""Utilities module."""
2+
3+
from openml.utils._openml import (
4+
ProgressBar,
5+
ReprMixin,
6+
_create_cache_directory,
7+
_create_cache_directory_for_id,
8+
_create_lockfiles_dir,
9+
_delete_entity,
10+
_get_cache_dir_for_id,
11+
_get_cache_dir_for_key,
12+
_get_rest_api_type_alias,
13+
_list_all,
14+
_remove_cache_dir_for_id,
15+
_tag_entity,
16+
_tag_openml_base,
17+
extract_xml_tags,
18+
get_cache_size,
19+
thread_safe_if_oslo_installed,
20+
)
21+
22+
__all__ = [
23+
"ProgressBar",
24+
"ReprMixin",
25+
"_create_cache_directory",
26+
"_create_cache_directory_for_id",
27+
"_create_lockfiles_dir",
28+
"_delete_entity",
29+
"_get_cache_dir_for_id",
30+
"_get_cache_dir_for_key",
31+
"_get_rest_api_type_alias",
32+
"_list_all",
33+
"_remove_cache_dir_for_id",
34+
"_tag_entity",
35+
"_tag_openml_base",
36+
"extract_xml_tags",
37+
"get_cache_size",
38+
"thread_safe_if_oslo_installed",
39+
]

openml/utils.py renamed to openml/utils/_openml.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
import openml
2727
import openml._api_calls
2828
import openml.exceptions
29-
30-
from . import config
29+
from openml import config
3130

3231
# Avoid import cycles: https://mypy.readthedocs.io/en/latest/common_issues.html#import-cycles
3332
if TYPE_CHECKING:

0 commit comments

Comments
 (0)