Skip to content

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • Created givecalc/ Python package separating calculation logic from UI
  • Added 33 comprehensive tests with pytest (100% core function coverage)
  • Fixed critical axes aggregation bug for 2025 calculations
  • Major UI improvements with sidebar layout and input persistence

Key Changes

Package Structure

  • Created installable givecalc/ package with clean API
  • Separated calculation logic from Streamlit UI layer
  • All UI components organized in ui/ directory
  • Only app.py remains in root

Testing (TDD)

  • 33 comprehensive tests across 9 test files
  • Tests for: situations, calculations, donations, simulations, axes, performance
  • All tests passing ✅
  • Run with: make test or uv run pytest tests/

Bug Fixes

  • Fixed axes aggregation (use tax_unit instead of household for 2025)
  • Fixed chart y-axis scaling (start at 0, proper range calculation)
  • Fixed numpy deprecation warnings
  • Updated to 2025 tax calculations

UI Improvements

  • Sidebar layout (inputs on left, results on right)
  • Input persistence with st.form - no more reset after Calculate
  • Loading spinners during calculations
  • Better visual hierarchy and organization
  • Performance caching with @st.cache_data

Developer Experience

  • Added Makefile for common tasks
  • Added pyproject.toml (modern Python packaging)
  • Removed deprecated setup.py
  • Added CLAUDE.md documentation
  • Added requirements-dev.txt

Test Results

All 33 tests passing. Performance: 1001 donation points calculated in ~1.3 seconds.

Fixes #32

🤖 Generated with Claude Code

MaxGhenis and others added 5 commits October 14, 2025 20:43
- Created givecalc/ package separating calculation logic from UI
- Added 33 comprehensive tests with pytest (TDD approach)
- Fixed axes aggregation bug (use tax_unit instead of household for 2025)
- Updated to 2025 tax calculations
- Improved UI: sidebar layout, spinners, input persistence with st.form
- Fixed chart y-axis scaling issues
- Added Makefile for common tasks (test, run, format)
- Added pyproject.toml (modern Python packaging)
- Removed deprecated setup.py
- Organized all UI components in ui/ directory
- Added performance caching for faster calculations
- Fixed numpy deprecation warnings

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Run tests on Python 3.10, 3.11, 3.12
- Check code formatting with Black and isort
- Use uv for fast dependency installation

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add plugin auto-install configuration in .claude/settings.json
- Configure auto-install of analysis-tools plugin from PolicyEngine/policyengine-claude
- Provides 3 skills for PolicyEngine calculator/analysis workflows

Included skills:
- policyengine-us-skill: Simulation patterns, situation creation, variable reference
- policyengine-analysis-skill: Impact analysis, Streamlit dashboards, Plotly visualizations
- policyengine-standards-skill: Code quality, formatting, CI requirements

Benefits:
- Automated reference documentation for PolicyEngine patterns
- Best practices for calculator apps and analysis
- Consistent code quality and visualization standards
- Fix pyproject.toml to explicitly include only givecalc package
- Update license to SPDX format (MIT) to avoid deprecation warnings
- Update Python version support to 3.11-3.13
- Update CI workflow to test Python 3.11, 3.12, 3.13
- Run code formatters (black, isort)

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

Co-Authored-By: Claude <noreply@anthropic.com>
MaxGhenis and others added 2 commits October 19, 2025 06:36
- Remove form wrapper for better UX - inputs update immediately
- Reorganize sidebar flow: personal info first, then donation question
- Improve donation question: "How much would you like to donate?"
- Better radio options: "I have an amount in mind" vs "I have a net income reduction target in mind"
- Add tooltip to state selector explaining it's for state tax calculations
- Remove dividers for more compact layout
- Add instructions in main panel when no calculation done yet

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Standardize teal color across app to use TEAL_PRIMARY (#319795)
  - Updates all highlighted text, markers, and links for consistency
  - Matches Streamlit theme primaryColor
- Reorder UI in target mode to show net income chart first
  - Calculate target donation before displaying any results
  - Use target donation as primary amount throughout all charts
  - Display "Your $X donation" based on target, not initial input
- Remove initial donation marker from net income reduction chart
  - Only show the required donation marker for clarity
  - Simplifies chart and reduces visual clutter

This creates a more logical flow where the target donation becomes
the focus of all calculations and visualizations.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@MaxGhenis MaxGhenis merged commit 47c45bb into main Oct 22, 2025
3 checks passed
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.

Change taxes to net taxes less benefits

2 participants