Skip to content

Commit 6fea57f

Browse files
committed
add logging to save_data
1 parent 1f806a9 commit 6fea57f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

snp2cell/snp2cell_class.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,12 @@ def save_obj(self, path: Union[str, os.PathLike]) -> None:
354354
with open(path, "wb") as f:
355355
dill.dump(self, f)
356356

357-
def save_data(self, path: Union[str, os.PathLike]) -> None:
357+
@add_logger(show_start_end=False)
358+
def save_data(
359+
self,
360+
path: Union[str, os.PathLike],
361+
log: logging.Logger = logging.getLogger(),
362+
) -> None:
358363
"""
359364
Save object data. Reload using `s2c = SNP2CELL(<path>)`.
360365
@@ -374,6 +379,7 @@ def save_data(self, path: Union[str, os.PathLike]) -> None:
374379
}
375380
with open(path, "wb") as f:
376381
dill.dump(data, f)
382+
log.info(f"saved data to: '{Path(path).resolve()}'")
377383

378384
def load_data(self, path: Union[str, os.PathLike], overwrite: bool = False) -> None:
379385
"""

0 commit comments

Comments
 (0)