Repository navigation
Anchor replicate folder and raster label parsing - #15
Merged
Merged
Conversation
findOldSimFiles() searched any folder with rep<digits> in its path, and rasterListByPoly() cut polygon names at '.' or '_'. Drops purrr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
usethis::use_version("dev") after the replicate label parsing fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
achubaty
force-pushed
the
fix-replicate-label-parsing
branch
from
November 26, 2026 03:22
3916106 to
e2871fb
Compare
Formatting only, so the next commit's one-line change stands alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bare call resolved to purrr's transpose(), whose import is now gone; landmine_burn1() already uses data.table's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Fixes two parsing defects in the replicate output helpers. No new dependencies; purrr is dropped from Imports.
findOldSimFiles(): fs matchesdir_ls(regexp =)against the whole path, and the patternrep([0-9])+was unanchored, so any folder withrepand a digit anywhere in its path was searched (every folder, when the output path itself contained one). The pattern now matches only a folder namedrepplus digits.rasterListByPoly(): labels<repXX>.<prefix>_year<YYYY>_<polyName>were split on.and_, so a polygon name containing either was cut short, andfilterwas applied as a regular expression. Each label is now parsed with one anchored pattern (as in nrvtools'.parse_metric_labels()), and a label that does not match is an error.filteris no longer used; it stays in the signature. The returned attributes (reps,times,polyNames) keep their types.landmine_burn()called a baretranspose()that resolved through the purrr import; it now callsdata.table::transpose(), aslandmine_burn1()does.R/landmine.Ris air-formatted in its own commit (parse-identical) so that one-line change stands alone.Tests: new
test-simfiles.R(an output path and a sibling folder that containrep1, besiderep01/rep10; absolute and relative paths) andtest-rasterListByPoly.R(polygon nameUnit_A.1; a file name without a year). Both fail on the old code. Locally on the rebased branch: full suite 332 tests, 1767 expectations, none failed or skipped; R CMD check 0 errors, 0 warnings, 0 notes.Version 1.1.0.9003 (rebased on #14, which took 9002).
🤖 Generated with Claude Code