powersimdata.input package

Subpackages

Submodules

powersimdata.input.abstract_grid module

class powersimdata.input.abstract_grid.AbstractGrid[source]

Bases: object

Grid Builder.

powersimdata.input.abstract_grid.storage_template()[source]

Get storage

Returns:

(dict) – storage structure for MATPOWER/MOST

powersimdata.input.change_table module

class powersimdata.input.change_table.ChangeTable(grid)[source]

Bases: object

Create change table for changes that need to be applied to the original grid as well as to the original demand, hydro, solar and wind profiles. A pickle file enclosing the change table in form of a dictionary can be created and transferred on the server. Keys are ‘demand’, ‘branch’, ‘dcline’, ‘new_branch’, ‘new_dcline’, ‘new_plant’, ‘storage’, ‘[resource]’, ‘[resource]_cost’, and ‘[resource]_pmin’,; where ‘resource’ is defined in powersimdata.network.constants.plants.Resource and depends on the grid model. If a key is missing in the dictionary, then no changes will be applied. The data structure is given below:

  • ‘demand’:

    value is a dictionary. The latter has ‘zone_id’ as keys and a factor indicating the desired increase/decrease of load in zone (1.2 would correspond to a 20% increase while 0.95 would be a 5% decrease) as value.

  • ‘branch’:

    value is a dictionary. The latter has ‘branch_id’ and/or ‘zone_id’ as keys. The ‘branch_id’ dictionary has the branch ids as keys while the ‘zone_id’ dictionary has the zone ids as keys. The value of those dictionaries is a factor indicating the desired increase/decrease of capacity of the line or the lines in the zone (1.2 would correspond to a 20% increase while 0.95 would be a 5% decrease).

  • ‘[resource]’:

    value is a dictionary. The latter has ‘plant_id’ and/or ‘zone_id’ as keys. The ‘plant_id’ dictionary has the plant ids as keys while the ‘zone_id’ dictionary has the zone ids as keys. The value of those dictionaries is a factor indicating the desired increase/decrease of capacity of the plant or plants in the zone fueled by ‘[resource]’ (1.2 would correspond to a 20% increase while 0.95 would be a 5% decrease).

  • ‘[resource]_cost’:

    value is a dictionary. The latter has ‘plant_id’ and/or ‘zone_id’ as keys. The ‘plant_id’ dictionary has the plant ids as keys while the ‘zone_id’ dictionary has the zone ids as keys. The value of those dictionaries is a factor indicating the desired increase/decrease of cost of the plant or plants in the zone fueled by ‘[resource]’ (1.2 would correspond to a 20% increase while 0.95 would be a 5% decrease).

  • ‘[resource]_pmin:

    value is a dictionary. The latter has ‘plant_id’ and/or ‘zone_id’ as keys. The ‘plant_id’ dictionary has the plant ids as keys while the ‘zone_id’ dictionary has the zone ids as keys. The value of those dictionaries is a factor indicating the desired increase/decrease of minimum generation of the plant or plants in the zone fueled by ‘[resource]’ (1.2 would correspond to a 20% increase while 0.95 would be a 5% decrease).

  • ‘dcline’:

    value is a dictionary. The latter has ‘dcline_id’ as keys and the and the scaling factor for the increase/decrease in capacity of the line as value.

  • ‘storage’:

    value is a list. Each entry in this list is a dictionary enclosing all the information needed to add a new storage device to the grid. The keys in the dictionary are: ‘bus_id’, ‘capacity’, “duration”, “min_stor”, “max_stor”, “energy_value”, “InEff”, “OutEff”, “LossFactor”, “terminal_min”, and “terminal_max”. See the add_storage_capacity() method for details.

  • ‘new_dcline’:

    value is a list. Each entry in this list is a dictionary enclosing all the information needed to add a new dcline to the grid. The keys in the dictionary are: ‘capacity’, ‘from_bus_id’ and ‘to_bus_id’ with values giving the capacity of the HVDC line and the bus id at each end of the line.

  • ‘new_branch’:

    value is a list. Each entry in this list is a dictionary enclosing all the information needed to add a new branch to the grid. The keys in the dictionary are: ‘capacity’, ‘from_bus_id’ and ‘to_bus_id’ with values giving the capacity of the line and the bus id at each end of the line.

  • ‘new_plant’:

    value is a list. Each entry in this list is a dictionary enclosing all the information needed to add a new generator to the grid. The keys in the dictionary are ‘type’, ‘bus_id’, ‘Pmax’ for renewable generators and ‘type’, ‘bus_id’, ‘Pmax’, ‘c0’, ‘c1’, ‘c2’ for thermal generators. An optional ‘Pmin’ can be passed for both renewable and thermal generators. The values give the fuel type, the identification number of the bus, the maximum capacity of the generator, the coefficients of the cost curve (polynomials) and optionally the minimum capacity of the generator.

  • ‘new_bus’:

    value is a list. Each entry in this list is a dictionary enclosing all the information needed to add a new bus to the grid. The keys in the dictionary are: ‘lat’, ‘lon’, one of ‘zone_id’/’zone_name’, and optionally ‘Pd’, specifying the location of the bus, the demand zone, and optionally the nominal demand at that bus (defaults to 0).

  • ‘remove_branch’:

    value is a set. Each entry in this set is a branch ID to be removed.

  • ‘remove_bus’:

    value is a set. Each entry in this set is a bus ID to be removed.

  • ‘remove_dcline’:

    value is a set. Each entry in this set is a DC line ID to be removed.

  • ‘remove_plant’:

    value is a set. Each entry in this set is a plant ID to be removed.

