コード例 #1
0
ファイル: test_utils.py プロジェクト: then6702/wrf_hydro_py
def test_xrnan_none(filename, expected, tmpdir):
    # Perhaps this test is extraneous?
    # Right now only have real data on hand without NaNs.
    file_path = test_dir.joinpath(collection_data_dir)
    the_file = file_path.joinpath(filename)
    result = xrnan(the_file)
    assert result is expected
コード例 #2
0
def check_file_nans(dataset_or_path: Union[str, pathlib.Path, xr.Dataset],
                    n_cores: int = 1) -> Union[pd.DataFrame, None]:
    """Opens the specified netcdf file and checks all data variables for NA values. NA assigned
    according to xarray __FillVal parsing. See xarray.Dataset documentation
    Args:
        dataset_or_path: The path to the netcdf dataset file, or a dataset itself
    Returns: string summary of nans if present
    """
    return xrnan(dataset_or_path, n_cores=n_cores)
コード例 #3
0
ファイル: test_utils.py プロジェクト: then6702/wrf_hydro_py
def test_xrnan_matrix(filename, expected, tmpdir):
    file_path = test_dir.joinpath(nan_na_data_dir)
    the_file = file_path.joinpath(filename)
    result = xrnan(the_file)
    assert repr(result) == expected