Skip to content

Time sequential module broken for BDU due to dispatch_type merge column not existing #39

@jpolyy

Description

@jpolyy

FYI: There is a bug in time_sequential.py where since BDUs in nempy require the dispatch_type column to differentiate between gen and load, this module has not been updated and as a result there are duplicate row entries when construct_ramp_rate_parameters and create_seed_ramp_rate_parameters.

My fix is below here:

Current

def construct_ramp_rate_parameters(last_interval_dispatch, ramp_rates):
    ...
    last_interval_energy_dispatch = last_interval_dispatch[last_interval_dispatch['service'] == 'energy']
    last_interval_energy_dispatch = last_interval_energy_dispatch.loc[:, ['unit', 'dispatch']]
    last_interval_energy_dispatch.columns = ['unit', 'initial_output']
    ramp_rates = pd.merge(last_interval_energy_dispatch, ramp_rates, how='right', on='unit')

Patched

def construct_ramp_rate_parameters(last_interval_dispatch, ramp_rates):
    ...
    last_interval_energy_dispatch = last_interval_dispatch[last_interval_dispatch['service'] == 'energy']
    last_interval_energy_dispatch = last_interval_energy_dispatch.loc[:, ['unit', 'dispatch_type','dispatch']]
    last_interval_energy_dispatch.columns = ['unit','dispatch_type', 'initial_output']
    ramp_rates = pd.merge(last_interval_energy_dispatch, ramp_rates, how='right', on=['unit','dispatch_type'])

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