add_branch(info)[source]

Sets parameters of new branch(es) in change table.

Parameters:

info (list) – each entry is a dictionary. The dictionary gathers the information needed to create a new branch. Required keys: “from_bus_id”, “to_bus_id”, “capacity”.

Raises:

TypeError – if info is not a list.

add_bus(info)[source]

Sets parameters of new bus(es) in change table.

See powersimdata.input.changes.bus.add_bus()

add_dcline(info)[source]

Adds HVDC line(s).

Parameters:

info (list) – each entry is a dictionary. The dictionary gathers the information needed to create a new dcline. Required keys: “from_bus_id”, “to_bus_id”. Optional keys: “capacity”, “Pmax”, “Pmin”. “capacity” denotes a bidirectional power limit (MW). “Pmax” denotes a limit on power flowing from ‘from’ end to ‘to’ end. “Pmin” denotes a limit on power flowing from ‘from’ end to ‘to’ end. Either “capacity” XOR (“Pmax” and “Pmin”) must be provided. capacity: 200 is equivalent to Pmax: 200, Pmin: -200.

Raises:

TypeError – if info is not a list.

add_demand_flexibility(info)[source]

Adds demand flexibility to the system.

See powersimdata.input.changes.demand_flex.add_demand_flexibility()

add_electrification(kind, info)[source]

Add profiles and scaling factors for electrified demand.

See powersimdata.input.changes.electrification.add_electrification()

add_plant(info)[source]

Sets parameters of new generator(s) in change table.

See powersimdata.input.changes.plant.add_plant()

add_storage_capacity(info)[source]

Sets storage parameters in change table.

See powersimdata.input.changes.storage.add_storage_capacity()

clear(which=None)[source]

Clear all or part of the change table.

Parameters:

which (str/set) – str or set of strings of what to clear from self.ct If None (default), everything is cleared.

remove_branch(info)[source]

Remove one or more branches.

Parameters:

info (int/iterable) – iterable of branch indices, or a single branch index.

Raises:

ValueError – if info contains one or more entries not present in the branch table index.

remove_bus(info)[source]

Remove one or more buses.

See powersimdata.input.changes.bus.remove_bus()

remove_dcline(info)[source]

Remove one or more DC lines.

