Skip to content

Commit

Permalink
Change test data directory from pytest_files to data
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiggi committed Nov 2, 2023
1 parent 16d7ffc commit c559dda
Show file tree
Hide file tree
Showing 31 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,6 @@ docs\source\reader_preparation.ipynb

# Ignore specific folders
/disdrodb/tests/temp/
/disdrodb/tests/pytest_files/test_folders_files_creation/*
!disdrodb/tests/pytest_files/test_folders_files_creation/.gitkeep
/disdrodb/tests/data/test_folders_files_creation/*
!disdrodb/tests/data/test_folders_files_creation/.gitkeep
disdrodb-dev
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ To create a new reader test, simply add a small, single-station dataset and the

| πŸ“ disdrodb
| β”œβ”€β”€ πŸ“ tests
| β”œβ”€β”€ πŸ“ pytest_files
| β”œβ”€β”€ πŸ“ data
| β”œβ”€β”€ πŸ“ check_readers
| β”œβ”€β”€ πŸ“ DISDRODB
| β”œβ”€β”€ πŸ“ Raw
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/l0/check_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# current file path
PACKAGE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
RAW_DIR = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files", "check_readers", "DISDRODB")
RAW_DIR = os.path.join(__root_path__, "disdrodb", "tests", "data", "check_readers", "DISDRODB")


def get_list_test_data_sources() -> list:
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/tests/test_l0/test_check_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
from disdrodb.l0.standards import available_sensor_names

PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files")
PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "data")


@pytest.mark.parametrize("sensor_name", available_sensor_names())
Expand Down
4 changes: 2 additions & 2 deletions disdrodb/tests/test_l0/test_check_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from disdrodb.l0.l0_reader import available_readers
from disdrodb.l0.standards import available_sensor_names

PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files")
PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "data")


def test_check_metadata_geolocation():
Expand Down Expand Up @@ -325,7 +325,7 @@ def test_check_archive_metadata_geolocation(tmp_path):


def test_read_yaml():
# test based on files under tests\pytest_files\test_check_metadata
# test based on files under tests\data\test_check_metadata

# Test reading a valid YAML file
valid_yaml_attrs = {"key1": "value1", "key2": "value2"}
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/tests/test_l0/test_check_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
from disdrodb.l0.standards import available_sensor_names, get_raw_array_nvalues

RAW_DIR = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files", "check_readers", "DISDRODB")
RAW_DIR = os.path.join(__root_path__, "disdrodb", "tests", "data", "check_readers", "DISDRODB")


def test_check_l0a_standards():
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/tests/test_l0/test_cmd_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

from disdrodb import __root_path__

RAW_DIR = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files", "check_readers", "DISDRODB")
RAW_DIR = os.path.join(__root_path__, "disdrodb", "tests", "data", "check_readers", "DISDRODB")
DATA_SOURCE = "EPFL"
CAMPAIGN_NAME = "PARSIVEL_2007"
STATION_NAME = "10"
Expand Down
6 changes: 3 additions & 3 deletions disdrodb/tests/test_l0/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from disdrodb import __root_path__
from disdrodb.l0 import io

PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files")
PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "data")


def create_fake_metadata_file(
Expand Down Expand Up @@ -289,7 +289,7 @@ def test_get_l0b_dir(path_process_dir):
def test_get_l0a_fpath():
"""
Test the naming and the path of the L0A file
Note that this test needs "/pytest_files/test_folders_files_structure/DISDRODB/Processed/DATA_SOURCE/CAMPAIGN_NAME/
Note that this test needs "/data/test_folders_files_structure/DISDRODB/Processed/DATA_SOURCE/CAMPAIGN_NAME/
metadata/STATION_NAME.yml"
"""
from disdrodb.l0.standards import PRODUCT_VERSION
Expand Down Expand Up @@ -330,7 +330,7 @@ def test_get_l0a_fpath():
def test_get_l0b_fpath():
"""
Test the naming and the path of the L0B file
Note that this test needs "/pytest_files/test_folders_files_structure/DISDRODB/Processed/DATA_SOURCE/CAMPAIGN_NAME/
Note that this test needs "/data/test_folders_files_structure/DISDRODB/Processed/DATA_SOURCE/CAMPAIGN_NAME/
metadata/STATION_NAME.yml"
"""
from disdrodb.l0.standards import PRODUCT_VERSION
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/tests/test_l0/test_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from disdrodb import __root_path__
from disdrodb.l0 import issue

PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files")
PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "data")

####--------------------------------------------------------------------------.
#### Checks
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/tests/test_l0/test_l0a_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
strip_string_spaces,
)

PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files")
PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "data")

# NOTE:
# The following fixtures are not defined in this file, but are used and injected by Pytest:
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/tests/test_l0/test_l0b_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
set_variable_attributes,
)

PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files")
PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "data")


# NOTE:
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/tests/test_l0/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
write_default_metadata,
)

PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "pytest_files")
PATH_TEST_FOLDERS_FILES = os.path.join(__root_path__, "disdrodb", "tests", "data")


def create_fake_station_file(
Expand Down
2 changes: 1 addition & 1 deletion docs/source/readers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ when someone else will add changes to the disdrodb codebase in the future.

You should place you data and config files under the following directory tree:

| πŸ“ disdrodb/tests/pytest_files/check_readers/DISDRODB
| πŸ“ disdrodb/tests/data/check_readers/DISDRODB
| β”œβ”€β”€ πŸ“ Raw
| β”œβ”€β”€ πŸ“ <DATA_SOURCE>
| β”œβ”€β”€ πŸ“ <CAMPAIGN_NAME>
Expand Down

0 comments on commit c559dda

Please sign in to comment.