From 1f5be155dc8f5642490ea7441efc79c9f88b16c1 Mon Sep 17 00:00:00 2001 From: Jon Myers Date: Wed, 10 Dec 2025 11:51:26 -0800 Subject: [PATCH] fix: remove incorrect trajectory_grid vs instrumentation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Phrase class was incorrectly warning when trajectory_grid, chikari_grid, and groups_grid dimensions didn't match instrumentation length. This validation is architecturally wrong - instrumentation relates to phrase_grid dimensions at the Piece level, not at the Phrase level. As of recent updates, trajectory_grid will have 2 dimensions for both Sitar and Sarangi instruments, independent of piece-level instrumentation. Closes #49 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- idtap/classes/phrase.py | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/idtap/classes/phrase.py b/idtap/classes/phrase.py index cacb25c..309d3e8 100644 --- a/idtap/classes/phrase.py +++ b/idtap/classes/phrase.py @@ -292,31 +292,6 @@ def _validate_parameter_values(self, opts: Dict[str, Any]) -> None: if len(dur_array) > 0 and sum(dur_array) == 0: raise ValueError("'dur_array' cannot have all zero values") - # Validate grid structure consistency - if 'trajectory_grid' in opts and 'instrumentation' in opts: - trajectory_grid = opts['trajectory_grid'] - instrumentation = opts['instrumentation'] - if len(trajectory_grid) != len(instrumentation): - import warnings - warnings.warn(f"trajectory_grid has {len(trajectory_grid)} tracks but instrumentation has {len(instrumentation)} instruments. " - "These should typically match.", UserWarning) - - if 'chikari_grid' in opts and 'instrumentation' in opts: - chikari_grid = opts['chikari_grid'] - instrumentation = opts['instrumentation'] - if len(chikari_grid) != len(instrumentation): - import warnings - warnings.warn(f"chikari_grid has {len(chikari_grid)} tracks but instrumentation has {len(instrumentation)} instruments. " - "These should typically match.", UserWarning) - - if 'groups_grid' in opts and 'instrumentation' in opts: - groups_grid = opts['groups_grid'] - instrumentation = opts['instrumentation'] - if len(groups_grid) != len(instrumentation): - import warnings - warnings.warn(f"groups_grid has {len(groups_grid)} tracks but instrumentation has {len(instrumentation)} instruments. " - "These should typically match.", UserWarning) - # Validate categorization grid structure if 'categorization_grid' in opts and opts['categorization_grid'] is not None: for i, cat in enumerate(opts['categorization_grid']):