Parameters:

info (int/iterable) – iterable of DC line indices, or a single index.

Raises:

ValueError – if info contains one or more entries not present in the dcline table index.

remove_plant(info)[source]

Remove one or more plants.

See powersimdata.input.changes.plant.remove_plant()

scale_branch_capacity(zone_name=None, branch_id=None)[source]

Sets branch capacity scaling factor in change table.

Parameters:
  • zone_name (dict) – load zones. The key(s) is (are) the name of the load zone(s) and the associated value is the scaling factor for the increase/decrease in capacity of all the branches in the load zone. Only lines that have both ends in zone are considered.

  • branch_id (dict) – identification numbers of branches. The key(s) is (are) the id of the line(s) and the associated value is the scaling factor for the increase/decrease in capacity of the line(s).

scale_congested_mesh_branches(ref_scenario, **kwargs)[source]

Scales congested branches based on previous scenario results.

Parameters:

ref_scenario (powersimdata.scenario.scenario.Scenario) – the reference scenario to be used in determining branch scaling.

Optional kwargs as documented in the

powersimdata.design.transmission.upgrade module.

scale_dcline_capacity(dcline_id)[source]

Sets DC line capacity scaling factor in change table.

Parameters:

dcline_id (dict) – identification numbers of dc line. The key(s) is (are) the id of the line(s) and the associated value is the scaling factor for the increase/decrease in capacity of the line(s).

scale_demand(zone_name=None, zone_id=None)[source]

Sets load scaling factor in change table.

Parameters:
  • zone_name (dict) – load zones. The key(s) is (are) the name of the load zone(s) and the value is the scaling factor for the increase/decrease in load.

  • zone_id (dict) – identification numbers of the load zones. The key(s) is (are) the id of the zone(s) and the associated value is the scaling factor for the increase/decrease in load.

scale_plant_capacity(resource, zone_name=None, plant_id=None)[source]

Sets plant capacity scaling factor in change table.

Parameters:
  • resource (str) – type of generator to consider.

  • zone_name (dict) – load zones. The key(s) is (are) the name of the load zone(s) and the associated value is the scaling factor for the increase/decrease in capacity of all the generators fueled by specified resource in the load zone.

  • plant_id (dict) – identification numbers of plants. The key(s) is (are) the id of the plant(s) and the associated value is the scaling factor for the increase/decrease in capacity of the generator.

scale_plant_cost(resource, zone_name=None, plant_id=None)[source]

Sets plant cost scaling factor in change table.

Parameters:
  • resource (str) – type of generator to consider.

  • zone_name (dict) – load zones. The key(s) is (are) the name of the load zone(s) and the associated value is the scaling factor for the increase/decrease in cost of all the generators fueled by specified resource in the load zone.

  • plant_id (dict) – identification numbers of plants. The key(s) is (are) the id of the plant(s) and the associated value is the scaling factor for the increase/decrease in cost of the generator.

scale_plant_pmin(resource, zone_name=None, plant_id=None)[source]

Sets plant cost scaling factor in change table.

See powersimdata.input.changes.plant.scale_plant_pmin()

scale_renewable_stubs(**kwargs)[source]

Scales undersized stub branches connected to renewable generators.

Optional kwargs as documented in the

powersimdata.design.transmission.upgrade module.

powersimdata.input.check module

powersimdata.input.check.check_grid(grid)[source]

Check whether an object is an internally-consistent Grid object.

Parameters:

grid (powersimdata.input.grid.Grid) – grid or grid-like object to check.

Raises:

ValueError – if grid has any inconsistency

powersimdata.input.configure module

powersimdata.input.configure.adjust_pmin(grid)[source]

Adjust plant Pmin values inplace

Parameters:

grid (powersimdata.input.grid.Grid) – a grid object

powersimdata.input.configure.adjust_ramp30(plant)[source]

Adjust plant ramp_30 values inplace

Parameters:

