Skip to content

Commit 98ee6b4

Browse files
authored
Make version mismatch warning informative and actionable (#4505)
1 parent 4c3a6f9 commit 98ee6b4

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/spikeinterface/core/base.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,14 +1145,8 @@ def _load_extractor_from_dict(dic) -> "BaseExtractor":
11451145

11461146
assert extractor_class is not None and class_name is not None, "Could not load spikeinterface class"
11471147
is_old_version = not _check_same_version(class_name, dic["version"])
1148-
if is_old_version:
1149-
warnings.warn(
1150-
f"Versions are not the same. This might lead to compatibility errors. "
1151-
f"Using {class_name.split('.')[0]}=={dic['version']} is recommended"
1152-
)
1153-
1154-
if hasattr(extractor_class, "_handle_backward_compatibility"):
1155-
new_kwargs = extractor_class._handle_backward_compatibility(new_kwargs, dic)
1148+
if is_old_version and hasattr(extractor_class, "_handle_backward_compatibility"):
1149+
new_kwargs = extractor_class._handle_backward_compatibility(new_kwargs, dic)
11561150

11571151
# Initialize the extractor
11581152
extractor = extractor_class(**new_kwargs)

0 commit comments

Comments
 (0)