Skip to content

Commit e520b46

Browse files
committed
remove warning
1 parent 8a45645 commit e520b46

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

src/spikeinterface/core/base.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,19 +1144,9 @@ def _load_extractor_from_dict(dic) -> "BaseExtractor":
11441144
extractor_class = _get_class_from_string(class_name)
11451145

11461146
assert extractor_class is not None and class_name is not None, "Could not load spikeinterface class"
1147-
module_name = class_name.split(".")[0]
1148-
current_version = importlib.import_module(module_name).__version__
1149-
saved_version = dic["version"]
1150-
is_old_version = not _check_same_version(class_name, saved_version)
1151-
if is_old_version:
1152-
warnings.warn(
1153-
f"This object was saved with {module_name}=={saved_version} and you are running {module_name}=={current_version}. "
1154-
f"This may lead to differences in default parameters or minor changes in behavior. "
1155-
f"To remove this warning, re-save the object with `save()` or `save_to_folder()`/`save_to_zarr()`."
1156-
)
1157-
1158-
if hasattr(extractor_class, "_handle_backward_compatibility"):
1159-
new_kwargs = extractor_class._handle_backward_compatibility(new_kwargs, dic)
1147+
is_old_version = not _check_same_version(class_name, dic["version"])
1148+
if is_old_version and hasattr(extractor_class, "_handle_backward_compatibility"):
1149+
new_kwargs = extractor_class._handle_backward_compatibility(new_kwargs, dic)
11601150

11611151
# Initialize the extractor
11621152
extractor = extractor_class(**new_kwargs)

0 commit comments

Comments
 (0)