plant (pandas.DataDrame) – a plant dataframe

powersimdata.input.configure.linearize_gencost(gencost_before, plant, num_segments=1)[source]

Updates the generator cost information to include piecewise linear cost curve information. Allows the user to specify the number of piecewise segments into which the cost curve should be split.

Parameters:
  • gencost_before (pandas.DataFrame) – the original gencost

  • plant (pandas.DataFrame) – the generator information containing Pmin/Pmax

  • num_segments (int) – The number of segments into which the piecewise linear cost curve will be split.

Returns:

(pandas.DataFrame) – An updated DataFrame containing the piecewise linear cost curve parameters.

Raises:

ValueError – if the generator cost curve is not of an acceptable form.

powersimdata.input.electrified_demand_input module

class powersimdata.input.electrified_demand_input.ElectrifiedDemand[source]

Bases: ProfileInput

Loads electrification profile data

get_profile(grid_model, kind, profile)[source]

Get the specified profile

Parameters:
  • grid_model (str) – the grid model

  • kind (str) – the kind of electrification

  • profile (str) – the filename

Returns:

(pandas.DataFrame) – profile data frame

get_profile_version(grid_model, kind, end_use, tech)[source]

Returns available raw profile from blob storage or local disk.

Parameters:
  • grid_model (str) – grid model.

  • kind (str) – ‘building’, ‘transportation’

  • end_use (str) – electrification use case

  • tech (str) – the technology used for the given use case

Returns:

(list) – available profile version.

powersimdata.input.electrified_demand_input.get_profile_version(_fs, grid_model, kind, end_use, tech)[source]

powersimdata.input.expansion_candidates module

class powersimdata.input.expansion_candidates.ExpansionCandidates(grid)[source]

Bases: object

Instantiate a data structure to hold candidates for expansion in a capacity expansion model.

Parameters:

grid (powersimdata.input.grid.Grid) – reference grid

branch: DataFrame
plant: DataFrame
set_branch(branch)[source]

Validate and assign branch candidates

Parameters:

branch (pd.DataFrame) – branch dataframe

set_plant(plant)[source]

Validate and assign plant candidates

Parameters:

plant (pd.DataFrame) – plant dataframe

set_storage(storage)[source]

Validate and assign storage candidates

Parameters:

storage (pd.DataFrame) – storage dataframe

storage: DataFrame
powersimdata.input.expansion_candidates.check_branch(branch, grid)[source]

Check branch expansion candidates relative to a specific grid

Parameters:
powersimdata.input.expansion_candidates.check_branch_voltage(branch, grid)[source]

Check that branches are attached to buses with the same voltage

Parameters:
Raises:

ValueError – if any branches have mismatched voltage

powersimdata.input.expansion_candidates.check_bus_id(bus_id, grid)[source]

Check that buses are within the given grid

Parameters:
Raises:

ValueError – if any buses are not in the grid

powersimdata.input.expansion_candidates.check_plant(plant, grid)[source]

Check plant expansion candidates relative to a specific grid

Parameters:
powersimdata.input.expansion_candidates.check_storage(storage, grid)[source]

Check storage expansion candidates relative to a specific grid

Parameters:

powersimdata.input.grid module

class powersimdata.input.grid.Grid(interconnect, source='usa_tamu', **kwargs)[source]

Bases: object

SUPPORTED_IMPORTS = {'pypsa'}
SUPPORTED_MODELS = {'europe_tub', 'usa_tamu'}

Grid

Parameters:
  • interconnect (str/iterable) – geographical region covered. Either the region (e.g. USA), one of the interconnects in the region or a combination of the interconnects in the region. The full list of interconnects of the grid models is defined in powersimdata.network.constants.model.model2interconnect.

  • source (str) – model used to build the network. Can be one of the supported models

Raises:
  • TypeError – if source is not a string.

  • ValueError – if source is not a supported grid model.

powersimdata.input.helpers module

