docs: Add link to PM_model$fit in internal function fit#49
Closed
docs: Add link to PM_model$fit in internal function fit#49
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the documentation for the internal fit function by adding a note that it should not be called directly and providing a cross-reference to the public PM_model$fit() method. This addresses user confusion when using ?fit, which currently redirects to the low-level Rust function instead of the intended public API.
Key Changes
- Added documentation notes indicating
fitis an internal function - Added cross-reference to
PM_model$fit()method for users seeking help - Updated both Rust source and R wrapper documentation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/rust/src/lib.rs | Added roxygen2-style documentation comments to the Rust fit function noting it's internal and referencing PM_model$fit() |
| R/extendr-wrappers.R | Added roxygen2 documentation to the R wrapper for fit with internal function note and cross-reference |
| man/fit.Rd | Generated documentation file updated with the new internal function notice and cross-reference |
Comments suppressed due to low confidence (1)
R/extendr-wrappers.R:61
- Since this is documented as an internal function that should not be called directly, it should include the
@keywords internaltag for consistency with other internal exported functions in the codebase (e.g., see setup_logs at line 77-79). Add#' @keywords internalbefore the@exporttag.
#' Fits the model at the given path to the data at the given path using the provided parameters.
#' NOTE: This is an internal function and should not be called directly.
#' See [PM_model] `$fit()` method for arguments.
#' @param model_path Path to the compiled model file.
#' @param data Path to the data file.
#' @param params List of fitting parameters.
#' @param output_path Path to save the fitting results.
#' @param kind Kind of model, which can either be "ODE" or "Analytical".
#' @return Result of the fitting process.
#' @export
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the user simply uses
?fit, they are redirected to the Rust function.I wonder if this function should not be made public, as it is not meant for users to call directly.