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

False positive on graphics par() from set_state_inspector() #163

Closed
joshwlambert opened this issue Nov 26, 2024 · 0 comments · Fixed by #166
Closed

False positive on graphics par() from set_state_inspector() #163

joshwlambert opened this issue Nov 26, 2024 · 0 comments · Fixed by #166

Comments

@joshwlambert
Copy link
Member

It's my understanding that simply calling a plotting function changes some of the graphics parameters in the global environment. For example, whether the next plot should be plotted onto a new window (par()$page).

The set_state_inspector() returns warnings when plots are generated when calling devtools::test().

If the plotting function calls on.exit() and restores the graphics parameters this problem is avoided, but on.exit() can lead to issues where the user is trying to modify the graphics parameters globally but they do not persist after the function call (e.g. epiverse-trace/epiparameter#409).

For now I've resolved this issue in {epiparameter} by restoring graphics parameters in each unit test that calls a plotting function, however, this does not scale well and as the title of this issue suggests I feel this is an issue with the state inspector.

Not sure on the best solution, but happy to discuss options.

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 a pull request may close this issue.

1 participant