-
Notifications
You must be signed in to change notification settings - Fork 13
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
8ea1e79
commit 47d8c12
Showing
1 changed file
with
12 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import os | ||
import tempfile | ||
import zipfile | ||
from . import DATA_DIR | ||
|
||
|
||
# Specify the config file via environment variable before importing nplinker in any test. | ||
os.environ["NPLINKER_CONFIG_FILE"] = str(DATA_DIR / "nplinker_demo1.toml") | ||
# Prepare dataset for local mode testing | ||
# ⚠️ Multiple temp dirs will be created if using parallel testing. | ||
temp_dir = tempfile.mkdtemp(prefix="nplinker_") | ||
nplinker_root_dir = os.path.join(temp_dir, "local_mode_example") | ||
with zipfile.ZipFile(DATA_DIR / "local_mode_example.zip", "r") as zip_ref: | ||
zip_ref.extractall(temp_dir) | ||
|
||
# NPLinker setting `root_dir` must be a path that exists, so setting it to a temporary directory. | ||
os.environ["NPLINKER_ROOT_DIR"] = tempfile.mkdtemp(prefix="nplinker_") | ||
os.environ["NPLINKER_ROOT_DIR"] = nplinker_root_dir | ||
|
||
# Specify the config file via environment variable before importing nplinker in any test. | ||
os.environ["NPLINKER_CONFIG_FILE"] = str(DATA_DIR / "nplinker_local_mode.toml") |