Skip to content

Clean up codebase for CRAN submission - #19

Merged
mdsumner merged 2 commits into
mainfrom
copilot/remove-empty-file-and-clean-code
Feb 15, 2026
Merged

mdsumner merged 2 commits into
mainfrom
copilot/remove-empty-file-and-clean-code

Conversation

Copilot AI commented Feb 15, 2026 •

Copy link
Copy Markdown
Contributor

Removes dead code and empty files ahead of CRAN submission.

Changes

  • Deleted R/meshplot.R (empty file, 0 bytes)
  • Removed commented-out code from R/ximage.R:
    • Debug statements (browser() calls)
    • Obsolete function calls (elevation(), coastline(), ximage_meshplot())
    • Unused code blocks (fastpng handling, NA processing, par settings)
    • 31-line commented documentation block in ximage_sf_data()

Total: 49 lines removed across 2 files. No functional changes.

Original prompt

Problem

There are code cleanliness issues that should be addressed before CRAN submission:

  1. Empty file: R/meshplot.R is completely empty (0 bytes) and serves no purpose
  2. Commented-out code: Multiple sections of commented-out code in R/ximage.R should be removed for cleaner codebase

Required Changes

1. Remove Empty File

  • Delete R/meshplot.R entirely (it's empty and unused)

2. Clean Up Commented-Out Code in R/ximage.R

Remove or clean up these sections:

Lines 207-211 (fastpng raw output):

  ## fastpng raw output
  # if (is.raw(x) && all(c("width", "height", "depth") %in% names(attributes(x)))) {
  #   attrs <- attributes(x)
  #   x <- aperm(array(x, c(attrs$depth, attrs$width, attrs$height)), c(3, 2, 1))
  # }

Line 140 (elevation function call):

#      x[[1]] <- as.vector(t(elevation(source = x[[1]], extent = attr(x, "extent"), dimension = attr(x, "dimension"), projection = attr(x, "projection"))))

Line 156 (coastline):

  ##if (coastline) graphics::lines(coastline(extent, projection = projection, dimension = c(512, 512)))

Line 237 (make_hex_matrix):

    #x <- .make_hex_matrix(x, cols = col )

Line 242 (commented condition):

    #if (!tt && !is.null(col)) {

Line 245 (browser):

      #browser()

Line 271 (par setting):

  ## if !add
#  par(xaxs = "i", yaxs = "i")

Line 281 (NA handling):

  #if (anyNA(x)) x[is.na(x)] <- 1

Line 282 (browser):

  #browser()

Lines 276-277 (meshplot references):

    stop("meshplot not yet supported")
    #ximage_meshplot(x, extent, add = add)

Lines 296-297 (meshplot references in nativeRaster):

    stop("meshplot not yet supported")
    #ximage_meshplot(x, extent, add = add)

Lines 316-346 (large commented block in ximage_sf_data):
The function has a large commented documentation block that should either be converted to proper roxygen comments or removed.

Expected Result

  • R/meshplot.R file is deleted
  • All commented-out debugging code (#browser()) is removed
  • Obsolete commented-out code is removed
  • Comment blocks are either converted to proper documentation or removed
  • Cleaner, more maintainable codebase ready for CRAN

Files to Modify

  1. Delete: R/meshplot.R
  2. Clean up: R/ximage.R

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: mdsumner <4107631+mdsumner@users.noreply.github.com>
@mdsumner
mdsumner marked this pull request as ready for review February 15, 2026 07:07
@mdsumner
mdsumner merged commit 8810923 into main Feb 15, 2026
Copilot AI changed the title [WIP] Remove empty file and clean up commented-out code Clean up codebase for CRAN submission Feb 15, 2026
Copilot AI requested a review from mdsumner February 15, 2026 07:07
Copilot stopped work on behalf of mdsumner due to an error February 15, 2026 07:07
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.

2 participants