Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

215 add unit test for visualisation functionalities #223

Merged
merged 17 commits into from
Nov 3, 2024

Conversation

jpavlich
Copy link
Member

Created automated tests for plotting functions.

To facilitate testing I created the following helper functions:

  • extract_plot_data to retrieve relevant data of a plot into a list
  • compare_lists_with_tolerance and expect_lists_equal_with_tolerance to assure tests will pass on different platforms regardless of float numbers management

@jpavlich jpavlich requested a review from ntorresd October 21, 2024 20:28
model_type = "age"
)

plot <- plot_rhats(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that there is not a export tag for this function. I oppened issue #226 to address this before merging this test to dev.

@ntorresd
Copy link
Member

Thanks a lot @jpavlich! I'm done with my review. Please don't use the rebase and merge option; I'll rebase manually to add some changes to make it compatible with #221, which is already in dev.

@jpavlich
Copy link
Member Author

jpavlich commented Nov 2, 2024

@ntorresd Just pushed the latest changes based on your comments. A few of them I didn't implement, since it may make the test code unnecessarily complex.

jpavlich and others added 15 commits November 3, 2024 13:27
… compared with `expect_equal`.

Added test for `plot_serosurvey` with bins
…, and `plot_rhats`

Moved call to `fit_seromodel` into each test, so it can be skipped with `skip_on_cran`
Co-authored-by: Nicolás Torres Domínguez <45337127+ntorresd@users.noreply.github.com>
Co-authored-by: Nicolás Torres Domínguez <45337127+ntorresd@users.noreply.github.com>
Co-authored-by: Nicolás Torres Domínguez <45337127+ntorresd@users.noreply.github.com>
Co-authored-by: Nicolás Torres Domínguez <45337127+ntorresd@users.noreply.github.com>
Co-authored-by: Nicolás Torres Domínguez <45337127+ntorresd@users.noreply.github.com>
Co-authored-by: Nicolás Torres Domínguez <45337127+ntorresd@users.noreply.github.com>
Co-authored-by: Nicolás Torres Domínguez <45337127+ntorresd@users.noreply.github.com>
… (dev) and fix minor incompatibility

Add `model_type` to `get_foi_index() call`
@ntorresd ntorresd force-pushed the 215-add-unit-test-for-visualisation-functionalities branch from 3da35a8 to 6004729 Compare November 3, 2024 12:35
@ntorresd ntorresd merged commit 09d7c7f into dev Nov 3, 2024
1 of 6 checks passed
@ntorresd ntorresd deleted the 215-add-unit-test-for-visualisation-functionalities branch November 3, 2024 13:21
@ntorresd
Copy link
Member

ntorresd commented Nov 3, 2024

This PR closes #215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants