Project ChargedUp – Phase 2 Kickstart Guide¶
Quick-start guide for developers returning to BatteryProc Last Updated: 2025-11-07 | Phase 1 Complete
What is Phase 2?¶
Phase 2 focuses on user experience, performance, and distribution: - GUI Implementation: Simple desktop interface (Tkinter or PySimpleGUI) - Performance Optimization: Parallel processing, chunked reads, profiling - Metrics Expansion: Additional formula-based calculations based on user needs - Packaging: PyPI distribution with automated releases
What was Phase 1? Multi-format parsing, formula-driven metrics, extensible architecture (See Phase 1 Summary)
Quick Start (30 Minutes)¶
1. Environment Setup (10 min)¶
# Clone and setup
git clone https://github.com/nickbashian/batteryproc.git
cd batteryproc
# Create environment
conda env create -f environment-simple.yml
conda activate batteryproc
# Install in editable mode
pip install -e .
pip install -r requirements-dev.txt
# Verify
batteryproc --help
pytest # Should pass all 711 tests
2. Read These First (15 min)¶
3. Try It Out (5 min)¶
# Process a test file
batteryproc tests/data/SAMPLE_TEST.xlsx -o ./test_output
# Try multi-format
batteryproc tests/data/ -r -o ./batch_output
# Check available parsers
python - << 'PY'
from batteryproc.parsers import ParserRegistry
print('Supported extensions:', ParserRegistry.supported_extensions())
PY
Architecture State¶
What Exists (Phase 1 Complete)¶
Parser System:
- batteryproc/parsers.py: BaseParser, ParserRegistry
- Parsers: Neware (.xlsx), CSV, TXT, BioLogic MPT
- Config: batteryproc/config/column_mappings.yml
Metrics Engine:
- Formula-based capacity/energy derivations
- Cycle index synthesis from raw data
- Coulombic efficiency validation
- Bad cell detection with override (--force-process)
CLI:
- Entry point: batteryproc/cli.py
- Delegates to ParserRegistry for all file types
- Flags: --mapping-file, --no-heuristic-map, --force-process, --average
Visualization:
- Plot helpers in batteryproc/plots.py
- Consistent styling via batteryproc/colours.py
What Doesn't Exist (Phase 2 Scope)¶
- No GUI – CLI only
- No parallel processing – Single-threaded
- No PyPI package – Local install only
- No database – File-based workflow only
Phase 2 Roadmap (Suggested)¶
Priority 1: GUI Foundation (Months 1–2)¶
Goal: Non-technical users can process files with clicks
- Refactor CLI core logic to callable functions:
- Build minimal GUI with Tkinter:
- File/folder selector
- Output directory picker
- Run button with progress bar
- Add basic error handling and user feedback
Starting Point: Refactor batteryproc/cli.py to separate argparse from business logic
Priority 2: Performance Optimization (Months 3–4)¶
Goal: 3–5x speedup for batch processing
- Profile current bottlenecks:
- Implement optimizations:
- Chunked DataFrame reads for large files
- Parallel processing for batch mode (multiprocessing)
- Selective column loading (only needed columns)
- Benchmark and validate against baseline
Starting Point: Create performance baseline with scripts/benchmark.py
Priority 3: Packaging & Distribution (Months 5–6)¶
Goal: pip install batteryproc works
- Finalize
pyproject.toml(modern Python packaging) - Define entry points for CLI and GUI
- Create GitHub Actions workflow for releases
- Test installation in clean environments
Starting Point: Review the Python Packaging User Guide
Open Questions for Phase 2¶
Q1: GUI Framework Choice - Options: Tkinter (stdlib), PySimpleGUI (easy), PyQt (powerful) - Trade-offs: Dependencies vs features vs learning curve - Recommendation: Start with Tkinter for minimal dependencies
Q2: Performance Priorities - Unknown: Which operations are slowest? (Need profiling data) - Candidates: Excel parsing, plot generation, metrics calculations - Action: Create baseline before optimizing
Q3: Metrics Expansion Scope - Question: What additional calculations do users need? - Depends on: User feedback during Phase 1 usage - See: deep dive on cycle identification research in docs
Quick Reference¶
Build Validation (Always Run Before Committing)
pytest # All tests pass
ruff check . # No lint errors
black --check . # Code formatted
mypy batteryproc # Type checks pass
Adding a New Parser (Example)
from batteryproc.parsers import BaseParser, ParserRegistry
import pandas as pd
from pathlib import Path
@ParserRegistry.register_parser
class MyInstrumentParser(BaseParser):
extensions = (".myext",)
def parse(self, path: Path) -> pd.DataFrame:
...
Common Tasks
# Run specific test
pytest tests/test_cli.py::test_basic_processing -v
# Generate coverage report
pytest --cov=batteryproc --cov-report=html
# Open htmlcov/index.html
Resources - Issues: https://github.com/nickbashian/batteryproc/issues?q=label%3Aphase-2 - Documentation: https://nickbashian.github.io/batteryproc/ - Discussions: https://github.com/nickbashian/batteryproc/discussions - Maintainer: @nickbashian
Ready to Start? Look for issues labeled phase-2 and good-first-issue.