Skip to content

Add cache_stan_model parameter to relevant functions and update docum… #222

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

Merged
merged 3 commits into from
Jul 21, 2025

Conversation

stemangiola
Copy link
Collaborator

…entation

Introduced a new parameter, cache_stan_model, to functions including sccomp_estimate, sccomp_replicate, simulate_data, and sccomp_remove_outliers. This parameter specifies the cache directory for compiled Stan models, ensuring version isolation. Updated documentation and tests to reflect these changes, ensuring proper functionality and default settings.

…entation

Introduced a new parameter, cache_stan_model, to functions including sccomp_estimate, sccomp_replicate, simulate_data, and sccomp_remove_outliers. This parameter specifies the cache directory for compiled Stan models, ensuring version isolation. Updated documentation and tests to reflect these changes, ensuring proper functionality and default settings.
@stemangiola stemangiola requested a review from Copilot July 19, 2025 05:53
@stemangiola stemangiola linked an issue Jul 19, 2025 that may be closed by this pull request
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the cache_stan_model parameter to various sccomp functions to improve Stan model caching and version isolation. The parameter allows users to specify custom cache directories for compiled Stan models, with automatic appending of the sccomp version to prevent conflicts between package versions.

  • Adds cache_stan_model parameter to core functions: sccomp_estimate, sccomp_replicate, simulate_data, and sccomp_remove_outliers
  • Updates the global cache directory variable to not include version information by default (version is added in load_model when needed)
  • Comprehensive test suite to verify parameter availability, default values, and caching functionality with version isolation

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/testthat/test-cache_stan_model.R New test file validating cache_stan_model parameter functionality and version isolation
man/*.Rd Documentation updates adding cache_stan_model parameter descriptions to function help pages
R/utilities.R Modifies global cache directory variable to exclude version (moved to load_model function)
R/*.R Adds cache_stan_model parameter to function signatures and passes it through to load_model calls
NAMESPACE Exports the sccomp_stan_models_cache_dir variable


# Clean up
unlink(expected_cache_dir, recursive = TRUE)
})
Copy link
Preview

Copilot AI Jul 19, 2025

Choose a reason for hiding this comment

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

There's an extra space before the closing brace. Remove the trailing space for consistency.

Suggested change
})
})

Copilot uses AI. Check for mistakes.

@stemangiola stemangiola merged commit 09288de into master Jul 21, 2025
10 checks passed
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.

custom model cache dir
1 participant