Add Phase 4: tidy output, MOE scaling, geometry for flows, and survey metadata#298
Conversation
… metadata Implement stubbed parameters across estimates and flows modules: - output="tidy" support for get_estimates() and get_flows() - moe_level scaling (90/95/99) for get_flows() - geometry support for get_flows() via attach_geometry() - GEOID construction for flows from origin FIPS columns Add get_survey_metadata() in pypums/survey.py that fetches dataset catalog from the Census API discovery endpoint, with optional year filtering. Export get_survey_metadata from pypums/__init__.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @chekos's task in 2m 0s —— View job Code Review — Phase 4: tidy output, MOE scaling, geometry for flows, and survey metadata
SummaryThe implementation is clean and well-tested overall. I found a few bugs worth addressing before merge. Bugs🔴 Cache key bug —
|
- Include output and moe_level in cache keys for flows.py and estimates.py to prevent stale cache hits across different formats - Map 'metropolitan statistical area' to 'cbsa' before calling attach_geometry() so geometry=True works for MSA-level flows - Remove stale 'Not yet implemented' docstring from estimates.py output parameter - Scaffold column names in get_survey_metadata() so empty catalogs return a DataFrame with the expected columns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @chekos's task in 49s —— View job Review feedback verification — all fixes confirmed ✅
All four issues from the previous review have been properly addressed in commit 🟢 Cache key —
|
Summary
output="tidy"forget_estimates()andget_flows()(melts value columns into long format, following the pattern inget_acs())moe_levelscaling (90/95/99) forget_flows()using z-score ratiosgeometry=Truesupport forget_flows()viaattach_geometry(), with GEOID construction from origin FIPS columnsget_survey_metadata()function inpypums/survey.pythat fetches the Census API discovery endpoint (data.json) and returns available datasets, with optional year filteringget_survey_metadatafrompypums/__init__.pybreakdown_labelsandtime_seriesremain documented as not yet implemented (forward-compatible stubs)Test plan
uv run --extra test pytest tests/ -v)🤖 Generated with Claude Code