Skip to content

Commit

Permalink
rename optional_data functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsp-spirit committed Jun 17, 2020
1 parent e7cc926 commit d745698
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Version 0.1.11
- add support for writing GIFTI format annotations
- export rotate2D and flip2D to namespace
- add support for reading transformation matrices from xfm files: read.fs.transform
- rename all optional data functions: replace optional_data with opt_data in function names to prevent clash with fsbrain names


Version 0.1.10
Expand Down
8 changes: 4 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ S3method(read_nisurfacefile,fsnative)
S3method(read_nisurfacefile,gifti)
export(cdata)
export(colortable.from.annot)
export(delete_all_optional_data)
export(download_optional_data)
export(delete_all_opt_data)
export(download_opt_data)
export(faces.quad.to.tris)
export(flip2D)
export(flip3D)
export(fs.get.morph.file.ext.for.format)
export(fs.get.morph.file.format.from.filename)
export(fs.patch)
export(get_optional_data_filepath)
export(get_opt_data_filepath)
export(gifti_writer)
export(gifti_xml)
export(gifti_xml_add_global_metadata)
Expand All @@ -29,7 +29,7 @@ export(is.fs.annot)
export(is.fs.label)
export(is.fs.surface)
export(is.fs.volume)
export(list_optional_data)
export(list_opt_data)
export(mghheader.centervoxelRAS.from.firstvoxelRAS)
export(mghheader.crs.orientation)
export(mghheader.is.conformed)
Expand Down
8 changes: 4 additions & 4 deletions R/optdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#'
#' @export
#' @importFrom pkgfilecache get_pkg_info ensure_files_available
download_optional_data <- function() {
download_opt_data <- function() {
pkg_info = pkgfilecache::get_pkg_info("freesurferformats");

# Replace these with your optional data files.
Expand Down Expand Up @@ -94,7 +94,7 @@ download_optional_data <- function() {
#'
#' @export
#' @importFrom pkgfilecache get_pkg_info list_available
list_optional_data <- function() {
list_opt_data <- function() {
pkg_info = pkgfilecache::get_pkg_info("freesurferformats");
return(pkgfilecache::list_available(pkg_info));
}
Expand All @@ -110,7 +110,7 @@ list_optional_data <- function() {
#'
#' @export
#' @importFrom pkgfilecache get_pkg_info get_filepath
get_optional_data_filepath <- function(filename, mustWork=TRUE) {
get_opt_data_filepath <- function(filename, mustWork=TRUE) {
pkg_info = pkgfilecache::get_pkg_info("freesurferformats");
return(pkgfilecache::get_filepath(pkg_info, filename, mustWork=mustWork));
}
Expand All @@ -122,7 +122,7 @@ get_optional_data_filepath <- function(filename, mustWork=TRUE) {
#'
#' @export
#' @importFrom pkgfilecache get_pkg_info erase_file_cache
delete_all_optional_data <- function() {
delete_all_opt_data <- function() {
pkg_info = pkgfilecache::get_pkg_info("freesurferformats");
return(pkgfilecache::erase_file_cache(pkg_info));
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/download_optional_data.Rd → man/download_opt_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/list_optional_data.Rd → man/list_opt_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions tests/testthat/test-read-fs-surface.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
test_that("Our demo surface file can be read using read.fs.surface", {

skip_if(tests_running_on_cran_under_macos(), message = "Skipping on CRAN under MacOS, required test data cannot be downloaded.");
freesurferformats::download_optional_data();
subjects_dir = freesurferformats::get_optional_data_filepath("subjects_dir");
freesurferformats::download_opt_data();
subjects_dir = freesurferformats::get_opt_data_filepath("subjects_dir");
surface_file = file.path(subjects_dir, "subject1", "surf", "lh.white");
skip_if_not(file.exists(surface_file), message="Test data missing.") ;

Expand Down Expand Up @@ -36,8 +36,8 @@ test_that("Vertex connectivity in the demo surface file is as expected from refe

skip_if(tests_running_on_cran_under_macos(), message = "Skipping on CRAN under MacOS, required test data cannot be downloaded.");

freesurferformats::download_optional_data();
subjects_dir = freesurferformats::get_optional_data_filepath("subjects_dir");
freesurferformats::download_opt_data();
subjects_dir = freesurferformats::get_opt_data_filepath("subjects_dir");
surface_file = file.path(subjects_dir, "subject1", "surf", "lh.white");
skip_if_not(file.exists(surface_file), message="Test data missing.");

Expand All @@ -60,8 +60,8 @@ test_that("The vertices of a face are close to each other", {

skip_if(tests_running_on_cran_under_macos(), message = "Skipping on CRAN under MacOS, required test data cannot be downloaded.");

freesurferformats::download_optional_data();
subjects_dir = freesurferformats::get_optional_data_filepath("subjects_dir");
freesurferformats::download_opt_data();
subjects_dir = freesurferformats::get_opt_data_filepath("subjects_dir");
surface_file = file.path(subjects_dir, "subject1", "surf", "lh.white");
skip_if_not(file.exists(surface_file), message="Test data missing.");

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-write-fs-surface.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ test_that("One can read, write and re-read triangular surface data", {

skip_if(tests_running_on_cran_under_macos(), message = "Skipping on CRAN under MacOS, required test data cannot be downloaded.");

freesurferformats::download_optional_data();
subjects_dir = freesurferformats::get_optional_data_filepath("subjects_dir");
freesurferformats::download_opt_data();
subjects_dir = freesurferformats::get_opt_data_filepath("subjects_dir");
surface_file = file.path(subjects_dir, "subject1", "surf", "lh.white");

skip_if_not(file.exists(surface_file), message="Test data missing.");
Expand Down

0 comments on commit d745698

Please sign in to comment.