Skip to content

Commit

Permalink
Fix IgniteInfo can not import issue (#8121)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
KumoLiu authored Sep 30, 2024
1 parent 8546be0 commit 76ef9f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions monai/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .deviceconfig import (
USE_COMPILED,
USE_META_DICT,
IgniteInfo,
get_config_values,
get_gpu_info,
get_optional_config_values,
Expand Down
10 changes: 10 additions & 0 deletions monai/config/deviceconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import torch

import monai
from monai.utils.deprecate_utils import deprecated
from monai.utils.enums import IgniteInfo as _IgniteInfo
from monai.utils.module import OptionalImportError, get_package_version, optional_import

try:
Expand All @@ -45,6 +47,7 @@
"print_debug_info",
"USE_COMPILED",
"USE_META_DICT",
"IgniteInfo",
]


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


@deprecated(since="1.4.0", removed="1.6.0", msg_suffix="Please use `monai.utils.enums.IgniteInfo` instead.")
class IgniteInfo:
"""Deprecated Import of IgniteInfo enum, which was moved to `monai.utils.enums.IgniteInfo`."""

OPT_IMPORT_VERSION = _IgniteInfo.OPT_IMPORT_VERSION


if __name__ == "__main__":
print_debug_info()
2 changes: 1 addition & 1 deletion monai/utils/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ class IgniteInfo(StrEnum):
"""

OPT_IMPORT_VERSION = "0.4.4"
OPT_IMPORT_VERSION = "0.4.11"


if TYPE_CHECKING:
Expand Down

0 comments on commit 76ef9f4

Please sign in to comment.