MCPcopy Index your code
hub / github.com/Project-MONAI/MONAI / normalize_meta_id

Method normalize_meta_id

monai/bundle/reference_resolver.py:215–230  ·  view source on GitHub ↗

Update deprecated identifiers in `config` using `DEPRECATED_ID_MAPPING`. This will replace names that are marked as deprecated with their replacement. Args: config: input config to be updated.

(self, config: Any)

Source from the content-addressed store, hash-verified

213 return str(id).replace("#", cls.sep) # backward compatibility `#` is the old separator
214
215 def normalize_meta_id(self, config: Any) -> Any:
216 """
217 Update deprecated identifiers in `config` using `DEPRECATED_ID_MAPPING`.
218 This will replace names that are marked as deprecated with their replacement.
219
220 Args:
221 config: input config to be updated.
222 """
223 if isinstance(config, dict):
224 for _id, _new_id in DEPRECATED_ID_MAPPING.items():
225 if _id in config.keys():
226 warnings.warn(
227 f"Detected deprecated name '{_id}' in configuration file, replacing with '{_new_id}'."
228 )
229 config[_new_id] = config.pop(_id)
230 return config
231
232 @classmethod
233 def split_id(cls, id: str | int, last: bool = False) -> list[str]:

Callers 2

__init__Method · 0.80
setMethod · 0.80

Calls 1

popMethod · 0.80

Tested by

no test coverage detected