-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Problem
After extracting the common Data1D processing logic (see issue #185), the three sync modifiers need to be refactored to use the shared function, keeping only their unique logic.
Current Behavior
Each sync modifier (synccomputesmodifier.ts, syncfixesmodifier.ts, syncvariablesmodifier.ts) contains ~125 lines, with most of it being duplicated Data1D processing logic.
Expected Behavior
Refactor all three modifiers to:
- Call the shared
processData1D()helper function - Keep only the unique logic:
- Which sync method to call (
syncComputes(),syncFixes(),syncVariables()) - Which name array to get (
getComputeNames(),getFixNames(),getVariableNames()) - Which collection to update in output (
output.computes,output.fixes,output.variables)
- Which sync method to call (
- Reduce each file from ~125 lines to ~50-60 lines
Files to Modify
src/modifiers/synccomputesmodifier.tssrc/modifiers/syncfixesmodifier.tssrc/modifiers/syncvariablesmodifier.ts
Prerequisites
- Issue refactor: Extract common Data1D processing logic from sync modifiers #185 must be completed first (extraction of shared Data1D processing logic)
Benefits
- Significant reduction in code duplication
- Easier to maintain and test
- Consistent behavior across all sync modifiers
- Makes it easier to add new modifiers in the future
Implementation Notes
Each modifier should:
- Call the appropriate sync method (
syncComputes,syncFixes, orsyncVariables) - Get the appropriate name array
- Loop through names to create/update modifier objects
- Call the shared
processData1D()function for Data1D processing - Assign to the appropriate output collection
- Clean up the name array (see issue fix: Memory leak in sync modifiers - missing cleanup of name arrays #183)
Metadata
Metadata
Assignees
Labels
No labels