harphub / harpIO

IO functions for HARP
https://harphub.github.io/harpIO/
Other
6 stars 16 forks source link

read_eps_interpolate cannot handle zero sized files #11

Closed uandrae closed 4 years ago

uandrae commented 4 years ago

A zero sized file like

[mcoop.u@lxserv1683 testharp]$ ls -l /data/proj/metcoop/mc-20-utv/opdata/verif/ecfadm_vfldCMEPS_preop/vfldCMEPS_preopmbr001201911090054
-rwxr-xr-x. 1 mcoop.u mcoopgu 0 Nov  9 02:39 /data/proj/metcoop/mc-20-utv/opdata/verif/ecfadm_vfldCMEPS_preop/vfldCMEPS_preopmbr001201911090054

gives the following fatal error

Reading: /data/proj/metcoop/mc-20-utv/opdata/verif/ecfadm_vfldCMEPS_preop/vfldCMEPS_preopmbr001201911090054
Warning: Unable to read: /data/proj/metcoop/mc-20-utv/opdata/verif/ecfadm_vfldCMEPS_preop/vfldCMEPS_preopmbr001201911090054

Error: Column `p` not found in `.data`
Backtrace:
     █
  1. ├─harpIO::read_eps_interpolate(...)
  2. │ └─`%>%`(...)
  3. │   ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  4. │   └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
  5. │     └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
  6. │       └─harpIO:::`_fseq`(`_lhs`)
  7. │         └─magrittr::freduce(value, `_function_list`)
  8. │           ├─base::withVisible(function_list[[k]](value))
  9. │           └─function_list[[k]](value)
 10. │             ├─dplyr::mutate(...)
 11. │             └─dplyr:::mutate.tbl_df(...)
 12. │               └─dplyr:::mutate_impl(.data, dots, caller_env())
 13. ├─purrr::map2(...)
 14. │ └─harpIO:::.f(.x[[i]], .y[[i]], ...)
 15. │   └─harpIO:::read_function(...)
 16. │     └─`%>%`(...)
 17. │       ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
 18. │       └─base::
In addition: Warning message:
In get("station_list") :
  input string 'Végeirsstadir-i-Fnjoskadal' cannot be translated to UTF-8, is it valid in 'ANSI_X3.4-1968'?
Execution halted
andrew-MET commented 4 years ago

fixed: https://github.com/andrew-MET/harpIO/commit/fd1c1bfc544f30d6d1cd11f47197fd1781309cf8