powersimdata.network package

Subpackages

Submodules

powersimdata.network.csv_reader module

class powersimdata.network.csv_reader.CSVReader(data_loc)[source]

Bases: object

Read CSV files enclosing a grid model.

Parameters:

data_loc (str) – path to data.

powersimdata.network.csv_reader.read(data_loc, filename)[source]

Reads CSV.

Returns:

(pandas.DataFrame) – created data frame.

powersimdata.network.helpers module

powersimdata.network.helpers.check_and_format_interconnect(interconnect, model='hifld')[source]

Checks interconnect in a grid model.

Parameters:
  • interconnect (str/iterable) – interconnect name(s).

  • model (str) – the grid model.

Returns:

(list) – interconnect(s)

Raises:
  • TypeError – if interconnect is not a str.

  • ValueError – if interconnect is not in the model. if combination of interconnects is incorrect.

powersimdata.network.helpers.check_model(model)[source]

Check that a grid model exists.

Parameters:

model (str) – grid model name

Raises:
  • TypeError – if model is not a str.

  • ValueError – if grid model does not exist.

powersimdata.network.helpers.get_zone_info(model='hifld')[source]

Return information loacated in the zone CSV file of the model.

Parameters:

model (str) – the grid model.

Returns:

(pandas.DataFrame) – information on the zones of the model.

Raises:

FileNotFoundError – if file enclosing the geographical information of the grid model can’t be found.

powersimdata.network.helpers.interconnect_to_name(interconnect, model='hifld')[source]

Return name of interconnect or collection of interconnects for a grid model.

Parameters:
  • interconnect (str/iterable) – interconnect name(s).

  • model (str) – the grid model.

Returns:

(str): name of grid model.

powersimdata.network.helpers.powerset(l, r)[source]

powersimdata.network.model module

class powersimdata.network.model.ModelImmutables(model, interconnect=None, zone=None)[source]

Bases: object

Immutables for a grid model.

Parameters:
  • model (str) – grid model name.

  • interconnect (str) – interconnect of grid model.

  • zone (pandas.DataFrame) – a data frame with loadzone name (‘zone_name’), division name (e.g. ‘state’ name for USA grid models), interconnect name (‘interconnect’), time zone of loadzone (‘time_zone’) and division abbreviation (‘abv’) as columns; and loadzone id (‘zone_id’) as indices. If None, it will be assumed that the data frame can be built from a CSV file stored on disk.

area_to_loadzone(*args, **kwargs)[source]

Map the query area to a list of loadzones, using the known grid model.

powersimdata.network.model.area_to_loadzone(model, area, area_type=None, zone=None)[source]

Map the query area to a list of loadzones.

Parameters:
  • model (str) – grid model to use to look up constants for mapping.

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

  • area_type (str) – one of ‘loadzone’, ‘state’/’country’, ‘state_abbr’/’country_abbr’, ‘interconnect’. If None, area will be searched successively into ‘state’/’country’, ‘loadzone’, ‘state abbreviation’/’country abbreviation’, ‘interconnect’ and ‘all’.

  • zone (pandas.DataFrame) – a data frame with loadzone name (‘zone_name’), division name (e.g. ‘state’ name for USA grid models), interconnect name (‘interconnect’), time zone of loadzone (‘time_zone’) and division abbreviation (‘abv’) as columns; and loadzone id (‘zone_id’) as indices. If None, it will be assumed that the data frame can be built from a CSV file stored on disk.

Returns:

(set) – set of loadzone names located in the query area.

Raises:
  • TypeError – if area is not a str. if area_type is not None or str.

  • ValueError – if area is invalid if combination of area and area_type is invalid.

powersimdata.network.zenodo module

class powersimdata.network.zenodo.Zenodo(record_id)[source]

Bases: object

Get data from a Zenodo archive.

Parameters:

record_id (str) – zenodo record id

load_data(model_dir)[source]

Download file(s)

Parameters:

model_dir (str) – path to directory of the grid model.

Raises:

FileNotFoundError – if model_dir does not exist.

Module contents