Maryland County Income Tax Rates#6439
Conversation
MaxGhenis
left a comment
There was a problem hiding this comment.
does the state or each county set these rates?
The state of Maryland mandates that county income tax rates must be within 2.25% and 3.3% (just raised from 3.2% this tax year), but counties control the rate and structure between that range. Statute: https://mgaleg.maryland.gov/mgawebsite/Laws/StatuteText?article=gtg§ion=10-106&enactments=false |
policyengine_us/variables/gov/states/md/tax/income/local/md_local_income_tax_before_credits.py
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6439 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 5
Lines ? 103
Branches ? 0
========================================
Hits ? 103
Misses ? 0
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PavelMakarchuk
left a comment
There was a problem hiding this comment.
structural suggestions
policyengine_us/variables/gov/states/md/tax/income/local/md_local_income_tax_before_credits.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/states/md/tax/income/local/md_local_income_tax_before_credits.py
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/local/md/frederick_county/tax/income/joint.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/local/md/frederick_county/tax/income/joint.yaml
Show resolved
Hide resolved
policyengine_us/parameters/gov/local/md/frederick_county/tax/income/separate.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/states/md/tax/income/local/md_local_income_tax_before_credits.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/states/md/tax/income/local/md_local_income_tax_before_credits.py
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/local/md/all_other_counties/flat_rate.yaml
Outdated
Show resolved
Hide resolved
PR Review: Maryland County Income Tax Rates🔴 Critical (Must Fix)
🟡 Should Address
🟢 Suggestions
Validation Summary
Positive Observations
Next StepsTo auto-fix issues: Or address manually:
🤖 Generated with Claude Code |
- Add 2025 references with page numbers to all 11 MD county tax parameters - Fix PDF anchor format (#page-23 -> #page=23) for correct linking - Standardize PDF filename (Resident-Booklet.pdf -> Resident_Booklet.pdf) - Add reference field to all 4 MD county tax variable files - Simplify md_local_income_tax_before_credits.py to use adds pattern Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes Applied ✅🔴 Critical Issues Fixed
🟡 Should-Address Issues Fixed
Verification
Files Modified (15 total)Parameters (11): All files in Variables (4): All files in 🤖 Generated with Claude Code |
Audit FindingsVerified PR parameter values against the NFC withholding bulletins and 2025 Maryland Resident Tax Booklet. 30+ rate/year/county combinations confirmed correct. Three issues found: 1. Frederick County 2023 single/separate threshold
Impact: Single/separate filers earning $50K–$100K would be undertaxed for 2023. 2. Frederick County rate type — flat-rate-by-bracket, not marginalAll 5 Frederick County YAML files use Example (2025, single, $40K income):
3. Unguarded
|
Fixes audit findings in PR PolicyEngine#6439: 1. Frederick County 2023 single/separate threshold: Changed from $100,000 to $50,000 for single and separate filers per NFC bulletins 2. Frederick County rate type: Changed from marginal_rate to single_amount (fixed-rate-by-bracket system) - entire income is multiplied by the bracket rate, not marginal taxation 3. Unguarded parameter lookup: Added safe_county fallback in md_flat_rate_county_tax.py to prevent ParameterNotFoundError in mixed-state microsimulations 4. Updated test expectations: Tests now reflect fixed-rate-by-bracket calculations (e.g., $35,000 * 2.75% = $962.50, not marginal sum) Reference: NFC withholding bulletins confirm Frederick County uses "Fixed Rate Tax Table" while Anne Arundel uses "Graduated Tax Table" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Audit Fixes Applied ✅Fixed all 3 critical issues identified by @hua7450: 1. Frederick County 2023 single/separate threshold ✅Changed from 2. Frederick County rate type: fixed-rate-by-bracket ✅Changed parameter type from Before (marginal, incorrect):
After (fixed-rate-by-bracket, correct):
3. Unguarded parameter lookup in md_flat_rate_county_tax.py ✅Added safe county fallback: in_md = tax_unit.household("state_code_str", period) == "MD"
safe_county = where(in_md, county, "ALLEGANY_COUNTY_MD")
flat_rate = p[safe_county]Test UpdatesUpdated all 21 Frederick County tests to reflect fixed-rate-by-bracket calculations. All 111 MD county tax tests pass. 🤖 Generated with Claude Code |
policyengine_us/parameters/gov/local/md/frederick_county/tax/income/joint.yaml
Show resolved
Hide resolved
policyengine_us/parameters/gov/local/md/frederick_county/tax/income/joint.yaml
Show resolved
Hide resolved
Add pre-progressive rate tests (2022) for both progressive counties to verify flat rate behavior before the progressive structure started in 2023. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Addressed the recent feedback: Pre-2024 tests for progressive rates:
Breakdown tag for flat_rate.yaml: |
PR Review✅ No Critical IssuesCI passes and the core implementation is correct. The 🟡 Should Address
🟢 Suggestions
Validation Summary
Next StepsTo auto-fix issues: Or address manually and re-request review. |
Addresses PR review feedback for missing test coverage: 1. Added filing status tests for SEPARATE, HEAD_OF_HOUSEHOLD, and SURVIVING_SPOUSE for both Anne Arundel and Frederick counties 2. Added boundary tests at exact bracket thresholds: - Anne Arundel: $50K, $75K, $400K boundaries - Frederick: $25K, $50K, $100K, $150K boundaries 3. Added Cecil County 2024 period tests (rate: 2.75%) 4. Added high-income $500K tests in flat-rate years (2021) to verify that .inf brackets don't interfere with calculations Total: 150 MD county tax tests now pass Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes Applied ✅🟡 Should-Address Issues Fixed
Verification
Test Count Summary
Ready for re-review. 🤖 Generated with Claude Code |
Fixes #6436