[b9e282]: / sub-packages / bionemo-scdl / tests / bionemo / scdl / conftest.py

Download this file

63 lines (52 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-Apache2
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import shutil
from pathlib import Path
import pytest
from bionemo.core.data.load import load
@pytest.fixture
def test_directory() -> Path:
"""Gets the path to the directory with test data.
Returns:
A Path object that is the directory with test data.
"""
# return load("scdl/sample") / "scdl_data"
return load("scdl/sample_scdl_feature_ids") / "scdl_data_with_feature_ids"
@pytest.fixture
def create_cellx_val_data(tmpdir) -> Path:
"""Gets the path to the directory with test data.
Returns:
A Path object that is the directory with test data.
"""
cellx_input_val_path = (
load("single_cell/testdata-20240506")
/ "cellxgene_2023-12-15_small"
/ "input_data"
/ "val"
/ "assay__10x_3_v2/"
)
file1 = (
cellx_input_val_path
/ "sex__female/development_stage__74-year-old_human_stage/self_reported_ethnicity__Asian/tissue_general__lung/dataset_id__f64e1be1-de15-4d27-8da4-82225cd4c035/sidx_40575621_2_0.h5ad"
)
file2 = (
cellx_input_val_path
/ "sex__male/development_stage__82-year-old_human_stage/self_reported_ethnicity__European/tissue_general__lung/dataset_id__f64e1be1-de15-4d27-8da4-82225cd4c035/sidx_40596188_1_0.h5ad"
)
collated_dir = tmpdir / "collated_val"
collated_dir.mkdir()
shutil.copy(file1, collated_dir)
shutil.copy(file2, collated_dir)
return collated_dir