Skip to content

Commit

Permalink
Rename TaxonLHTPredictor class
Browse files Browse the repository at this point in the history
  • Loading branch information
d2gex committed Apr 5, 2024
1 parent 32d1dd4 commit 0860b2b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export(FishlifeLHTNameSpace)
export(MixinUtilities)
export(PredictedLHTPicker)
export(TaxaUpdateExtractor)
export(TaxonLHTPredictor)
export(TaxonPredictedLHTGetter)
export(TaxonUpdateExtractor)
export(TaxonUpdatedLHTGetter)
export(UpdatedLHTGenerator)
export(UpdatedLHTPicker)
export(fishlife_context)
Expand Down
2 changes: 1 addition & 1 deletion R/taxon_lht_predictor.R → R/taxon_updated_lht_getter.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @description
#' Class that given some LHTs will fetch their predicted version according to FishLife covariance
TaxonLHTPredictor <- R6::R6Class("TaxonLHTPredictor", inherit = MixinUtilities, public = list(
TaxonUpdatedLHTGetter <- R6::R6Class("TaxonUpdatedLHTGetter", inherit = MixinUtilities, public = list(

master_db = NULL,
estimated_lhts = NULL,
Expand Down
10 changes: 5 additions & 5 deletions R/updated_lht_generator.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ UpdatedLHTGenerator <- R6::R6Class("UpdatedLHTGenerator", public = list(
if (is.null(taxon_details)) {
stop(paste("Unable to find life history traits for taxa", ind_species))
}
taxon_predictor <- TaxonLHTPredictor$new(self$master_db,
taxon_details$estimated_lhts,
taxon_details$estimated_covariance,
species_local_lhts,
self$transform_function_list)
taxon_predictor <- TaxonUpdatedLHTGetter$new(self$master_db,
taxon_details$estimated_lhts,
taxon_details$estimated_covariance,
species_local_lhts,
self$transform_function_list)
updated_lhts[[ind_species]] <- taxon_predictor$predict()
}
return(updated_lhts)
Expand Down
40 changes: 20 additions & 20 deletions man/TaxonLHTPredictor.Rd → man/TaxonUpdatedLHTGetter.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-taxon_update_extractor.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test_that("Extraction and backtransformation of predicted LHT values", {
names(input_lhts) <- unlist(unname(lht_names))

# (2)... Predict ...
t_predictor <- TaxonLHTPredictor$new(
t_predictor <- TaxonUpdatedLHTGetter$new(
testing_db,
estimated_lhts,
estimated_covariance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test_that("Predict LHT for a specific taxa", {
lht_names <- fishlife_context$lht_names[order(names(fishlife_context$lht_names))]
names(input_lhts) <- unlist(unname(lht_names))

t_predictor <- TaxonLHTPredictor$new(
t_predictor <- TaxonUpdatedLHTGetter$new(
testing_db,
estimated_lhts,
estimated_covariance,
Expand Down

0 comments on commit 0860b2b

Please sign in to comment.