Fix summary-exclusion flags filtering individual plots (#1438) - #1439
Open
Gero1999 wants to merge 9 commits into
Open
Fix summary-exclusion flags filtering individual plots (#1438)#1439Gero1999 wants to merge 9 commits into
Gero1999 wants to merge 9 commits into
Conversation
Summary/mean TLG functions now self-filter PKSUMXF/PPSUMXF; individual and combined plots and listings receive unfiltered data. Retire the filtered/_all boundary split.
Gero1999
marked this pull request as ready for review
August 24, 2026 12:20
Base automatically changed from
1436-enhancement/summary-exclusion-flags
to
main
August 26, 2026 14:14
Resolve conflicts in inst/shiny/modules/tab_tlg.R and tests/testthat/test-tab_tlg.R: keep the single unfiltered ADPP data source from this branch and fold in the ADPP not-run notification from main (#1335).
…n test pkcg01/pkcg02 named their output list from adnca[["id_plot"]], but id_plot only exists on adnca_grouped, so the list came back unnamed. Name from adnca_grouped instead (#1448). Adjust the t_pkct01 summary-exclusion test: flagging every row of a cell removes the group entirely (empty groups are not emitted), so assert the row is absent rather than expecting an n == 0 row (#1438).
The unnamed-list bug is internal (the app consumes plots by index, not name) and predates v0.1.0, so it is not a user-facing change for this release. It remains tracked in #1448 and the fix commit.
Add .github/skills/news-curation/SKILL.md, a decision gate for whether a change belongs in NEWS.md (user-observable? regression this cycle? foldable? correctness/safety carve-in) and how to phrase entries. Reference it from the AGENTS.md PR workflow so NEWS.md is re-checked whenever a PR is opened or updated.
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.
Issue
Closes #1438
Description
Summary-exclusion flags (
PKSUMXFfor ADNCA,PPSUMXFfor ADPP) were applied to every TLG graph, so individual concentration plots (pkcg01) and combined plots (pkcg02) hid summary-excluded records. The documented intent (#1018, #1436) is that these flags remove records from summary tables and mean plots only, while keeping them everywhere records are inspected individually.The old routing (
tlg_data_key()) was a binary listing-vs-everything switch: listings got unfiltered data, everything else (all tables and all graphs) got filtered data. That scope quietly widened from "mean plots" to "graphs" in #1356.This inverts the default: only summary/mean functions self-filter, and the filtered/
_allboundary split is retired so there is a single source of truth per dataset.Changes:
filter_summary_excluded()inR/utils-tlg.R. It auto-detects the relevant flag (PKSUMXF/PPSUMXF), is a no-op when absent, scopes each dataset to its own flag (no cross-filtering), and usesdplyr::filter()so columnlabelattributes survive the row subset.t_pkct01,t_pkpt03_col,t_pkpt07_norm,t_pkpt08_uri,t_pkpt11_gmr,pkcg03(mean conc), andp_pkpg01_cum/p_pkpg02_doseprop/p_pkpg03_boxp. Their delegators (_dose,_tad,_MP_col,p_pkpg01_per,p_pkpg04/06,g_pkcg03_*,p_pkcg03_*_dose) inherit automatically.pkcg01) and combined (pkcg02) plots and all listings now receive raw data.tlg_data_key()andfilter_tlg_excluded();tab_tlg.Rexposes one unfiltered source per dataset.Because filtering now lives in the TLG functions, the exported R script path gets the correct behaviour too.
Combined plots (
pkcg02) decision: kept unfiltered.pkcg02overlays individual subject traces, so records are still being inspected individually.Unrelated naming bug found while testing (#1448): adding name-based assertions surfaced a pre-existing bug on
main—pkcg01/pkcg02named their output list fromadnca[["id_plot"]], butid_plotonly exists on the intermediateadnca_grouped, so the list came back unnamed. No prior test checked plot names, so it went unnoticed. Fixed here by naming fromadnca_grouped(tracked separately in #1448).Definition of Done
pkcg02: unfiltered)How to test
Flag a record with
PKSUMXF == "Y"(ADNCA) orPPSUMXF == "Y"(ADPP) and confirm in the TLG tab that:pkcg01) and combined (pkcg02) plots and in listings, andt_pkct01,t_pkpt*) and mean plots (pkcg03,p_pkpg*).Contributor checklist
.scsschange was done, rundata-raw/compile_css.Rdata-raw/test_suggests_hidden.RNotes to reviewer
R is not available in this environment, so tests/lintr were verified statically (line-length and brace/paren balance) rather than executed; please run
devtools::test()andlintr::lint_package()locally.mainhas been merged into this branch and conflicts ininst/shiny/modules/tab_tlg.Randtests/testthat/test-tab_tlg.Rresolved (kept the single unfiltered ADPP source from this branch and folded in the ADPP "run NCA first" notification from #1335).Two test failures from the first CI run are addressed: the
g_pkcg01name assertion failed due to the #1448 naming bug (fixed here), and thet_pkct01exclusion test expected ann == 0row for a fully-excluded cell — the table drops empty groups, so the test now asserts the row is absent.