gsee icon indicating copy to clipboard operation
gsee copied to clipboard

Misleading error message when using climate data interface with daily data

Open jwohland opened this issue 2 years ago • 0 comments

I think that the value error in run_interface_from_dataset (see below), should read "for frequencies other than "A", "S", or "M"" instead of "A", "M", or "D". Because that is checked in the if statement.

if pdfs_file is not None:
        if frequency in ['A', 'S', 'M']:
            if pdfs_file == 'builtin':
                pdfs = xr.open_dataset(util.return_pdf_path(), autoclose=True)
            else:
                pdfs = xr.open_dataset(pdfs_file, autoclose=True)
            pdf_coords = list(product(pdfs['lat'].values, pdfs['lon'].values))
            tree = spatial.KDTree(pdf_coords)
            coord_list_nn = [pdf_coords[int(tree.query([x])[1])] for x in coord_list]
        else:
            raise ValueError(
                'For frequencies other than "A", "M", or "D", '
                '`pdfs_file` must be explicitly set to None.'
            )

jwohland avatar Jul 07 '23 11:07 jwohland