Rename dig*() callback argument weights → degrees with deprecation shim - #60
Merged
Merged
Conversation
Co-authored-by: beerda <26056018+beerda@users.noreply.github.com>
Co-authored-by: beerda <26056018+beerda@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
beerda
September 21, 2026 13:24
View session
beerda
marked this pull request as ready for review
September 21, 2026 13:24
beerda
approved these changes
Sep 21, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #60 +/- ##
=======================================
Coverage 87.25% 87.26%
=======================================
Files 134 134
Lines 6907 6942 +35
=======================================
+ Hits 6027 6058 +31
- Misses 880 884 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The na_rm handling has a moderate correctness issue, and warning/parser coverage needs strengthening.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Renames the fuzzy callback argument from weights to canonical degrees while preserving deprecated legacy callbacks.
Changes:
- Adds
degreeshandling with deprecatedweightscompatibility and warnings. - Updates R/C++ plumbing, documentation, vignettes, NEWS, and tests.
| File | Summary and review notes |
|---|---|
vignettes/nuggets.Rmd |
Updated callback example. |
vignettes/custom-patterns.Rmd |
Updated callback documentation and examples. |
tests/testthat/test-dig.R |
Nit (3 votes): Assert the deprecation warning instead of suppressing it. |
tests/testthat/test-dig_grid.R |
Nit (2 votes): Assert deprecation warnings at the affected calls on lines 417 and 426. |
src/test-dig-Config.cpp |
Nit (1 vote): Add degrees and weights parser cases asserting hasDegreesArgument(). |
src/dig/Pattern.h |
Renamed stored degree accessor. |
src/dig/Digger.h |
Passes degree callbacks. |
src/dig/Config.h |
Nit (1 vote): Add parser coverage for both argument tokens. |
src/dig/CallbackCaller.h |
Emits degrees callback values. |
R/dig.R |
Adds legacy callback mapping and deprecation warning. |
R/dig_tautologies.R |
Updated terminology. |
R/dig_itemsets.R |
Updated terminology. |
R/dig_grid.R |
Moderate (1 vote): Correct na_rm = TRUE handling so degrees retains matching length and drops omitted indices only when applicable. |
R/dig_associations.R |
Updated terminology. |
NEWS.md |
Documents the rename and deprecation. |
man/dig.Rd |
Updated documentation. |
man/dig_tautologies.Rd |
Updated terminology. |
man/dig_itemsets.Rd |
Updated terminology. |
man/dig_grid.Rd |
Updated documentation. |
man/dig_associations.Rd |
Updated terminology. |
Files not reviewed (5)
- man/dig.Rd: Generated file
- man/dig_associations.Rd: Generated file
- man/dig_grid.Rd: Generated file
- man/dig_itemsets.Rd: Generated file
- man/dig_tautologies.Rd: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+263
to
+265
| suppressWarnings( | ||
| res <- dig(m, function(weights) list(w = weights)) | ||
| ) |
Comment on lines
+417
to
+424
| suppressWarnings( | ||
| res <- dig_grid(x = d, | ||
| f = f, | ||
| type = "fuzzy", | ||
| condition = where(is.numeric), | ||
| xvars = where(is.character), | ||
| yvars = where(is.character)) | ||
| ) |
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.

dig()anddig_grid()callbacks currently useweightsfor per-row fuzzy truth values. This updates the canonical callback API todegrees, keepsweightstemporarily supported, and documents/tests the deprecation path.API change (callback contract)
dig()now recognizesdegreesas the canonical callback argument.dig_grid(type = "fuzzy")now requiresd+ (degreesor deprecatedweights), withdegreesas the primary name.Backward compatibility + deprecation behavior
weightscontinue to work.weightsis used indig()ordig_grid().degreesvalues intoweightsfor legacy callback signatures.Core implementation rename (R + C++)
degreesandweightsrequest tokens, normalizing to degrees semantics.Docs + examples
degreesin callback signatures and explanations.Tests
degrees.weightscallbacks in bothdig()anddig_grid().