powersimdata.input.helpers.decompose_plant_data_frame_into_areas(df, areas, grid)[source]

Take a plant-column data frame and decompose it into plant-column data frames for areas.

Parameters:
  • df (pandas.DataFrame) – data frame, columns are plant id in grid.

  • areas (dict) – areas to use for decomposition. Keys are area types (’loadzone’, ‘state’, or ‘interconnect’), values are str/list/tuple/set of areas.

  • grid (powersimdata.input.grid.Grid) – Grid instance.

Returns:

(dict) – keys are areas, values are plant-column data frames.

powersimdata.input.helpers.decompose_plant_data_frame_into_areas_and_resources(df, areas, resources, grid)[source]

Take a plant-column data frame and decompose it into plant-column data frames for each resources-areas combinations.

Parameters:
  • df (pandas.DataFrame) – data frame, columns are plant id in grid.

  • areas (dict) – areas to use for decomposition. Keys are area types (’loadzone’, ‘state’ or ‘interconnect’), values are str/list/tuple/set of areas.

  • resources (str/list/tuple/set) – resource(s) to use for decomposition.

  • grid (powersimdata.input.grid.Grid) – Grid instance.

Returns:

(dict) – keys are areas, values are dictionaries whose keys are resources and values are data frames indexed by (datetime, plant) where plant include only plants of matching type and located in area.

powersimdata.input.helpers.decompose_plant_data_frame_into_resources(df, resources, grid)[source]

Take a plant-column data frame and decompose it into plant-column data frames for each resource.

Parameters:
  • df (pandas.DataFrame) – data frame, columns are plant id in grid.

  • resources (str/list/tuple/set) – resource(s) to use for decomposition.

  • grid (powersimdata.input.grid.Grid) – Grid instance.

Returns:

(dict) – keys are resources, values are plant-column data frames.

powersimdata.input.helpers.decompose_plant_data_frame_into_resources_and_areas(df, resources, areas, grid)[source]

Take a plant-column data frame and decompose it into plant-column data frames for each resources-areas combinations.

Parameters:
  • df (pandas.DataFrame) – data frame, columns are plant id in grid.

  • resources (str/list/tuple/set) – resource(s) to use for decomposition.

  • areas (dict) – areas to use for decomposition. Keys are area types (’loadzone’, ‘state’, ‘state_abv’ or ‘interconnect’), values are str/list/tuple/set of areas.

  • grid (powersimdata.input.grid.Grid) – Grid instance.

Returns:

(dict) – keys are resources, values are dictionaries whose keys are areas and values are data frames indexed by (datetime, plant) where plant include only plants of matching type and located in area.

powersimdata.input.helpers.get_active_resources_in_grid(grid)[source]

Get active resources in grid.

Parameters:

grid (powersimdata.input.grid.Grid) – a Grid instance.

Returns:

(set) – name of active resources in grid.

powersimdata.input.helpers.get_plant_id_for_resources(resources, grid)[source]

Get plant id for plants fueled by resource(s).

Parameters:
Returns:

(set) – list of plant id.

powersimdata.input.helpers.get_plant_id_for_resources_in_area(scenario, area, resources, area_type=None)[source]

Get the list of plant ids of certain resources in the specific area of a scenario.

Parameters:
  • scenario (powersimdata.scenario.scenario.Scenario) – scenario instance

  • area (str) – one of loadzone, state, state abbreviation, interconnect, ‘all’

  • resources (str/list) – one or a list of resources

  • area_type (str) – one of ‘loadzone’, ‘state’, ‘state_abbr’, ‘interconnect’

Returns:

(list) – list of plant id

powersimdata.input.helpers.get_plant_id_for_resources_in_interconnects(resources, interconnects, grid)[source]

Get plant id for for plants fueled by resource(s) in interconnect(s).

Parameters:
  • resources (str/list/tuple/set) – name of resource(s).

  • interconnects (str/list/tuple/set) – name of interconnect(s).

  • grid (powersimdata.input.grid.Grid) – a Grid instance.

