Overview
The Python codebase has accumulated many scripts with varying quality and unclear production status. A comprehensive review is needed to ensure all code meets best practices and provides clear value.
Issues Identified
1. Hardcoded Temporary Paths
docs/metpo/scripts/definition_work/fetch_source_metadata.py has hardcoded /tmp/ paths
docs/metpo/scripts/definition_work/merge_sparql_with_metadata.py has hardcoded /tmp/ paths
- These suggest exploratory/analysis scripts rather than production tools
2. Code Quality Issues
- 616 remaining linting errors after automated fixes
- Complexity warnings (functions with too many branches/statements)
- Inconsistent use of modern Python patterns (e.g., Path vs open())
3. Unclear Script Organization
- Scripts in
docs/metpo/scripts/ - should documentation contain executable code?
- Unclear which scripts are production tools vs. one-off analysis scripts
- Missing Click CLI interfaces for some scripts (per CLAUDE.md requirements)
- Missing pyproject.toml entries for scripts
4. Best Practices Compliance
According to CLAUDE.md, all production scripts MUST:
- ✅ Use uv or poetry for environment management
- ❌ Have Click CLI interfaces (many scripts missing this)
- ❌ Live in
metpo/scripts/ directories (some in docs/)
- ❌ Have CLI aliases in pyproject.toml (many missing)
- ❌ Be illustrated in Makefile (many not integrated)
- ❌ Meet production standards (some are one-off analysis notebooks)
Proposed Review Process
Phase 1: Inventory
Phase 2: Evaluation
For each script, determine:
Phase 3: Action
Phase 4: Standardization
Files Needing Immediate Attention
Scripts with hardcoded /tmp/ paths:
docs/metpo/scripts/definition_work/fetch_source_metadata.py
docs/metpo/scripts/definition_work/merge_sparql_with_metadata.py
Recent additions needing review:
metpo/scripts/definition_work/regenerate_curator_attributions.py
metpo/scripts/visualize_distances.py
Success Criteria
Related Context
- Fixed 6854 quote style errors and 1224 other auto-fixable linting issues
- 616 linting errors remain (mostly complexity and style warnings)
- Repository cleanup identified many files needing organization
Priority: Medium
Estimated Effort: 2-3 days for comprehensive review
Assignee: TBD
Overview
The Python codebase has accumulated many scripts with varying quality and unclear production status. A comprehensive review is needed to ensure all code meets best practices and provides clear value.
Issues Identified
1. Hardcoded Temporary Paths
docs/metpo/scripts/definition_work/fetch_source_metadata.pyhas hardcoded/tmp/pathsdocs/metpo/scripts/definition_work/merge_sparql_with_metadata.pyhas hardcoded/tmp/paths2. Code Quality Issues
3. Unclear Script Organization
docs/metpo/scripts/- should documentation contain executable code?4. Best Practices Compliance
According to CLAUDE.md, all production scripts MUST:
metpo/scripts/directories (some indocs/)Proposed Review Process
Phase 1: Inventory
Phase 2: Evaluation
For each script, determine:
Phase 3: Action
metpo/scripts/, analysis → archive)Phase 4: Standardization
Files Needing Immediate Attention
Scripts with hardcoded /tmp/ paths:
docs/metpo/scripts/definition_work/fetch_source_metadata.pydocs/metpo/scripts/definition_work/merge_sparql_with_metadata.pyRecent additions needing review:
metpo/scripts/definition_work/regenerate_curator_attributions.pymetpo/scripts/visualize_distances.pySuccess Criteria
Related Context
Priority: Medium
Estimated Effort: 2-3 days for comprehensive review
Assignee: TBD