-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46d02a4
commit 39afe8a
Showing
5 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import pickle | ||
|
||
from deep_utils.utils.decorators.main import method_deprecated | ||
|
||
|
||
class PickleUtils: | ||
|
||
@staticmethod | ||
def dump_pickle(file_path: str, file, mode: str = "wb"): | ||
def dump(file_path: str, file, mode: str = "wb"): | ||
with open(file_path, mode=mode) as f: | ||
pickle.dump(file, f) | ||
|
||
@staticmethod | ||
def load_pickle(file_path: str, mode: str = "rb", encoding=""): | ||
def load(file_path: str, mode: str = "rb", encoding=""): | ||
with open(file_path, mode=mode) as f: | ||
return pickle.load(f, encoding=encoding) | ||
|
||
|
||
PickleUtils.load_pickle = method_deprecated(PickleUtils.load) | ||
PickleUtils.dump_pickle = method_deprecated(PickleUtils.dump) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters