Skip to content

Commit

Permalink
add relative to provenance (#3165)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin authored Jul 11, 2024
1 parent e4fa25a commit 1f84828
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/spikeinterface/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,12 +950,12 @@ def save_to_folder(
folder.mkdir(parents=True, exist_ok=False)

# dump provenance
provenance_file_path = folder / f"provenance.json"
if self.check_serializability("json"):
provenance_file = folder / f"provenance.json"
self.dump(provenance_file)
self.dump_to_json(file_path=provenance_file_path, relative_to=folder)
elif self.check_serializability("pickle"):
provenance_file = folder / f"provenance.pkl"
self.dump(provenance_file)
self.dump_to_pickle(provenance_file, relative_to=folder)
else:
warnings.warn("The extractor is not serializable to file. The provenance will not be saved.")

Expand All @@ -967,8 +967,9 @@ def save_to_folder(
# copy properties/
self.copy_metadata(cached)

# dump
cached.dump(folder / f"si_folder.json", relative_to=folder)
# Dump the extractor to json file
si_folder_path = folder / f"si_folder.json"
cached.dump_to_json(file_path=si_folder_path, relative_to=folder)

return cached

Expand Down

0 comments on commit 1f84828

Please sign in to comment.