Returns:

(set) – list of plant id.

powersimdata.input.helpers.get_plant_id_for_resources_in_loadzones(resources, loadzones, grid)[source]

Get plant id for plants fueled by resource(s) in load zone(s).

Parameters:
  • resources (str/list/tuple/set) – name of resource(s).

  • loadzones (str/list/tuple/set) – name of load zone(s).

  • grid (powersimdata.input.grid.Grid) – a Grid instance.

Returns:

(set) – list of plant id.

powersimdata.input.helpers.get_plant_id_for_resources_in_states(resources, states, grid)[source]

Get plant id for for plants fueled by resource(s) in state(s).

Parameters:
  • resources (str/list/tuple/set) – name of resource(s).

  • states (str/list/tuple/set) – state(s) name or abbreviation.

  • grid (powersimdata.input.grid.Grid) – a Grid instance.

Returns:

(set) – list of plant id

powersimdata.input.helpers.get_plant_id_in_interconnects(interconnects, grid)[source]

Get plant id for plants in interconnect(s).

Parameters:
Returns:

(set) – list of plant id

powersimdata.input.helpers.get_plant_id_in_loadzones(loadzones, grid)[source]

Get plant id for plants in loadzone(s).

Parameters:
Returns:

(set) – list of plant id.

powersimdata.input.helpers.get_plant_id_in_states(states, grid)[source]

Get plant id for plants in state(s).

Parameters:
Returns:

(set) – list of plant id.

powersimdata.input.helpers.get_resources_in_grid(grid)[source]

Get resources in grid.

Parameters:

grid (powersimdata.input.grid.Grid) – a Grid instance.

Returns:

(set) – name of all resources in grid.

powersimdata.input.helpers.get_storage_id_in_area(scenario, area, area_type=None)[source]

Get the list of storage ids in the specific area of a scenario

Parameters:
  • scenario (powersimdata.scenario.scenario.Scenario) – scenario instance

  • area (str) – one of loadzone, state, state abbreviation, interconnect, ‘all’

  • area_type (str) – one of ‘loadzone’, ‘state’, ‘state_abbr’, ‘interconnect’

Returns:

(list) – list of storage id

powersimdata.input.helpers.summarize_plant_to_bus(df, grid, all_buses=False)[source]

Take a plant-column data frame and sum to a bus-column data frame.

Parameters:
  • df (pandas.DataFrame) – dataframe, columns are plant id in grid.

  • grid (powersimdata.input.grid.Grid) – Grid instance.

  • all_buses (boolean) – return all buses in grid, not just plant buses.

Returns:

(pandas.DataFrame) – index as df input, columns are buses.

powersimdata.input.helpers.summarize_plant_to_location(df, grid)[source]

Take a plant-column data frame and sum to a location-column data frame.

Parameters:
Returns:

(pandas.DataFrame) – index: df index, columns: location tuples.

powersimdata.input.input_base module

class powersimdata.input.input_base.InputBase[source]

Bases: object

Define abstract methods and common implementation for subclasses that interact with scenario input data.

get_data(scenario_info, field_name)[source]

Returns data from (possibly remote) filesystem and cache the result in memory.

Parameters:
  • scenario_info (dict) – scenario information.

  • field_name (str) – defined by subclass

Returns:

(object) – implementation dependent

powersimdata.input.input_data module

class powersimdata.input.input_data.InputData[source]

Bases: InputBase

Load input data.

save_change_table(ct, scenario_id)[source]

Saves change table to the data store.

Parameters:
  • ct (dict) – a change table

  • scenario_id (str) – scenario id, used for file name

powersimdata.input.input_data.distribute_demand_from_zones_to_buses(zone_demand, bus)[source]

Decomposes zone demand to bus demand based on bus ‘Pd’ column.

