NASA-IMPACT / pyQuARC

The pyQuARC tool reads and evaluates metadata records with a focus on the consistency and robustness of the metadata. pyQuARC flags opportunities to improve or add to contextual metadata information in order to help the user connect to relevant data products. pyQuARC also ensures that information common to both the data product and the file-level metadata are consistent and compatible. pyQuARC frees up human evaluators to make more sophisticated assessments such as whether an abstract accurately describes the data and provides the correct contextual information. The base pyQuARC package assesses descriptive metadata used to catalog Earth observation data products and files. As open source software, pyQuARC can be adapted and customized by data providers to allow for quality checks that evolve with their needs, including checking metadata not covered in base package.
Apache License 2.0
19 stars 0 forks source link

Regression testing jat #209

Closed John-Troutman closed 1 year ago

John-Troutman commented 1 year ago

Updates to umm-c, echo-c, and echo-g checks based on comments made in checks documents.

spa0002 commented 1 year ago

For ex: something like: in main.py - changing

from code.utils import get_headers

if __name__ == '__main__':
    from code.checker import Checker
    from code.constants import COLOR, ECHO10_C, SUPPORTED_FORMATS
    from code.downloader import Downloader
    from code.utils import get_cmr_url, is_valid_cmr_url
else:
    from .code.checker import Checker
    from .code.constants import COLOR, ECHO10_C, SUPPORTED_FORMATS
    from .code.downloader import Downloader
    from .code.utils import get_cmr_url, is_valid_cmr_url

to

if __name__ == '__main__':
    from code.checker import Checker
    from code.constants import COLOR, ECHO10_C, SUPPORTED_FORMATS
    from code.downloader import Downloader
    from code.utils import get_cmr_url, is_valid_cmr_url
    from code.utils import get_headers
else:
    from .code.checker import Checker
    from .code.constants import COLOR, ECHO10_C, SUPPORTED_FORMATS
    from .code.downloader import Downloader
    from .code.utils import get_cmr_url, is_valid_cmr_url
    from .code.utils import get_headers

and in test_checker.py changing

from pyQuARC.code.checker import Checker

from .fixtures.checker import FUNCTION_MAPPING
from .common import read_test_metadata

to

import sys
import os
sys.path.append(os.getcwd())
from tests.fixtures.checker import FUNCTION_MAPPING
from pyQuARC.code.checker import Checker
from tests.common import read_test_metadata

and so on for the files in that list

spa0002 commented 1 year ago

Agree with Sam -- try changing the imports using his suggestion, then commit and push (no need to make a new PR, this one will update to reflect your commits). We'll see if that fixes the build error

@John-Troutman - you can check out the files ( tests/test_checker.py tests/test_custom_checker.py tests/test_datetime_validator.py tests/test_downloader.py tests/test_schema_validator.py tests/test_string_validator.py) in my PR if you want to see how I edited them.