Skip to content

Commit 76ef9f4

Browse files
authored
Fix IgniteInfo can not import issue (#8121)
Fixes #8120 . ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
1 parent 8546be0 commit 76ef9f4

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

monai/config/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from .deviceconfig import (
1515
USE_COMPILED,
1616
USE_META_DICT,
17+
IgniteInfo,
1718
get_config_values,
1819
get_gpu_info,
1920
get_optional_config_values,

monai/config/deviceconfig.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import torch
2424

2525
import monai
26+
from monai.utils.deprecate_utils import deprecated
27+
from monai.utils.enums import IgniteInfo as _IgniteInfo
2628
from monai.utils.module import OptionalImportError, get_package_version, optional_import
2729

2830
try:
@@ -45,6 +47,7 @@
4547
"print_debug_info",
4648
"USE_COMPILED",
4749
"USE_META_DICT",
50+
"IgniteInfo",
4851
]
4952

5053

@@ -260,5 +263,12 @@ def print_debug_info(file: TextIO = sys.stdout) -> None:
260263
print_gpu_info(file)
261264

262265

266+
@deprecated(since="1.4.0", removed="1.6.0", msg_suffix="Please use `monai.utils.enums.IgniteInfo` instead.")
267+
class IgniteInfo:
268+
"""Deprecated Import of IgniteInfo enum, which was moved to `monai.utils.enums.IgniteInfo`."""
269+
270+
OPT_IMPORT_VERSION = _IgniteInfo.OPT_IMPORT_VERSION
271+
272+
263273
if __name__ == "__main__":
264274
print_debug_info()

monai/utils/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ class IgniteInfo(StrEnum):
727727
728728
"""
729729

730-
OPT_IMPORT_VERSION = "0.4.4"
730+
OPT_IMPORT_VERSION = "0.4.11"
731731

732732

733733
if TYPE_CHECKING:

0 commit comments

Comments
 (0)