Parameters:
  • zone_demand (pandas.DataFrame) – demand by zone. Index is timestamp, columns are zone IDs, values are zone demand (MW).

  • bus (pandas.DataFrame) – table of bus data, containing at least ‘zone_id’ and ‘Pd’ columns.

Returns:

(pandas.DataFrame) – data frame of demand. Index is timestamp, columns are bus IDs, values are bus demand (MW).

Raises:

ValueError – if the columns of zone_demand don’t match the set of zone IDs within the ‘zone_id’ column of bus.

powersimdata.input.profile_input module

class powersimdata.input.profile_input.ProfileInput[source]

Bases: InputBase

Loads profile data

get_profile_version(grid_model, kind)[source]

Returns available raw profile from blob storage or local disk.

Parameters:
  • grid_model (str) – grid model.

  • kind (str) – ‘demand’, ‘hydro’, ‘solar’, ‘wind’, ‘demand_flexibility_up’, ‘demand_flexibility_dn’, ‘demand_flexibility_cost_up’, or ‘demand_flexibility_cost_dn’.

Returns:

(list) – available profile version.

upload(grid_model, name, profile)[source]

Upload the given profile to blob storage and local cache

Parameters:
  • grid_model (str) – the grid model

  • name (str) – the file name for the profile, without extension

  • profile (pandas.DataFrame) – profile data frame

Raises:

ValueError – if no credential with write access is set

powersimdata.input.profile_input.get_profile_version(_fs, grid_model, kind)[source]

Returns available raw profile from the given filesystem

Parameters:
  • _fs (fs.base.FS) – filesystem instance

  • grid_model (str) – grid model.

  • kind (str) – ‘demand’, ‘hydro’, ‘solar’, ‘wind’, ‘demand_flexibility_up’, ‘demand_flexibility_dn’, ‘demand_flexibility_cost_up’, or ‘demand_flexibility_cost_dn’.

Returns:

(list) – available profile version.

powersimdata.input.transform_demand module

class powersimdata.input.transform_demand.TransformDemand(grid, ct, kind)[source]

Bases: object

Aggregate demand from electrified sources.

Parameters:
  • grid (powersimdata.input.grid.Grid) – a grid object

  • powersimdata.input.change_table.ChangeTable – a change table object

  • kind (str) – the class of electrification, e.g. building, transportation

get_profile(profile)[source]

Get transformed profile

Parameters:

profile (str) – the profile name, without file extension

Returns:

(pandas.DataFrame) – the scaled profile, filtered to the zones within the current grid

value()[source]

Return the combined electrified demand

Returns:

(pandas.DataFrame) – data frame with hourly index and zone columns, where the values are demand (in MWh)

powersimdata.input.transform_grid module

class powersimdata.input.transform_grid.TransformGrid(grid, ct)[source]

Bases: object

Transforms grid according to operations listed in change table.

get_grid()[source]

Returns the transformed grid.

Returns:

(powersimdata.input.grid.Grid) – a Grid object.

powersimdata.input.transform_grid.voltage_to_x_per_distance(grid)[source]

Calculates reactance per distance for voltage level.

Parameters:

grid (powersimdata.input.grid.Grid) – a Grid object instance.

Returns:

(dict) – bus voltage to average reactance per mile.

powersimdata.input.transform_profile module

class powersimdata.input.transform_profile.TransformProfile(scenario_info, grid, ct, slice=True)[source]

Bases: object

Transform profile according to operations listed in change table.

get_profile(name)[source]

Return profile.

Parameters:

name (str) – either demand, ‘demand_flexibility_up’, ‘demand_flexibility_dn’, ‘demand_flexibility_cost_up’, ‘demand_flexibility_cost_dn’ or a generator type with profile.

Returns:

(pandas.DataFrame) – profile.

Raises:

ValueError – if argument not one of ‘demand’, ‘demand_flexibility_up’, ‘demand_flexibility_dn’, ‘demand_flexibility_cost_up’, ‘demand_flexibility_cost_dn’ or a generator type wit profile.

Module contents