Skip to content

Commit f5b6b3d

Browse files
author
miranov25
committed
PHASE 13.27.DF Commit 1 — Facet refactor (profile-only, channel-framework dispatch)
Replaces the inline facet=True path in DFDraw.profile() with a unified _dispatch_faceted_render() method routing through the channel framework (Phase 13.26). facet_by= is the new public API; facet=True is preserved as backward-compat alias normalized to facet_by='group_by' (AD-67). - DFDraw._dispatch_faceted_render() coordinates faceted rendering: validates facet_by, builds subplot grid, per-subplot recursion into draw_profile with filtered DataFrame + pre-created ax. - DFDraw.profile() gains facet_by: Optional[str] = None. Commit 1 valid values: {'group_by', 'vector', 'quantiles'}. 'selection_delta' / 'weights_delta' reserved for Commit 2 (NotImplementedError). - Vector-y entry intercepts facet_by='vector' BEFORE _draw_vector (vector overlay and vector facet mut (vector overlay and vector facet mut (vector overlay and vector roup_by ≡ f (vector overlay and vector facet mut (vector overlaetLegacyEquivalence). - Mutual exclusion: facet_by + same=True raises ValueError (architect rule §5.4 v §5.4 v §5.4 v §5.4 v §5.4 v §5.4 v §5.4 v §5.4 v w='warn' truncates + warns, ='error' raises. - 6 new style keys (AD-61..AD-66): channels.cycles.facet_max, channels.legend.facet_position, channels.label.{selection,weights}_truncate, channels.default.{selection,weights}_delta. - 'facet_by' added to _PROFILE_FORWARDED_NAMES; R6 validator passes at module import (Phase 13.16 FIX1 + Phase 13.28 FIX1 lessons applied prospectively). - Stale root-level dfd- Stale root-level dfd- Stale root-level dfd- Stale rdocs/dfdraw_Technic- Stale root-level dfd- Stale root-level dfd- Stale root-lever QRC v1.30 Rule 14: - TestFacetLegacyEquivalence (3) - TestFacetByCh- TestFacetByCh- TestFacetByCh- TestFacetByChSameTrueExclusion (1) Tests: 662 passed, 1 skipped, 1 FAILED, 0 errors. Deferred to Phase 13.30 commissioning: tests/test_channel_assignment.py::TestChannelStyleOverride::test_default_style_has_all_10_keys This test is a Phase 13.26 invariant that asserts an exact set of 10 channels.* style keys. Phase 13.27 Commit 1 legitimately adds 6 new channels.* keys (AD-61..AD-66 above), so the assertion is correctly identifying the new state — but the expected set is stale. The fix (rename to test_default_style_has_all_channels_keys + bump to 16 keys grouped by phase with comments) bundles with Phase 13.30 closure to avoid an extra commit cycle. After Phase 13.30 lands the suite returns to a green baseline of 675 / 1 / 0.
1 parent 169f5be commit f5b6b3d

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

UTILS/dfextensions/dfdraw/tests/test_channel_assignment.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,18 +428,34 @@ def test_set_style_validates_list_values(self):
428428
set_style({'channels.cycles.linestyle': ['-', '--']})
429429
assert get_style_value('channels.cycles.linestyle') == ['-', '--']
430430

431-
def test_default_style_has_all_10_keys(self):
431+
def test_default_style_has_all_channels_keys(self):
432+
"""All channels.* keys present in DEFAULT_STYLE.
433+
434+
Grouped by phase for traceability. New phases that add channels.*
435+
keys must extend this expected set."""
432436
from dfdraw.style import DEFAULT_STYLE
433437
expected = {
438+
# Phase 13.26.DF (Phase B) — N-Channel Framework (10 keys)
434439
'channels.priority.categorical', 'channels.priority.ordinal',
435440
'channels.cycles.linestyle', 'channels.cycles.marker',
436441
'channels.cycles.color_count',
437442
'channels.default.vector', 'channels.default.group_by',
438443
'channels.default.quantiles',
439444
'channels.overflow', 'channels.legend.factored',
445+
# Phase 13.27.DF (Phase D) — Selection/Weights/Facet (6 keys)
446+
'channels.cycles.facet_max',
447+
'channels.legend.facet_position',
448+
'channels.label.selection_truncate',
449+
'channels.label.weights_truncate',
450+
'channels.default.selection_delta',
451+
'channels.default.weights_delta',
440452
}
441453
present = {k for k in DEFAULT_STYLE if k.startswith('channels.')}
442-
assert expected == present
454+
assert expected == present, (
455+
f"channels.* keys mismatch.\n"
456+
f" Missing from DEFAULT_STYLE: {expected - present}\n"
457+
f" Unexpected in DEFAULT_STYLE: {present - expected}"
458+
)
443459

444460
def test_namespace_integrity(self):
445461
from dfdraw.style import DEFAULT_STYLE

0 commit comments

Comments
 (0)