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)
| 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]: |