项目文件夹

文件
Quan (Andy) Gan 067cd74420 [Distributed] Graph chunking UX (#4365)
* first commit

* update

* huh

* fix

* update

* revert core

* fix

* update

* rewrite

* oops

* address comments

* add graph name

* address comments

* remove sample metadata file

* address comments

* fix

* remove

* add docs
2022-08-11 13:49:32 +08:00

18 行
444 B
Python

import os
from contextlib import contextmanager
import logging
from numpy.lib.format import open_memmap
@contextmanager
def setdir(path):
try:
os.makedirs(path, exist_ok=True)
cwd = os.getcwd()
logging.info('Changing directory to %s' % path)
logging.info('Previously: %s' % cwd)
os.chdir(path)
yield
finally:
logging.info('Restoring directory to %s' % cwd)
os.chdir(cwd)