Skip to content

Commit

Permalink
Doc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dipterix committed Oct 31, 2024
1 parent 44c5485 commit aef2ed3
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 59 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ieegio
Title: File IO for Intracranial Electroencephalography
Version: 0.0.1.9002
Version: 0.0.2
Language: en-US
Encoding: UTF-8
Authors@R:
Expand Down Expand Up @@ -35,10 +35,10 @@ Imports:
rpyANTs (>= 0.0.3),
stringr,
utils,
hdf5r,
yaml
Suggests:
reticulate,
hdf5r,
rgl,
rpymat (>= 0.1.7),
RNifti (>= 1.7.0),
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# ieegio 0.0.2

* Added `h5py` as an alternative back-end support
* Fixed a bug where images are not loaded correctly due to image format being ignored
* Fixed `Torig` (index to `tkr` coordinate transform) issue
* Fixed a global variable issue
* Fixed a bug where file name is not respected


# ieegio 0.0.1

* Initial CRAN submission.
2 changes: 1 addition & 1 deletion R/hdf5-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ensure_hdf5_backend <- local({
rpymat$import("h5py")
},
error = function(e) {
rpymat$add_packages("h5py")
ensure_py_package("h5py")
rpymat$import("h5py")
}
)
Expand Down
7 changes: 7 additions & 0 deletions R/nifti.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ io_read_nii <- function(file, method = c("oro", "rnifti", "ants"), header_only =

},
"ants" = {
if(!rpyANTs::ants_available(module = "ants")) {
if(dir.exists(rpymat::env_path())) {
rpyANTs::install_ants(python_ver = "auto")
} else {
rpyANTs::install_ants()
}
}
volume <- rpyANTs::as_ANTsImage(file, ...)
header <- volume
shape <- unlist(rpymat::py_to_r(volume$shape))
Expand Down
1 change: 1 addition & 0 deletions R/nwb-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ NWBHDF5IO <- R6::R6Class(
private$construct_params <- list(
path = path, mode = mode, ...
)
ensure_py_package("pynwb")
},

#' @description
Expand Down
57 changes: 1 addition & 56 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,3 @@
## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.

Respond to the `CRAN` comment:

```
If there are references describing the methods in your package, please add these in the description field of your DESCRIPTION file in the form
authors (year) <doi:...>
authors (year, ISBN:...)
or if those are not available: <https:...>
with no space after 'doi:', 'https:' and angle brackets for auto-linking. (If you want to add a title as well please put it in quotes: "Title")
```

Currently I don't have any publication that can be referenced in the `DESCRIPTION` file. The scripts are mostly derived from my personal code base.

```
You have examples for unexported functions. Please either omit these examples or export these functions.
Examples for unexported function
io_write_fst() in:
read_nwb.Rd
```

Thanks, function `io_write_fst` has been exported. There is no `io_write_fst()` call in `read_nwb.Rd` now.


```
Only functions which are supposed to only run interactively (e.g. shiny) should be wrapped in if(interactive()). Please replace if(interactive()){} if possible.
-> ieegio_sample_data.Rd; low-level-read-write.Rd
```

Thanks, I removed all `if(interactive()){}` (2 sites), and wrapped with `dontrun` as these examples require downloading external data or additional configurations.


```
Please make sure that you do not change the user's options, par or working directory. If you really have to do so within functions, please ensure with an *immediate* call of on.exit() that the settings are reset when the function is exited.
e.g.:
...
oldpar <- par(no.readonly = TRUE) # code line i
on.exit(par(oldpar)) # code line i + 1
...
par(mfrow=c(2,2)) # somewhere after
...
e.g.: -> R/samples.R
If you're not familiar with the function, please check ?on.exit. This function makes it possible to restore options before exiting a function even if the function breaks. Therefore it needs to be called immediately after the option change within a function.
```

Thanks, I added `on.exit` as instructed except for `ieegio_debug()`. This function is designed to change the option `ieegio.debug`, which should be controlled by this package.

```
Please ensure that your functions do not write by default or in your examples/vignettes/tests in the user's home filespace (including the package directory and getwd()). This is not allowed by CRAN policies. Please omit any default path in writing functions. In your examples/vignettes/tests you can write to tempdir().
-> R/samples.R; R/edf.R
```

Thanks. Those code are commented out. More specifically function `update_sample_registry` was removed (commented). I don't find anything in `R/edf.R` that writes to home or working directories. Maybe I missed it. My doubt is some (already) commented code such as Line-648 triggered this warning?
0 errors | 0 warnings | 0 notes
5 changes: 5 additions & 0 deletions tests/testthat/test-hdf5.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ test_that("HDF5 IO with R backend", {
Sys.unsetenv("IEEGIO_USE_H5PY")
})

h5py <- ensure_hdf5_backend()

# Skip if h5py is null (no python)
testthat::skip_if(is.null(h5py))

x <- array(1:24, c(1,2,3,1,4,1))

f <- tempfile()
Expand Down

0 comments on commit aef2ed3

Please sign in to comment.