pvanlaake / CFtime

Work with CF-convention time coordinates and calendars in R
Other
4 stars 0 forks source link

One test fails: `Error in ncvar_size(ncid, varid): error returned from C routine R_nc4_varsize` [ FAIL 1 | WARN 0 | SKIP 0 | PASS 335 ] #5

Closed barracuda156 closed 7 months ago

barracuda156 commented 7 months ago

One test fails:


R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin10.0.0d2 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
> 
> library(testthat)
> library(CFtime)
> 
> test_check("CFtime")
Loading required namespace: ncdf4
Error in R_nc4_varsize on nc_inq_dimlen call: NetCDF: Invalid dimension ID or name
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 335 ]

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-CFtime.R:115:5'): Working with files ───────────────────────────
Error in `ncvar_size(ncid, varid)`: error returned from C routine R_nc4_varsize
Backtrace:
    ▆
 1. └─base::lapply(...) at test-CFtime.R:114:3
 2.   └─CFtime (local) FUN(X[[i]], ...)
 3.     └─ncdf4::nc_open(lf[1]) at test-CFtime.R:115:5
 4.       └─ncdf4:::ncvar_inq(groups[[ig]]$id, ivar - 1)
 5.         └─ncdf4:::ncvar_size(ncid, varid)

[ FAIL 1 | WARN 0 | SKIP 0 | PASS 335 ]
Error: Test failures
Execution halted
pvanlaake commented 7 months ago

This is obviously an error in the ncdf4 package or the underlying NetCDF library. I cannot reproduce it on my development machine. I notice that you are working on a 32-bit PPC system, do you get the same error on a 64-bit system?

Please post package versions and NetCDF library version (type ncdump at a terminal - I get version 4.9.2 on my machine) if you want me to dig a little deeper.

barracuda156 commented 7 months ago

Thank you for responding!

36-100% port -v installed netcdf | grep active
  netcdf @4.9.2_2+dap+gcc13+mpich+netcdf4 (active) requested_variants='+dap+gcc13+mpich+netcdf4' platform='darwin 10' archs='ppc' date='2024-02-06T14:44:34+0800'

36-100% port -v installed R-ncdf4 | grep active
  R-ncdf4 @1.22_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2023-12-12T14:45:02+0800'

I could check on roughly identical system (macOS 10.6) for i368 and x86_64, which would help to understand whether the error is caused by bitness or endianness (or SDK). Probably tomorrow, since right now I am away from Intel hardware.

By the way, maybe it was just never fixed: https://github.com/Unidata/netcdf-c/issues/1481

pvanlaake commented 7 months ago

I looked online as well and this indeed appears to be an issue in the NetCDF library. You may want to report the issue to David Pierce, the developer of ncdf4.

barracuda156 commented 7 months ago

@pvanlaake Thank you very much! I close this issue now, since the bug is in the dependency, not here.