prioritizr / prioritizr

Compare 70cc07f ... +2 ... 0197bdd

Coverage Reach
R/problem.R R/planning_unit_solution_status.R R/eval_replacement_importance.R R/marxan_problem.R R/presolve_check.R R/eval_ferrier_importance.R R/add_cbc_solver.R R/add_linear_constraints.R R/parameters.R R/eval_rare_richness_importance.R R/add_neighbor_constraints.R R/add_linear_penalties.R R/add_feature_contiguity_constraints.R R/solve.R R/add_lpsymphony_solver.R R/add_rsymphony_solver.R R/marxan_connectivity_data_to_matrix.R R/add_locked_in_constraints.R R/add_manual_targets.R R/add_boundary_penalties.R R/add_locked_out_constraints.R R/add_connectivity_penalties.R R/add_manual_locked_constraints.R R/internal.R R/add_asym_connectivity_penalties.R R/eval_asym_connectivity_summary.R R/eval_connectivity_summary.R R/add_manual_bounded_constraints.R R/compile.R R/boundary_matrix.R R/add_contiguity_constraints.R R/zones.R R/eval_target_coverage_summary.R R/add_shuffle_portfolio.R R/intersecting_units.R R/add_max_phylo_end_objective.R R/add_feature_weights.R R/eval_feature_representation_summary.R R/fast_extract.R R/simulate.R R/add_max_phylo_div_objective.R R/add_loglinear_targets.R R/connectivity_matrix.R R/add_absolute_targets.R R/proximity_matrix.R R/add_relative_targets.R R/adjacency_matrix.R R/eval_boundary_summary.R R/rij_matrix.R R/write_problem.R R/predefined_optimization_problem.R R/add_min_largest_shortfall_objective.R R/add_cuts_portfolio.R R/add_max_utility_objective.R R/add_min_shortfall_objective.R R/add_max_features_objective.R R/OptimizationProblem-methods.R R/add_max_cover_objective.R R/pproto.R R/category_vector.R R/loglinear_interpolation.R R/add_mandatory_allocation_constraints.R R/add_semicontinuous_decisions.R R/feature_abundances.R R/distribute_load.R R/eval_cost_summary.R R/eval_n_summary.R R/binary_stack.R R/add_min_set_objective.R R/run_calculations.R R/add_binary_decisions.R R/add_proportion_decisions.R R/category_layer.R R/Id.R R/branch_matrix.R R/misc.R R/number_of_zones.R R/number_of_features.R R/feature_names.R R/zone_names.R R/number_of_planning_units.R R/tbl_df.R R/number_of_total_units.R R/add_default_objective.R R/targets.R R/add_default_decisions.R R/waiver.R R/new_optimization_problem.R R/add_default_portfolio.R R/marxan_boundary_data_to_matrix.R src/rcpp_apply_feature_contiguity_constraints.cpp src/rcpp_boundary_data.cpp src/rcpp_apply_contiguity_constraints.cpp src/optimization_problem.cpp src/rcpp_apply_boundary_penalties.cpp src/rcpp_apply_max_phylo_objective.cpp src/rcpp_apply_asym_connectivity_penalties.cpp src/rcpp_apply_min_largest_shortfall_objective.cpp src/rcpp_apply_connectivity_penalties.cpp src/rcpp_ferrier_score.cpp src/rcpp_apply_max_cover_objective.cpp src/rcpp_apply_max_utility_objective.cpp src/rcpp_add_rij_data.cpp src/rcpp_apply_max_features_objective.cpp src/rcpp_apply_min_shortfall_objective.cpp src/rcpp_boundary_data.h src/rcpp_apply_neighbor_constraints.cpp src/rcpp_sp_to_polyset.cpp src/rcpp_boundary.cpp src/rcpp_summarize_exactextractr.cpp src/rcpp_branch_matrix.cpp src/optimization_problem.h src/rcpp_absolute_amount_held_by_solution.cpp src/rcpp_apply_min_set_objective.cpp src/functions.cpp src/rcpp_list_to_matrix_indices.cpp src/rcpp_apply_linear_penalties.cpp src/rcpp_forbid_solution.cpp src/rcpp_connectivity.cpp src/rcpp_asym_connectivity.cpp src/rcpp_add_zones_constraints.cpp src/rcpp_apply_decisions.cpp src/rcpp_add_linear_constraints.cpp src/rcpp_apply_feature_weights.cpp src/rcpp_apply_bounded_constraints.cpp src/rcpp_apply_locked_constraints.cpp src/functions.h src/init.c

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 9 files from the diff.

@@ -288,24 +288,25 @@
Loading
288 288
  assertthat::assert_that(
289 289
    inherits(x, "ConservationProblem"),
290 290
    is.matrix(solution))
291 +
  # convert NAs in solution to zeros
292 +
  solution[is.na(solution)] <- 0
291 293
  # calculate amount of each feature in each planning unit
292 294
  total <- x$feature_abundances_in_total_units()
293 295
  held <- vapply(
294 296
    seq_len(x$number_of_zones()),
295 297
    FUN.VALUE = numeric(nrow(x$data$rij_matrix[[1]])),
296 298
    function(i) {
297 -
      Matrix::rowSums(
298 -
        x$data$rij_matrix[[i]] *
299 +
      as.numeric(
300 +
        x$data$rij_matrix[[i]] %*%
299 301
        Matrix::Matrix(
300 302
          solution[, i],
301 -
          ncol = nrow(solution),
302 -
          nrow = nrow(x$data$rij_matrix[[1]]),
303 -
          byrow = TRUE,
304 -
          sparse = FALSE
305 -
        ),
306 -
        na.rm = TRUE
303 +
          ncol = 1,
304 +
          nrow = nrow(solution),
305 +
          sparse = TRUE
306 +
        )
307 307
      )
308 -
  })
308 +
    }
309 +
  )
309 310
  # prepare output
310 311
  if (x$number_of_zones() == 1) {
311 312
    out <- tibble::tibble(

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R -<.01% 98.39%
src 98.22%
Project Totals (128 files) 98.34%
Loading