Tests and Coverage ================ 06 February, 2023 11:40:00 - Coverage - Unit Tests This output is created by [covrpage](https://github.com/yonicd/covrpage). ## Coverage Coverage summary is created using the [covr](https://github.com/r-lib/covr) package. ## โš ๏ธ Not All Tests Passed ## Coverage statistics are approximations of the non-failing tests. ## Use with caution ## ## For further investigation check in testthat summary tables. | Object | Coverage (%) | |:------------------------------------------------------------------------------------------|:------------:| | conmat | 72.37 | | [R/abs_age_education.R](../R/abs_age_education.R) | 0.00 | | [R/age-population-year.R](../R/age-population-year.R) | 0.00 | | [R/autoplot.R](../R/autoplot.R) | 0.00 | | [R/estimate_setting_contacts.R](../R/estimate_setting_contacts.R) | 0.00 | | [R/get_abs_age_work.R](../R/get_abs_age_work.R) | 0.00 | | [R/get_household_size_distribution.R](../R/get_household_size_distribution.R) | 0.00 | | [R/matrix_to_predictions.R](../R/matrix_to_predictions.R) | 0.00 | | [R/model-tidiers.R](../R/model-tidiers.R) | 0.00 | | [R/plot_matrix.R](../R/plot_matrix.R) | 0.00 | | [R/plot_setting_matrices.R](../R/plot_setting_matrices.R) | 0.00 | | [R/get_age_population_function.R](../R/get_age_population_function.R) | 45.45 | | [R/checkers.R](../R/checkers.R) | 46.15 | | [R/utils.R](../R/utils.R) | 50.86 | | [R/constructors.R](../R/constructors.R) | 79.17 | | [R/get-age-population-function-internals.R](../R/get-age-population-function-internals.R) | 79.69 | | [R/conmat-population.R](../R/conmat-population.R) | 87.93 | | [R/get_abs_per_capita_household_size.R](../R/get_abs_per_capita_household_size.R) | 91.23 | | [R/generate-ngm.R](../R/generate-ngm.R) | 92.50 | | [R/get_setting_transmission_matrices.R](../R/get_setting_transmission_matrices.R) | 99.07 | | [R/abbreviate_states.R](../R/abbreviate_states.R) | 100.00 | | [R/abs_household_size_population.R](../R/abs_household_size_population.R) | 100.00 | | [R/abs_per_capita_household_size_lga.R](../R/abs_per_capita_household_size_lga.R) | 100.00 | | [R/abs_per_capita_household_size_state.R](../R/abs_per_capita_household_size_state.R) | 100.00 | | [R/abs-helpers.R](../R/abs-helpers.R) | 100.00 | | [R/add_modelling_features.R](../R/add_modelling_features.R) | 100.00 | | [R/add_offset.R](../R/add_offset.R) | 100.00 | | [R/add_population_age_to.R](../R/add_population_age_to.R) | 100.00 | | [R/add_school_work_participation.R](../R/add_school_work_participation.R) | 100.00 | | [R/add_symmetrical_features.R](../R/add_symmetrical_features.R) | 100.00 | | [R/adjust_household_contact_matrix.R](../R/adjust_household_contact_matrix.R) | 100.00 | | [R/aggregate_predicted_contacts.R](../R/aggregate_predicted_contacts.R) | 100.00 | | [R/apply_vaccination.R](../R/apply_vaccination.R) | 100.00 | | [R/extrapolate_polymod.R](../R/extrapolate_polymod.R) | 100.00 | | [R/fit_setting_contacts.R](../R/fit_setting_contacts.R) | 100.00 | | [R/fit_single_contact_model.R](../R/fit_single_contact_model.R) | 100.00 | | [R/get_polymod_contact_data.R](../R/get_polymod_contact_data.R) | 100.00 | | [R/get_polymod_per_capita_household_size.R](../R/get_polymod_per_capita_household_size.R) | 100.00 | | [R/get_polymod_population.R](../R/get_polymod_population.R) | 100.00 | | [R/get_polymod_setting_data.R](../R/get_polymod_setting_data.R) | 100.00 | | [R/per_capita_household_size.R](../R/per_capita_household_size.R) | 100.00 | | [R/predict_contacts_1y.R](../R/predict_contacts_1y.R) | 100.00 | | [R/predict_contacts.R](../R/predict_contacts.R) | 100.00 | | [R/predict_setting_contacts.R](../R/predict_setting_contacts.R) | 100.00 | | [R/predictions_to_matrix.R](../R/predictions_to_matrix.R) | 100.00 |
## Unit Tests Unit Test summary is created using the [testthat](https://github.com/r-lib/testthat) package. | file | n | time | error | failed | skipped | warning | icon | |:--------------------------------------------------------------------------------|----:|------:|------:|-------:|--------:|--------:|:-----| | [test-abbreviation.R](testthat/test-abbreviation.R) | 2 | 0.073 | 0 | 0 | 0 | 0 | | | [test-abs-age-lga.R](testthat/test-abs-age-lga.R) | 2 | 0.072 | 0 | 0 | 0 | 0 | | | [test-apply_vaccination.R](testthat/test-apply_vaccination.R) | 3 | 0.080 | 0 | 0 | 0 | 0 | | | [test-autoplot.R](testthat/test-autoplot.R) | 5 | 0.005 | 0 | 0 | 5 | 0 | ๐Ÿ”ถ | | [test-check_dimensions.R](testthat/test-check_dimensions.R) | 3 | 0.078 | 0 | 0 | 0 | 0 | | | [test-check-if-data-list.R](testthat/test-check-if-data-list.R) | 10 | 3.105 | 0 | 0 | 0 | 8 | โš ๏ธ | | [test-check-lga-name.R](testthat/test-check-lga-name.R) | 3 | 0.052 | 0 | 0 | 0 | 0 | | | [test-check-state-name.R](testthat/test-check-state-name.R) | 2 | 0.098 | 0 | 0 | 0 | 0 | | | [test-conmat-population.R](testthat/test-conmat-population.R) | 2 | 0.066 | 0 | 0 | 0 | 0 | | | [test-extrapolate-polymod.R](testthat/test-extrapolate-polymod.R) | 2 | 0.028 | 0 | 0 | 0 | 0 | | | [test-fit-single-contact-model.R](testthat/test-fit-single-contact-model.R) | 6 | 0.494 | 0 | 0 | 0 | 0 | | | [test-generate-ngm.R](testthat/test-generate-ngm.R) | 6 | 0.132 | 0 | 0 | 0 | 0 | | | [test-get-polymod-population.R](testthat/test-get-polymod-population.R) | 11 | 2.376 | 0 | 2 | 0 | 4 | ๐Ÿ›‘โš ๏ธ | | [test-lga_household_works.R](testthat/test-lga_household_works.R) | 2 | 3.960 | 0 | 0 | 0 | 0 | | | [test-models-fit-with-furrr.R](testthat/test-models-fit-with-furrr.R) | 11 | 0.106 | 0 | 0 | 0 | 0 | | | [test-per_capita_household_size.R](testthat/test-per_capita_household_size.R) | 4 | 0.162 | 0 | 0 | 0 | 0 | | | [test-predict-contacts.R](testthat/test-predict-contacts.R) | 8 | 0.096 | 0 | 0 | 0 | 0 | | | [test-print-conmat-matrix-method.R](testthat/test-print-conmat-matrix-method.R) | 2 | 0.069 | 0 | 0 | 0 | 0 | |
Show Detailed Test Results | file | context | test | status | n | time | icon | |:-------------------------------------------------------------------------------------|:---------------------------|:-------------------------------------------------------------------|:--------|----:|------:|:-----| | [test-abbreviation.R](testthat/test-abbreviation.R#L2) | abbreviation | abs_abbreviate_states() works | PASS | 1 | 0.040 | | | [test-abbreviation.R](testthat/test-abbreviation.R#L6) | abbreviation | abs_unabbreviate_states() works | PASS | 1 | 0.033 | | | [test-abs-age-lga.R](testthat/test-abs-age-lga.R#L2) | abs-age-lga | abs_age_lga() returns the right shape works | PASS | 1 | 0.051 | | | [test-abs-age-lga.R](testthat/test-abs-age-lga.R#L6_L8) | abs-age-lga | abs_age_lga() returns the right shape errors | PASS | 1 | 0.021 | | | [test-apply_vaccination.R](testthat/test-apply_vaccination.R#L20_L27) | apply_vaccination | apply_vaccination() returns expected matrices | PASS | 1 | 0.002 | | | [test-apply_vaccination.R](testthat/test-apply_vaccination.R#L31_L39) | apply_vaccination | apply_vaccination() errors when thereโ€™s an incorrect variable name | PASS | 1 | 0.028 | | | [test-apply_vaccination.R](testthat/test-apply_vaccination.R#L43_L45) | apply_vaccination | apply_vaccination() produces expected output | PASS | 1 | 0.050 | | | [test-autoplot.R](testthat/test-autoplot.R#L39) | autoplot | autoplot works for age matrix | SKIPPED | 1 | 0.000 | ๐Ÿ”ถ | | [test-autoplot.R](testthat/test-autoplot.R#L51) | autoplot | autoplot works for setting prediction matrix | SKIPPED | 1 | 0.004 | ๐Ÿ”ถ | | [test-autoplot.R](testthat/test-autoplot.R#L60) | autoplot | autoplot works for NGMs | SKIPPED | 1 | 0.000 | ๐Ÿ”ถ | | [test-autoplot.R](testthat/test-autoplot.R#L69) | autoplot | autoplot works for vaccination setting matrices | SKIPPED | 1 | 0.000 | ๐Ÿ”ถ | | [test-autoplot.R](testthat/test-autoplot.R#L78) | autoplot | autoplot works for transmission probability matrices | SKIPPED | 1 | 0.001 | ๐Ÿ”ถ | | [test-check_dimensions.R](testthat/test-check_dimensions.R#L16_L19) | check_dimensions | check_dimensions() returns nothing when compatible dimensions | PASS | 1 | 0.002 | | | [test-check_dimensions.R](testthat/test-check_dimensions.R#L33_L36) | check_dimensions | check_dimensions() returns error | PASS | 1 | 0.043 | | | [test-check_dimensions.R](testthat/test-check_dimensions.R#L54_L62) | check_dimensions | apply_vaccination gives error when incompatible dimensions present | PASS | 1 | 0.033 | | | [test-check-if-data-list.R](testthat/test-check-if-data-list.R#L3) | check-if-data-list | check_if_list() returns error when argument class is not a list | WARNING | 5 | 1.587 | โš ๏ธ | | [test-check-if-data-list.R](testthat/test-check-if-data-list.R#L9) | check-if-data-list | check_if_list() returns nothing when argument class is a list | WARNING | 5 | 1.518 | โš ๏ธ | | [test-check-lga-name.R](testthat/test-check-lga-name.R#L2) | check-lga-name | check_lga_name() returns the right shape | PASS | 1 | 0.006 | | | [test-check-lga-name.R](testthat/test-check-lga-name.R#L6_L9) | check-lga-name | check_lga_name() errors when thereโ€™s an incorrect name | PASS | 1 | 0.024 | | | [test-check-lga-name.R](testthat/test-check-lga-name.R#L13_L16) | check-lga-name | check_lga_name() errors when the name is ambiguous | PASS | 1 | 0.022 | | | [test-check-state-name.R](testthat/test-check-state-name.R#L2) | check-state-name | abs_age_state() returns the right shape | PASS | 1 | 0.068 | | | [test-check-state-name.R](testthat/test-check-state-name.R#L6_L9) | check-state-name | abs_age_state() returns an error | PASS | 1 | 0.030 | | | [test-conmat-population.R](testthat/test-conmat-population.R#L5_L11) | conmat-population | conmat_population works | PASS | 1 | 0.033 | | | [test-conmat-population.R](testthat/test-conmat-population.R#L15_L21) | conmat-population | as_conmat_population works | PASS | 1 | 0.033 | | | [test-extrapolate-polymod.R](testthat/test-extrapolate-polymod.R#L8) | extrapolate-polymod | Matrix is named appropriately | PASS | 1 | 0.014 | | | [test-extrapolate-polymod.R](testthat/test-extrapolate-polymod.R#L13) | extrapolate-polymod | Matrix dimensions are kept | PASS | 1 | 0.014 | | | [test-fit-single-contact-model.R](testthat/test-fit-single-contact-model.R#L23) | fit-single-contact-model | Model returns bam model | PASS | 2 | 0.001 | | | [test-fit-single-contact-model.R](testthat/test-fit-single-contact-model.R#L28) | fit-single-contact-model | Model coefficients are the same | PASS | 2 | 0.035 | | | [test-fit-single-contact-model.R](testthat/test-fit-single-contact-model.R#L33_L39) | fit-single-contact-model | Model fits | PASS | 2 | 0.458 | | | [test-generate-ngm.R](testthat/test-generate-ngm.R#L27) | generate-ngm | the three variants of the generate_ngm produce the same result | PASS | 3 | 0.005 | | | [test-generate-ngm.R](testthat/test-generate-ngm.R#L33_L35) | generate-ngm | NGMs from each generate_ngm type return the same object | PASS | 3 | 0.127 | | | [test-get-polymod-population.R](testthat/test-get-polymod-population.R#L4) | get-polymod-population | get_polymod_contact_data() works | FAILED | 1 | 0.505 | ๐Ÿ›‘ | | [test-get-polymod-population.R](testthat/test-get-polymod-population.R#L10) | get-polymod-population | get_polymod_population() works | FAILED | 1 | 0.113 | ๐Ÿ›‘ | | [test-get-polymod-population.R](testthat/test-get-polymod-population.R#L16) | get-polymod-population | get_polymod_setting_data() and derivatives work | WARNING | 9 | 1.758 | โš ๏ธ | | [test-lga_household_works.R](testthat/test-lga_household_works.R#L6_L9) | lga_household_works | get_abs_per_capita_household_size errors for some lgas | PASS | 1 | 3.428 | | | [test-lga_household_works.R](testthat/test-lga_household_works.R#L23_L26) | lga_household_works | check_lga_name errors for some lgas | PASS | 1 | 0.532 | | | [test-models-fit-with-furrr.R](testthat/test-models-fit-with-furrr.R#L28) | models-fit-with-furrr | list names are kept | PASS | 2 | 0.028 | | | [test-models-fit-with-furrr.R](testthat/test-models-fit-with-furrr.R#L33) | models-fit-with-furrr | Model fits | PASS | 4 | 0.001 | | | [test-models-fit-with-furrr.R](testthat/test-models-fit-with-furrr.R#L40) | models-fit-with-furrr | Model coefficients are the same | PASS | 4 | 0.059 | | | [test-models-fit-with-furrr.R](testthat/test-models-fit-with-furrr.R#L47) | models-fit-with-furrr | Matrix dims are kept | PASS | 1 | 0.018 | | | [test-per_capita_household_size.R](testthat/test-per_capita_household_size.R#L4) | per_capita_household_size | refactored code works | PASS | 1 | 0.052 | | | [test-per_capita_household_size.R](testthat/test-per_capita_household_size.R#L8_L11) | per_capita_household_size | refactored code works with lga | PASS | 1 | 0.094 | | | [test-per_capita_household_size.R](testthat/test-per_capita_household_size.R#L16) | per_capita_household_size | errors when given incorrect state | PASS | 1 | 0.009 | | | [test-per_capita_household_size.R](testthat/test-per_capita_household_size.R#L21) | per_capita_household_size | errors when given incorrect lga | PASS | 1 | 0.007 | | | [test-predict-contacts.R](testthat/test-predict-contacts.R#L27) | predict-contacts | predict_contacts() works | PASS | 5 | 0.053 | | | [test-predict-contacts.R](testthat/test-predict-contacts.R#L38) | predict-contacts | predictions_to_matrix() works | PASS | 3 | 0.043 | | | [test-print-conmat-matrix-method.R](testthat/test-print-conmat-matrix-method.R#L8) | print-conmat-matrix-method | Print method for setting prediction matrices works | PASS | 2 | 0.069 | | | Failed | Warning | Skipped | |:-------|:--------|:--------| | ๐Ÿ›‘ | โš ๏ธ | ๐Ÿ”ถ |
Session Info | Field | Value | |:---------|:--------------------------------| | Version | R version 4.2.2 (2022-10-31) | | Platform | aarch64-apple-darwin20 (64-bit) | | Running | macOS Ventura 13.2 | | Language | en_US | | Timezone | Australia/Hobart | | Package | Version | |:---------|:--------| | testthat | 3.1.6 | | covr | 3.6.1 | | covrpage | 0.2 |