Skip to content

Commit

Permalink
improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertocamara committed Mar 12, 2024
1 parent 5f8e828 commit f3e7b13
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 421 deletions.
16 changes: 0 additions & 16 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,10 @@ rlang_env_lock <- function(env) {
invisible(.Call(`_sits_rlang_env_lock`, env))
}

sample_points_inclusion <- function(polymatrix, n_sam_pol) {
.Call(`_sits_sample_points_inclusion`, polymatrix, n_sam_pol)
}

sample_points_crossings <- function(polymatrix, n_sam_pol) {
.Call(`_sits_sample_points_crossings`, polymatrix, n_sam_pol)
}

sample_points_bin <- function(polymatrix, n_sam_pol) {
.Call(`_sits_sample_points_bin`, polymatrix, n_sam_pol)
}

C_max_sampling <- function(x, nrows, ncols, window_size) {
.Call(`_sits_C_max_sampling`, x, nrows, ncols, window_size)
}

bayes_smoother <- function(m, m_nrow, m_ncol, w, sigma, neigh_fraction) {
.Call(`_sits_bayes_smoother`, m, m_nrow, m_ncol, w, sigma, neigh_fraction)
}

bayes_var <- function(m, m_nrow, m_ncol, w, neigh_fraction) {
.Call(`_sits_bayes_var`, m, m_nrow, m_ncol, w, neigh_fraction)
}
Expand Down
5 changes: 1 addition & 4 deletions R/api_tile.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,7 @@ NULL

#' @export
.tile_update_label.default <- function(tile, labels) {
tile <- tibble::as_tibble(tile)
tile <- .cube_find_class(tile)
tile <- .tile_update_label(tile, labels)
return(tile)
stop("tile is not a classified cube")
}

#' @title Get/Set labels
Expand Down
56 changes: 0 additions & 56 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,42 +456,6 @@ BEGIN_RCPP
return R_NilValue;
END_RCPP
}
// sample_points_inclusion
NumericMatrix sample_points_inclusion(const NumericMatrix& polymatrix, const int n_sam_pol);
RcppExport SEXP _sits_sample_points_inclusion(SEXP polymatrixSEXP, SEXP n_sam_polSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const NumericMatrix& >::type polymatrix(polymatrixSEXP);
Rcpp::traits::input_parameter< const int >::type n_sam_pol(n_sam_polSEXP);
rcpp_result_gen = Rcpp::wrap(sample_points_inclusion(polymatrix, n_sam_pol));
return rcpp_result_gen;
END_RCPP
}
// sample_points_crossings
NumericMatrix sample_points_crossings(const NumericMatrix& polymatrix, const int n_sam_pol);
RcppExport SEXP _sits_sample_points_crossings(SEXP polymatrixSEXP, SEXP n_sam_polSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const NumericMatrix& >::type polymatrix(polymatrixSEXP);
Rcpp::traits::input_parameter< const int >::type n_sam_pol(n_sam_polSEXP);
rcpp_result_gen = Rcpp::wrap(sample_points_crossings(polymatrix, n_sam_pol));
return rcpp_result_gen;
END_RCPP
}
// sample_points_bin
NumericMatrix sample_points_bin(const NumericMatrix& polymatrix, const int n_sam_pol);
RcppExport SEXP _sits_sample_points_bin(SEXP polymatrixSEXP, SEXP n_sam_polSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const NumericMatrix& >::type polymatrix(polymatrixSEXP);
Rcpp::traits::input_parameter< const int >::type n_sam_pol(n_sam_polSEXP);
rcpp_result_gen = Rcpp::wrap(sample_points_bin(polymatrix, n_sam_pol));
return rcpp_result_gen;
END_RCPP
}
// C_max_sampling
DataFrame C_max_sampling(const NumericVector& x, int nrows, int ncols, int window_size);
RcppExport SEXP _sits_C_max_sampling(SEXP xSEXP, SEXP nrowsSEXP, SEXP ncolsSEXP, SEXP window_sizeSEXP) {
Expand All @@ -506,22 +470,6 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// bayes_smoother
arma::mat bayes_smoother(const arma::mat& m, const arma::uword m_nrow, const arma::uword m_ncol, const arma::mat& w, const arma::mat& sigma, const double neigh_fraction);
RcppExport SEXP _sits_bayes_smoother(SEXP mSEXP, SEXP m_nrowSEXP, SEXP m_ncolSEXP, SEXP wSEXP, SEXP sigmaSEXP, SEXP neigh_fractionSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const arma::mat& >::type m(mSEXP);
Rcpp::traits::input_parameter< const arma::uword >::type m_nrow(m_nrowSEXP);
Rcpp::traits::input_parameter< const arma::uword >::type m_ncol(m_ncolSEXP);
Rcpp::traits::input_parameter< const arma::mat& >::type w(wSEXP);
Rcpp::traits::input_parameter< const arma::mat& >::type sigma(sigmaSEXP);
Rcpp::traits::input_parameter< const double >::type neigh_fraction(neigh_fractionSEXP);
rcpp_result_gen = Rcpp::wrap(bayes_smoother(m, m_nrow, m_ncol, w, sigma, neigh_fraction));
return rcpp_result_gen;
END_RCPP
}
// bayes_var
arma::mat bayes_var(const arma::mat& m, const arma::uword m_nrow, const arma::uword m_ncol, const arma::mat& w, const double neigh_fraction);
RcppExport SEXP _sits_bayes_var(SEXP mSEXP, SEXP m_nrowSEXP, SEXP m_ncolSEXP, SEXP wSEXP, SEXP neigh_fractionSEXP) {
Expand Down Expand Up @@ -679,11 +627,7 @@ static const R_CallMethodDef CallEntries[] = {
{"_sits_C_temp_iqr", (DL_FUNC) &_sits_C_temp_iqr, 1},
{"_sits_rlang_env_unlock", (DL_FUNC) &_sits_rlang_env_unlock, 1},
{"_sits_rlang_env_lock", (DL_FUNC) &_sits_rlang_env_lock, 1},
{"_sits_sample_points_inclusion", (DL_FUNC) &_sits_sample_points_inclusion, 2},
{"_sits_sample_points_crossings", (DL_FUNC) &_sits_sample_points_crossings, 2},
{"_sits_sample_points_bin", (DL_FUNC) &_sits_sample_points_bin, 2},
{"_sits_C_max_sampling", (DL_FUNC) &_sits_C_max_sampling, 4},
{"_sits_bayes_smoother", (DL_FUNC) &_sits_bayes_smoother, 6},
{"_sits_bayes_var", (DL_FUNC) &_sits_bayes_var, 5},
{"_sits_bayes_smoother_fraction", (DL_FUNC) &_sits_bayes_smoother_fraction, 6},
{"_sits_smooth_sg", (DL_FUNC) &_sits_smooth_sg, 4},
Expand Down
245 changes: 0 additions & 245 deletions src/sample_points.cpp

This file was deleted.

Loading

0 comments on commit f3e7b13

Please sign in to comment.