Background
Test suite has 151 flake8 warnings (all in tests/ directory, production code is clean).
These are pre-existing technical debt, not introduced by v0.2.0 changes. The warnings don't affect functionality but reduce code cleanliness and maintainability.
Warnings Breakdown
| Category |
Count |
Severity |
Description |
| F401 |
77 |
Medium |
Unused imports |
| F841 |
17 |
Medium |
Unused variables |
| E402 |
32 |
Low |
Module imports not at top of file |
| D205 |
16 |
Low |
Docstring formatting (missing blank line) |
| E226 |
5 |
Low |
Missing whitespace around operators |
| Others |
4 |
Low |
Misc style issues (E203, F811, F541, W291) |
Total: 151 warnings across test files
Scope
Tier 2: Important (Recommended)
Estimated Time: 2-3 hours (mostly automated)
Tier 3: Nice-to-Have (Optional)
Estimated Time: 1-2 hours
Value Propositions
| Metric |
Tier 2 (Unused Code) |
Tier 3 (Style) |
| Time |
2-3 hours |
1-2 hours |
| Code Quality |
+10% (removes clutter) |
+5% (consistency) |
| Maintainability |
High (easier to read) |
Medium (marginal) |
| Risk |
Low (tests validate) |
Very Low (cosmetic) |
| LOC Reduction |
~94 lines (imports+vars) |
Minimal |
Implementation Plan
Step 1: Install Tools
pip install autoflake isort docformatter
Step 2: Tier 2 Cleanup (Recommended)
# Preview changes
autoflake --remove-all-unused-imports --remove-unused-variables \
--in-place --recursive tests/ --check
# Apply automated fixes
autoflake --remove-all-unused-imports --remove-unused-variables \
--in-place --recursive tests/
# Manual review for false positives
git diff tests/
# Run tests to verify
pytest -q
# Commit
git add tests/
git commit -m "refactor(tests): remove unused imports and variables
Remove 94 unused imports (F401) and variables (F841) from test suite.
- Reduces test file size by ~94 lines
- Improves code clarity and maintainability
- Automated via autoflake with manual review
Resolves #402 (Tier 2 scope)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>"
Step 3: Tier 3 Cleanup (Optional)
# Fix import ordering
isort tests/
# Fix docstring formatting
docformatter --in-place --recursive tests/
# Run tests again
pytest -q
# Commit
git add tests/
git commit -m "style(tests): fix import ordering and docstring formatting
- Reorder imports to PEP8 standard (E402)
- Add blank lines in docstrings (D205)
- Fix whitespace issues (E226, E203, W291)
Resolves #402 (Tier 3 scope)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>"
Dependencies
None - independent cleanup task. Can be done anytime post-v0.2.0 release.
Timeline
Target: v0.2.1 or v0.3.0 timeframe (within 1-2 weeks of v0.2.0 release)
Priority: Medium - improves code quality but doesn't affect functionality
Success Criteria
Notes
- Production code (
solarwindpy/) already has zero flake8 warnings ✅
- These warnings are pre-existing technical debt, not introduced by recent changes
- The publish workflow only checks
flake8 solarwindpy/, so these don't block releases
- v0.1.5 released successfully with these same warnings
This issue tracks test code quality improvement, not a critical bug fix.
Background
Test suite has 151 flake8 warnings (all in
tests/directory, production code is clean).These are pre-existing technical debt, not introduced by v0.2.0 changes. The warnings don't affect functionality but reduce code cleanliness and maintainability.
Warnings Breakdown
Total: 151 warnings across test files
Scope
Tier 2: Important (Recommended)
autoflake --remove-all-unused-importsautoflake --remove-unused-variablestest_sidc.pytest_base.pyEstimated Time: 2-3 hours (mostly automated)
Tier 3: Nice-to-Have (Optional)
isort tests/docformatter --in-placeblackre-runEstimated Time: 1-2 hours
Value Propositions
Implementation Plan
Step 1: Install Tools
Step 2: Tier 2 Cleanup (Recommended)
Step 3: Tier 3 Cleanup (Optional)
Dependencies
None - independent cleanup task. Can be done anytime post-v0.2.0 release.
Timeline
Target: v0.2.1 or v0.3.0 timeframe (within 1-2 weeks of v0.2.0 release)
Priority: Medium - improves code quality but doesn't affect functionality
Success Criteria
tests/passes with <10 warnings (allow for unavoidable style preferences)Notes
solarwindpy/) already has zero flake8 warnings ✅flake8 solarwindpy/, so these don't block releasesThis issue tracks test code quality improvement, not a critical bug fix.