You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add subfolder support to PMAnalysis$get_output_path() method
Enable both unix-style (/) and windows-style () path delimiters
Update list_outputs() to handle nested folder structures
Extend get_artifact() to support subfolder paths in both PMAnalysis and PMProject
Add comprehensive test coverage for nested output directories
Diagram Walkthrough
flowchart LR
A["get_output_path<br/>with subfolders"] -->|"normalize path<br/>delimiters"| B["Create nested<br/>directories"]
B -->|"recursive=TRUE"| C["list_outputs<br/>finds nested files"]
A -->|"support both / and \"| D["get_artifact<br/>finds files<br/>in subfolders"]
C -->|"return PMData<br/>objects"| E["Read/Write<br/>nested outputs"]
Loading
File Walkthrough
Relevant files
Enhancement
3 files
analysis.R
Add subfolder support to get_output_path and list_outputs
write = function(x, ...) {
+ # Stop if path is an existing directory+ if (dir.exists(self$path)) {+ stop("Cannot write to a path that is an existing directory: ", self$path, call. = FALSE)+ }+
# Create the folder in case it doesn't exist
dir.create(dirname(self$path), showWarnings = FALSE, recursive = TRUE)
# For RData files, we need to preserve object names from the original call
ext <- tolower(tools::file_ext(self$path))
if (ext %in% c("rdata", "rda")) {
# ...
} else {
# Call pm_write_file for other file types
pm_write_file(self$path, x, ...)
}
invisible(self)
}
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies an edge case where writing to a path that is an existing directory would fail, and proposes a reasonable guard clause.
✅ All modified and coverable lines are covered by tests.
❌ Your project status has failed because the head coverage (68.13%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.
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
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.
User description
Solves #19
PR Type
Enhancement
Description
Add subfolder support to
PMAnalysis$get_output_path()methodEnable both unix-style (/) and windows-style () path delimiters
Update
list_outputs()to handle nested folder structuresExtend
get_artifact()to support subfolder paths in both PMAnalysis and PMProjectAdd comprehensive test coverage for nested output directories
Diagram Walkthrough
File Walkthrough
3 files
Add subfolder support to get_output_path and list_outputsAuto-create parent directories on write operationsNormalize subfolder IDs in get_artifact method1 files
Add comprehensive tests for nested folder operations2 files
Bump version from 0.1.10 to 0.1.11Update build timestamp and metadata7 files
Document new subfolder support featuresAdd changelog entry for version 0.1.11Update documentation with new subfolder examplesDocument subfolder support in get_output_pathUpdate roxygen documentation for subfolder featureRegenerate HTML documentation with updatesRegenerate reference documentation HTML41 files