Skip to content

Implement centralized metadata registry and optimize test performance#29

Merged
turbomam merged 1 commit into
mainfrom
21-implement-centralized-metadata-registry
Sep 18, 2025
Merged

Implement centralized metadata registry and optimize test performance#29
turbomam merged 1 commit into
mainfrom
21-implement-centralized-metadata-registry

Conversation

@turbomam

Copy link
Copy Markdown
Member

Major Changes

Centralized Architecture (Issue #21)

  • Replace 3 separate data loaders with unified MetadataRegistry class
  • Add 4 core dataclasses: GeneMetadata, ConditionMetadata, ModuleMetadata, FitnessEffect
  • Build efficient index structures for O(1) lookups (gene↔module, gene↔condition)
  • Thread-safe data loading with file change detection

Test Infrastructure Improvements

  • Add session-scoped fixtures in tests/conftest.py for shared data loading
  • Remove all mocking per project policy - tests now use real data
  • Update all test files to use shared fixtures instead of individual data loading
  • Tests now fail if real data unavailable (no conditional passes)

Performance Optimizations

  • Fix expand_gene_condition_network O(n²) performance bottleneck
  • Replace nested linear scans with index structure lookups
  • Test suite time: 104s → 6.6s (15.7x speedup)
  • Network expansion tests: 45s each → 0.03s each (1,500x speedup)

Code Quality

  • Fix scientific interpretation: negative scores = essential genes, positive = inhibitory
  • Consolidate Makefile test targets into single 'test' target with coverage + timing
  • Remove unused imports and target aliases
  • All linting and type checking passes

API Migrations

  • Migrate get_gene_info, search_genes, get_growth_conditions to use registry
  • Migrate get_condition_details, interpret_fitness_score to use registry
  • Migrate module-related tools to use centralized data structures
  • Maintain backward compatibility with legacy loaders during transition

🤖 Generated with Claude Code

## Major Changes

### Centralized Architecture (Issue #21)
- Replace 3 separate data loaders with unified MetadataRegistry class
- Add 4 core dataclasses: GeneMetadata, ConditionMetadata, ModuleMetadata, FitnessEffect
- Build efficient index structures for O(1) lookups (gene↔module, gene↔condition)
- Thread-safe data loading with file change detection

### Test Infrastructure Improvements
- Add session-scoped fixtures in tests/conftest.py for shared data loading
- Remove all mocking per project policy - tests now use real data
- Update all test files to use shared fixtures instead of individual data loading
- Tests now fail if real data unavailable (no conditional passes)

### Performance Optimizations
- Fix expand_gene_condition_network O(n²) performance bottleneck
- Replace nested linear scans with index structure lookups
- Test suite time: 104s → 6.6s (15.7x speedup)
- Network expansion tests: 45s each → 0.03s each (1,500x speedup)

### Code Quality
- Fix scientific interpretation: negative scores = essential genes, positive = inhibitory
- Consolidate Makefile test targets into single 'test' target with coverage + timing
- Remove unused imports and target aliases
- All linting and type checking passes

### API Migrations
- Migrate get_gene_info, search_genes, get_growth_conditions to use registry
- Migrate get_condition_details, interpret_fitness_score to use registry
- Migrate module-related tools to use centralized data structures
- Maintain backward compatibility with legacy loaders during transition

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@turbomam turbomam linked an issue Sep 18, 2025 that may be closed by this pull request
6 tasks
@turbomam

Copy link
Copy Markdown
Member Author

for review tomorrow

@turbomam turbomam merged commit b5f4262 into main Sep 18, 2025
2 checks passed
@turbomam turbomam deleted the 21-implement-centralized-metadata-registry branch September 18, 2025 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Centralized Metadata Registry

1 participant