From 08d9366ea6472150b1b1e419aec0121f9ddb30c9 Mon Sep 17 00:00:00 2001 From: KumoLiu Date: Wed, 20 Sep 2023 17:47:51 +0800 Subject: [PATCH] fix #7015 Signed-off-by: KumoLiu --- monai/bundle/scripts.py | 14 +++++++------- monai/bundle/workflows.py | 6 +++--- monai/handlers/ignite_metric.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/monai/bundle/scripts.py b/monai/bundle/scripts.py index 711f585159..5ab541a625 100644 --- a/monai/bundle/scripts.py +++ b/monai/bundle/scripts.py @@ -248,7 +248,7 @@ def _process_bundle_dir(bundle_dir: PathLike | None = None) -> Path: return Path(bundle_dir) -@deprecated_arg_default("source", "github", "monaihosting", since="1.3", replaced="1.5") +@deprecated_arg_default("source", "github", "monaihosting", since="1.2", replaced="1.5") def download( name: str | None = None, version: str | None = None, @@ -376,9 +376,9 @@ def download( ) -@deprecated_arg("net_name", since="1.3", removed="1.5", msg_suffix="please use ``model`` instead.") -@deprecated_arg("net_kwargs", since="1.3", removed="1.5", msg_suffix="please use ``model`` instead.") -@deprecated_arg("return_state_dict", since="1.3", removed="1.5") +@deprecated_arg("net_name", since="1.2", removed="1.5", msg_suffix="please use ``model`` instead.") +@deprecated_arg("net_kwargs", since="1.2", removed="1.5", msg_suffix="please use ``model`` instead.") +@deprecated_arg("return_state_dict", since="1.2", removed="1.5") def load( name: str, model: torch.nn.Module | None = None, @@ -586,7 +586,7 @@ def _get_all_bundles_info( return bundles_info -@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.3", replaced="1.5") +@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.2", replaced="1.5") def get_all_bundles_list( repo: str = "Project-MONAI/model-zoo", tag: str = "hosting_storage_v1", auth_token: str | None = None ) -> list[tuple[str, str]]: @@ -621,7 +621,7 @@ def get_all_bundles_list( return bundles_list -@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.3", replaced="1.5") +@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.2", replaced="1.5") def get_bundle_versions( bundle_name: str, repo: str = "Project-MONAI/model-zoo", @@ -659,7 +659,7 @@ def get_bundle_versions( return {"latest_version": all_versions[-1], "all_versions": all_versions} -@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.3", replaced="1.5") +@deprecated_arg_default("tag", "hosting_storage_v1", "dev", since="1.2", replaced="1.5") def get_bundle_info( bundle_name: str, version: str | None = None, diff --git a/monai/bundle/workflows.py b/monai/bundle/workflows.py index 5f34578f7b..585553a806 100644 --- a/monai/bundle/workflows.py +++ b/monai/bundle/workflows.py @@ -55,7 +55,7 @@ class BundleWorkflow(ABC): @deprecated_arg( "workflow", - since="1.3", + since="1.2", removed="1.5", new_name="workflow_type", msg_suffix="please use `workflow_type` instead.", @@ -214,12 +214,12 @@ class ConfigWorkflow(BundleWorkflow): @deprecated_arg( "workflow", - since="1.3", + since="1.2", removed="1.5", new_name="workflow_type", msg_suffix="please use `workflow_type` instead.", ) - @deprecated_arg_default("workflow_type", None, "train", since="1.3", replaced="1.4") + @deprecated_arg_default("workflow_type", None, "train", since="1.2", replaced="1.4") def __init__( self, config_file: str | Sequence[str], diff --git a/monai/handlers/ignite_metric.py b/monai/handlers/ignite_metric.py index 3f30b62c0c..0382b8cb64 100644 --- a/monai/handlers/ignite_metric.py +++ b/monai/handlers/ignite_metric.py @@ -155,7 +155,7 @@ def attach(self, engine: Engine, name: str) -> None: # type: ignore[override] engine.state.metric_details = {} # type: ignore -@deprecated(since="1.3", removed="1.4", msg_suffix="Use IgniteMetricHandler instead of IgniteMetric.") +@deprecated(since="1.2", removed="1.4", msg_suffix="Use IgniteMetricHandler instead of IgniteMetric.") class IgniteMetric(IgniteMetricHandler): def __init__( self,