Skip to content

Get customer counts for NY utilities, central utility crosswalk, and tariff mapper fixes #119

@jpvelez

Description

@jpvelez

What

Get customer counts for NY electric utilities (EIA-861), add a central utility crosswalk, fix tariff mappers to use real assign_utility data, and standardize on std_name throughout. Expanded scope from original: beyond the reweighting CSV, this establishes a single source of truth for utility identifiers across EIA-861, NY Open Data polygons, assign_utility_ny, tariff mappers, and eia_region_config.

Why

We need to reweight the ResStock customer counts for each utility we model for internally consistent results. Additionally, utility names from EIA-861, NY Open Data, and tariff mappers were fragmented—no single mapping. Tariff mappers were using synthetic data instead of real assign_utility_ny output.

How

  • Central crosswalk: utils/utility_codes.py with one record per utility (std_name, ny_open_data_state_names, eia_utility_ids, gas_tariff_key, etc.). All lookup tables derived from this.
  • Refactor assign_utility_ny to use get_ny_open_data_to_std_name() from utility_codes
  • Add utility_code column to get_utility_stats_from_eia861 output (EIA ID → std_name mapping)
  • Fix electric_tariff_mapper: use real sb.electric_utility when present, support metadata_utility path, accept std_name (coned, nyseg, nimo)
  • Fix gas_tariff_mapper: use crosswalk for gas_tariff_key (nimo/keddy/kedli→national_grid), same metadata and std_name fixes
  • Update utils/types.py: electric_utility and gas_utility Literals use std_name
  • Update Justfiles (NY, RI) to use std_name in map-electric-tariff and map-gas-tariff recipes
  • Use that script to get customer counts for NY IOUs, save to ny/hp_rates/data/ny_electric_utility_stats.csv (includes utility_code)
  • Add a task to the Justfile in ny/hp_rates/resstock that calls the reweighting script on every utility in NY using the customer counts from the previous step (future work)

Deliverables

  • utils/utility_codes.py — central crosswalk
  • utils/get_utility_stats_from_eia861.py — outputs utility_code column
  • Tariff mappers use real data when available; synthetic fallback deprecated
  • ny_electric_utility_stats.csv with utility_code for NY IOUs
  • Tests for utility_codes, tariff mappers, assign_utility refactor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions