-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into separate_nuc_wc
- Loading branch information
Showing
19 changed files
with
156 additions
and
139 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,33 +1,28 @@ | ||
import pathlib | ||
from pathlib import Path | ||
import os | ||
|
||
import datasets | ||
|
||
datasets.disable_progress_bar() | ||
|
||
valid_datasets = [ | ||
"segment_image_data", | ||
"cluster_pixels", | ||
"cluster_cells", | ||
"post_clustering", | ||
"fiber_segmentation", | ||
"LDA_preprocessing", | ||
"LDA_training_inference", | ||
"neighborhood_analysis", | ||
"pairwise_spatial_enrichment", | ||
"ome_tiff", | ||
] | ||
DATASET_PATH = "angelolab/ark_example" | ||
|
||
def load_dataset(cache_dir: pathlib.Path, name: str): | ||
valid_configs = datasets.get_dataset_config_names(DATASET_PATH) | ||
|
||
def load_dataset(cache_dir: Path, name: str): | ||
_ = datasets.load_dataset( | ||
path="angelolab/ark_example", | ||
path=DATASET_PATH, | ||
cache_dir=cache_dir, | ||
name=name, | ||
use_auth_token=False, | ||
revision="main" | ||
token=False, | ||
revision="main", | ||
trust_remote_code=True, | ||
) | ||
|
||
# Make the cache directory if it doesn't exist. | ||
cache_dir = pathlib.Path("./data/cache/") | ||
# Create the cache directory | ||
cache_dir = Path(os.environ.get("GITHUB_WORKSPACE")).resolve() / "data" / "cache" | ||
cache_dir.mkdir(parents=True, exist_ok=True) | ||
for dataset_config in valid_datasets: | ||
load_dataset(cache_dir=cache_dir.as_posix(), name=dataset_config) | ||
|
||
# Download all available datasets | ||
for dataset_config in valid_configs: | ||
load_dataset(cache_dir=cache_dir, name=dataset_config) |
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
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
Oops, something went wrong.