mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Make read/write_pickle_gz quiet
This commit is contained in:
@@ -134,17 +134,13 @@ class PickleGzInstance(Instance):
|
||||
write_pickle_gz(self.instance, self.filename)
|
||||
|
||||
|
||||
def write_pickle_gz(obj: Any, filename: str, quiet: bool = False) -> None:
|
||||
if not quiet:
|
||||
logger.info(f"Writing: {filename}")
|
||||
def write_pickle_gz(obj: Any, filename: str) -> None:
|
||||
os.makedirs(os.path.dirname(filename), exist_ok=True)
|
||||
with gzip.GzipFile(filename, "wb") as file:
|
||||
pickle.dump(obj, cast(IO[bytes], file))
|
||||
|
||||
|
||||
def read_pickle_gz(filename: str, quiet: bool = False) -> Any:
|
||||
if not quiet:
|
||||
logger.info(f"Reading: {filename}")
|
||||
def read_pickle_gz(filename: str) -> Any:
|
||||
with gzip.GzipFile(filename, "rb") as file:
|
||||
return pickle.load(cast(IO[bytes], file))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user