diff --git a/python/idsse/testing/idsse_common/mrms_response.html b/python/idsse/testing/idsse_common/mrms_response.html new file mode 100644 index 0000000..27bcdc1 --- /dev/null +++ b/python/idsse/testing/idsse_common/mrms_response.html @@ -0,0 +1,15 @@ + + + + Index of /data/3DRefl/MergedReflectivityQC_00.50 + + +

Index of /data/3DRefl/MergedReflectivityQC_00.50

+Parent Directory  - +MRMS_MergedReflectivityQC_00.50_20241030-205640.grib2.gz31-Oct-2024 14:43 381K +MRMS_MergedReflectivityQC_00.50_20241030-205438.grib2.gz30-Oct-2024 14:01 227K +MRMS_MergedReflectivityQC_00.50_20241030-205640.grib2.gz30-Oct-2024 14:03 228K +
+ + + diff --git a/python/idsse/testing/utils/resources.py b/python/idsse/testing/utils/resources.py index dacb419..108fe68 100644 --- a/python/idsse/testing/utils/resources.py +++ b/python/idsse/testing/utils/resources.py @@ -68,12 +68,13 @@ def get_resource_from_file(package: str, filename: str) -> dict | Sequence[Seque _, file_extension = path.splitext(filename) if file_extension == '.nc': return _load_netcdf_resource(resources.files(package).joinpath(filename)) - print(filename, file_extension) file_stream = resources.files(package).joinpath(filename).open('r') if file_extension == '.json': return _load_json_resource(file_stream) if file_extension == '.csv': return _load_csv_resource(file_stream) + if file_extension == '.html': + return _load_html_resource(file_stream) raise ValueError(f'Unable to load test data from unsupported extension {file_extension}') @@ -88,6 +89,6 @@ def _load_csv_resource(stream: TextIO) -> Sequence[Sequence[any]]: return [list(map(float, row)) for row in file_reader] -def _load_netcdf_resource(filename: str) -> tuple[dict, np.ndarray]: +def _load_html_resource(filestream: TextIO) -> str: """utility to load NetCDF file from package""" - return read_netcdf(filename) + return filestream.read() diff --git a/python/setup.py b/python/setup.py index 0f6c14f..2afee72 100644 --- a/python/setup.py +++ b/python/setup.py @@ -34,7 +34,8 @@ def package_files(directory): 'idsse.testing.risk_processor.simple', 'idsse.testing.risk_processor.syracuse', 'idsse.testing.utils'], - data_files=[('idsse.testing.data_access.data_cache', package_files('idsse/testing/data_access/data_cache')), + data_files=[('idsse.testing.idsse_common', package_files('idsse/testing/idsse_common/')), + ('idsse.testing.data_access.data_cache', package_files('idsse/testing/data_access/data_cache')), ('idsse.testing.data_access.mrms_aws_grib', package_files('idsse/testing/data_access/mrms_aws_grib')), ('idsse.testing.data_access.nbm_aws_grib', package_files('idsse/testing/data_access/nbm_aws_grib')), ('idsse.testing.data_access.validation', package_files('idsse/testing/data_access/validation'))],