Skip to content

chore: Cleanup unused files and code - #367

Open
mhovd wants to merge 11 commits into
mainfrom
cleanup
Open

chore: Cleanup unused files and code#367
mhovd wants to merge 11 commits into
mainfrom
cleanup

Conversation

@mhovd

@mhovd mhovd commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

mhovd added 2 commits July 29, 2026 07:53
Also introduces a flag that ensures that the user is only warned about a missing PmetricsReports package only once per session.
@mhovd
mhovd requested review from mnneely and a lite review from Copilot July 29, 2026 07:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes unused/legacy R utilities and patch-installation code, cleans up related package exports/docs, and bumps Rust workspace dependencies; it also reduces repeated report warnings by tracking “warn once” state per R session.

Changes:

  • Bump Rust dependency versions (notably pmcore) and refresh Cargo.lock.
  • Remove legacy R utilities and the PMpatch() function + its Rd/namespace export.
  • Add a session-scoped “warn once” helper for PM_report() dependency fallback warnings.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/rust/Cargo.toml Updates pmcore dependency version used by the Rust workspace member.
Cargo.lock Reflects dependency resolution changes from the Rust crate updates.
R/PMutilities.R Removes large blocks of internal/unused utility code, keeping remaining helpers.
R/PMpatch.R Deletes legacy patch installer function that sourced remote code.
man/PMpatch.Rd Removes documentation for the deleted PMpatch() function.
NAMESPACE Stops exporting PMpatch.
R/PM_report.R Adds .report_warn_once() to avoid repeating the same warning in a session.
inst/mac/install_homebrew.sh Removes deprecated Homebrew install snippet.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread NAMESPACE
Copilot AI review requested due to automatic review settings July 29, 2026 07:10
@mhovd

mhovd commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

@mnneely, could you evaluate the following files / functions that may be removed?

  • PM_batch (users can write manual loops instead)
  • PMwrk2csv.R (I can't imagine anyone using USC*PACK files now)
  • NPrun.R (only provides a wrapper for backwards code, but old models won't work either way)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

NAMESPACE:83

  • PMpatch was removed from the package API, but it is still listed in _pkgdown.yml (Utility section). This will cause pkgdown reference generation to warn/fail due to a missing topic. Remove PMpatch from _pkgdown.yml (or replace it with the new equivalent, if any).
export(PMload)
export(PMmatrixRelTime)
export(PMnews)
export(PMreadDefaults)

R/PMutilities.R:5

  • dmv_norm() uses p in default argument values (mean = rep(0, p), sigma = diag(p)), but p is only computed inside the function body. This will error if dmv_norm() is called without explicitly providing mean/sigma. Use NULL defaults and set them after computing p.
dmv_norm <- function(
  x, mean = rep(0, p), sigma = diag(p), log = FALSE,
  checkSymmetry = TRUE
) {

Copilot AI review requested due to automatic review settings July 29, 2026 07:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

NAMESPACE:84

  • PMpatch was previously an exported public function; removing its export (and deleting its implementation/docs) is a breaking API change for downstream users. If the intent is to retire the HTTP-based patch mechanism, consider keeping PMpatch() as a deprecated stub for at least one release (e.g., call .Deprecated() and/or cli::cli_abort() with a pointer to the new approach) and add a NEWS entry describing the removal.
export(PMload)
export(PMmatrixRelTime)
export(PMnews)
export(PMreadDefaults)
export(PMreport)

Copilot AI review requested due to automatic review settings July 29, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

R/PMutilities.R:5

  • dmv_norm()'s default arguments reference p, but p is only defined inside the function body. Calling dmv_norm(x) without explicitly providing mean/sigma will error when evaluating the defaults. Use NCOL(x) (or similar) in the defaults so they can be computed from x.
dmv_norm <- function(
  x, mean = rep(0, p), sigma = diag(p), log = FALSE,
  checkSymmetry = TRUE
) {

Copilot AI review requested due to automatic review settings July 29, 2026 12:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

NAMESPACE:83

  • Removing the exported PMpatch() API is a breaking change for downstream code; current callers will now fail with “could not find function”. The package already uses lifecycle-based deprecation wrappers (see R/Deprecated.R, e.g. PMcheckMatrix()), so it would be more consistent to keep PMpatch() as a deprecated/defunct stub that emits a clear message (and optionally stops) rather than removing it outright.
export(PMgetCRCL)
export(PMload)
export(PMmatrixRelTime)
export(PMnews)
export(PMreadDefaults)

@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.14%. Comparing base (54ba486) to head (f88f388).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #367      +/-   ##
==========================================
+ Coverage   61.88%   62.14%   +0.26%     
==========================================
  Files          51       50       -1     
  Lines       22409    22314      -95     
==========================================
  Hits        13868    13868              
+ Misses       8541     8446      -95     
Files with missing lines Coverage Δ
R/PMconfig.R 100.00% <ø> (+64.28%) ⬆️
R/PMutilities.R 28.16% <ø> (+3.89%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings August 3, 2026 12:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 5, 2026 05:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (1)

NAMESPACE:83

  • Removing the exported PMpatch() function is a user-facing API break; callers will now get a generic “could not find function” error. Since the package already uses lifecycle::deprecate_warn() wrappers for retired functions (e.g., R/Deprecated.R:10-12), consider keeping a deprecated PMpatch() stub that warns and points users to the supported update path, at least for one release cycle.
export(PMload)
export(PMmatrixRelTime)
export(PMnews)
export(PMreadDefaults)

Copilot AI review requested due to automatic review settings August 18, 2026 08:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.

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.

3 participants