Skip to content

remove non-parametric fitting method#63

Merged
jasmineirx merged 3 commits into
masterfrom
rm_np_fitting
Jul 15, 2026
Merged

remove non-parametric fitting method#63
jasmineirx merged 3 commits into
masterfrom
rm_np_fitting

Conversation

@jasmineirx

Copy link
Copy Markdown
Contributor

While debugging some install messages, I noticed we were getting the following log during PKPDmap install:

Note: possible error in 'np_fit_wrapper(obj = obj, ': unused argument (lagtime = lagtime)

I thought this was an odd but easy fix, so I tried adding the argument to the function, since it can be passed on to PKPDsim within the function easily enough.

When doing that fix, I realized there were some other issues. We were also using a variable called error but not passing it onto the function, and so calling np_fit_wrapper would have been erroring anyways due to a variable not being found in scope. I then tried adding that argument too (easily available within PKPDmap::get_map_estimates), and I added a unit test.

However, upon trying to write a meaningful unit test, I learned that np_fit_wrapper silently only supported models parameterized by CL and V, in that order (example hardcoding:

par_tmp <- list(CL = parameter_grid[i, 1], V = parameter_grid[i, 2])
), and not lagtime. At this point I figured the entire feature of NP fitting was neither operational nor close to being operational, and has not been for a long time, and I think it is better to therefore remove it entirely rather than spend time fixing something that isn't being used or having a bunch of dead code around.

However, if we want to start extending it into something useful again, my original fixes are in this branch: https://github.com/InsightRX/PKPDmap/tree/np_fit_fix1.

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 the non-parametric (NP) fitting feature set from PKPDmap, including the hybrid NP pathway, related helpers, exports, and documentation, to avoid carrying non-operational/dead code.

Changes:

  • Removed NP estimation implementation files (np_fit_wrapper, get_np_estimates, grid creation, default NP settings) and their generated man pages.
  • Updated get_map_estimates() to drop the np_settings argument and remove the np_hybrid execution path.
  • Updated NAMESPACE + documentation (README/man/CLAUDE) to stop advertising NP methods.

Reviewed changes

Copilot reviewed 12 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Removed NP method bullets from the estimation-method list.
R/np_settings_default.R Deleted NP default settings object.
R/np_fit_wrapper.R Deleted NP wrapper used by hybrid estimation.
R/get_np_estimates.R Deleted NP grid-based estimator implementation.
R/get_map_estimates.R Removed np_settings arg and np_hybrid branch from main API.
R/create_grid_around_parameters.R Deleted grid helper used by NP estimation.
NAMESPACE Removed exports for NP-related functions/objects.
man/parse_weights.Rd Updated wording to remove NP mention.
man/parse_residuals_from_predictions.Rd Updated wording to remove NP mention.
man/np_settings_default.Rd Deleted generated docs for np_settings_default.
man/np_fit_wrapper.Rd Deleted generated docs for np_fit_wrapper.
man/ll_func_PKPDsim.Rd Updated wording to remove NP mention.
man/get_np_estimates.Rd Deleted generated docs for get_np_estimates.
man/get_map_estimates.Rd Removed np_settings and NP-related type options from docs.
man/create_grid_around_parameters.Rd Deleted generated docs for grid helper.
man/check_inputs.Rd Updated type option wording to remove NP mention.
man/calc_residuals.Rd Updated wording to remove NP mention.
CLAUDE.md Removed NP method bullets and pipeline references, but retains NP mention in overview text.
Files not reviewed (6)
  • man/calc_residuals.Rd: Generated file
  • man/check_inputs.Rd: Generated file
  • man/get_map_estimates.Rd: Generated file
  • man/ll_func_PKPDsim.Rd: Generated file
  • man/parse_residuals_from_predictions.Rd: Generated file
  • man/parse_weights.Rd: Generated file

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

Comment thread README.md
Comment thread R/get_map_estimates.R

@mccarthy-m-g mccarthy-m-g 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.

Nice catch! Changes look good to me. Will leave final judgement on whether to remove or fix to @roninsightrx

@jasmineirx
jasmineirx merged commit 963f430 into master Jul 15, 2026
1 check passed
@jasmineirx
jasmineirx deleted the rm_np_fitting branch July 15, 2026 21:59
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