Skip to content

Fix decenial#35

Merged
mmann1123 merged 5 commits intomainfrom
fix_decenial
Nov 3, 2025
Merged

Fix decenial#35
mmann1123 merged 5 commits intomainfrom
fix_decenial

Conversation

@mmann1123
Copy link
Copy Markdown
Owner

This pull request introduces several improvements and fixes across the codebase, focusing on enhanced geographic data handling, improved error messaging for optional dependencies, updated documentation and examples, and dependency management. The most important changes are grouped below by theme.

Geographic Data Handling Improvements

  • Added a _normalize_column_names function in pytidycensus/geography.py to standardize column names from pygris outputs, ensuring consistent access to key fields like STATEFP, COUNTYFP, TRACTCE, and BLKGRPCE across different file types and years. This normalization is now applied throughout the get_geography function for all supported geography types. [1] [2] [3] [4] [5]
  • Improved fallback and error handling in pygris boundary downloads, including more robust error detection and warnings for GENZ2020 file issues. [1] [2]
  • Fixed and clarified logic for filtering counties by state in get_geography.
  • Standardized function calls and formatting for pygris-based geography functions. [1] [2] [3] [4]
  • Improved GEOID construction logic for block groups, CBSAs, and ZCTAs to handle variable column names.

Error Handling and Optional Dependencies

  • Updated pytidycensus/__init__.py to catch all exceptions (not just ImportError) when importing optional mapping dependencies, and added a warning message to guide users on how to install missing dependencies for mapping features.

Documentation and Examples

  • Added a new quick example to docs/time_series_analysis.md demonstrating how to handle changing variable codes over time with the get_time_series function.
  • Expanded examples/test.py with new usage examples for time series analysis, including handling changing variable codes and boundary alignment.
  • Updated docs/examples/01_basic_usage.ipynb to show clearer error output for invalid Census API keys, updated kernel and Python version metadata, and adjusted execution counts for reproducibility. [1] [2] [3] [4] [5]

Dependency Management

  • Added tobler>=0.12.1 as a required dependency in pyproject.toml to support advanced geographic operations.
  • Bumped package version to 1.2.2 in pyproject.toml.

Minor Code and Documentation Cleanups

  • Cleaned up docstring formatting in pytidycensus/flows.py and pytidycensus/mapping.py. [1] [2]
  • Minor formatting fixes and code style improvements in flow geometry handling. [1] [2] [3] [4]

These changes collectively improve the robustness, usability, and documentation of the package, especially for advanced geographic and time series analysis workflows.

@mmann1123 mmann1123 merged commit 6108d2b into main Nov 3, 2025
16 checks passed
@mmann1123 mmann1123 deleted the fix_decenial branch November 3, 2025 16:40
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.

1 participant