hypertidy / ncmeta

Tidy NetCDF metadata
https://hypertidy.github.io/ncmeta/
11 stars 5 forks source link

Issue with some nc4 files? #32

Closed dblodgett-usgs closed 4 years ago

dblodgett-usgs commented 5 years ago

I got a bug report from a user saying something wasn't working with a newly introduced NC4 version of some data that wasn't working previously.

Was able to reproduce with:

download.file("https://www.northwestknowledge.net/metdata/data/pr_2019.nc", 'pr_2019.nc')
library(ncmeta)
nc_coord_vars <- nc_coord_var('pr_2019.nc')
nc_gm_to_prj(nc_grid_mapping_atts('pr_2019.nc'))

Turns out that down in nc_var a list with an integer(0) was getting passed to tibble::as_tibble() and the length 0 element of the list causes as_tibble to return a 0 row tibble.

Still debugging some things and will have a hacked up PR coming. I'm not sure what the right way to solve this is going to be...

mdsumner commented 4 years ago

I've been bumped by dplyr into a release - in case you wanted to review this?

dblodgett-usgs commented 4 years ago

Think we should be fine. Thanks for keeping this moving!