pixcdust.tests.test_converters¶
Attributes¶
Geometry used as area of interest of limited area tests. |
Functions¶
|
Test NcSimpleReader with conditions on variables. |
|
Compare the start of a converted database to the first original netcdf file. |
|
Compare the read data to the expected data. |
|
Test zarr conversion without area_of_interest. |
|
|
|
Test geopackage and zarr conversion with area_of_interest. |
|
Test shapefile conversion with area_of_interest. |
|
Test the GpkgDGGSProjecter class by converting a sample Gpkg to a DGGS projection. |
Module Contents¶
- pixcdust.tests.test_converters.LIM_AREA_GEOM[source]¶
Geometry used as area of interest of limited area tests.
- pixcdust.tests.test_converters.test_nc_simple_reader_conditions(input_files)[source]¶
Test NcSimpleReader with conditions on variables.
- pixcdust.tests.test_converters.validate_conversion_to_nc(read_data: xarray.Dataset, converted_vars: List[str], first_file: str | pathlib.Path) None[source]¶
Compare the start of a converted database to the first original netcdf file.
- Args:
read_data: Data to validate. converted_vars: Names of variables to compare. first_file: Netcdf file containing the expected data.
- Raises:
AssertionError: If the data are too different.
- pixcdust.tests.test_converters.validate_conversion(read_data: xarray.Dataset, converted_vars: List[str], expected_data: xarray.Dataset, is_longer: bool, len_tol: int = 0, sort_var: bool = False) None[source]¶
Compare the read data to the expected data.
- Args:
read_data: Data to validate. converted_vars: Names of variables to compare. expected_data: Expected data. is_longer: Os the expected_data expected to only contain the start of the read_data. len_tol: Tolerance for len_tol missing point because of numeric error on lon/lat. sort_var: Is the data ordering different and do we neer to sort them.
- Raises:
AssertionError: If the data are too different.
- pixcdust.tests.test_converters.test_convert_zarr_full_area(input_files, first_file, tmp_folder)[source]¶
Test zarr conversion without area_of_interest.
It is compared to the input data.
- pixcdust.tests.test_converters.test_convert_gpkg_and_zarr_limited_area(input_files, first_file, tmp_folder, converted_lim_gpkg)[source]¶
Test geopackage and zarr conversion with area_of_interest.
They are compared to each other. Note that they are ordered differently with some missing points due tu lon/lat casting.