Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading error message when using climate data interface with daily data #16

Open
jwohland opened this issue Jul 7, 2023 · 0 comments

Comments

@jwohland
Copy link

jwohland commented Jul 7, 2023

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.'
            )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant