aeso.atc — Available transfer capacity limits

Contains helpers to access AESO’s Available Transfer Capacity report at <http://itc.aeso.ca/itc/public/atcQuery.do>. This report lists transfer capacities over intertie links at given points in time.

AESO notes that these ATC limits might be further imapcted by conditions on the British Columbia or Saskatchewan grids. Interested parties should visit B.C. Hydro’s OASIS website <http://www.oatioasis.com/cwo_default.htm> and SaskPower’s OASIS website <http://www.oatioasis.com/spc/index.html>.

Warning

The available transfer capacity report from AESO suffers from some missing data. More information is available at https://bitbucket.org/kc/pyaeso/issue/5.

class aeso.atc.AtcLimit(id, import_power, import_reason, export_power, export_reason)

Represents transfer limit for an intertie.

export_power

decimal.Decimal property.

export_reason

str property.

id

Value from AtcLink enumeration.

import_power

Imported power (decimal.Decimal).

import_reason

str property.

Enumeration of import/export transmission links.

BC

Transfer link to British Columbia.

SK

Transfer link to Saskatchewan.

class aeso.atc.TransferCapacity(t, links)

Available Transfer Capacity Limit.

List of AtcLimit objects. List length is equal to the number of values in the AtcLink enumeration. Presently AtcLink has two values: Saskatchewan and BC (pyaeso 0.6, 2010-11-14).

t

Time (datetime.datetime) at which intertie link limits are valid.

aeso.atc.dump_atc(f, start_date, end_date, timeout=None)

Download available transfer capacity data between start_date and end_date and write it to file-object f. Unlike urlopen_atc, there is no restriction on the amount of data available. An iterator is used to query data in six-month blocks before it is written to f.

Parameters:
  • f – file-like object.
  • start_datedatetime.date
  • end_datedatetime.date
  • timeout – optional parameter specifying timeout in seconds for blocking operations like the connection attempt. If operation times out urllib2.URLError will be raised. ValueError will be raised in Python 2.4 and 2.5 if this parameter is set to anything but None.

New in version 0.6.

New in version 0.7: timeout parameter.

Usage example:

>>> # Standard python libraries
>>> from tempfile import TemporaryFile
>>>
>>> # 3rd Party Libraries
>>> from aeso import atc
>>>
>>> end_date = date.today()
>>> start_date = end_date - timedelta(1)
>>>
>>> f = TemporaryFile()
>>> atc.dump_atc(f, start_date, end_date)
>>> f.close()
aeso.atc.parse_atc_file(f)

Yields TransferCapacity objects as extracted from the open file-object f. File f should contain an available transfer capacity report in CSV format.

Parameters:f – file-like object.

New in version 0.6.

Usage example:

>>> # Standard library imports
>>> import datetime
>>> try:
...     # For Python 3
...     from io import BytesIO
... except ImportError:
...     # For Python 2.x
...     from StringIO import StringIO as BytesIO
>>>
>>> # 3rd Party Libraries
>>> from aeso import atc
>>>
>>> end_date = date.today()
>>> start_date = end_date - timedelta(1)
>>>
>>> f = BytesIO()
... try:
...   atc.dump_atc(f, start_date, end_date)
...   ofs = f.seek(0)
...   data = list(atc.parse_atc_file(f))
... finally:
...   f.close()
>>>
>>> # *data* now contains a list of TransferCapacity objects.
aeso.atc.urlopen_atc(start_date, end_date, timeout=None)

Returns a file containing the available transfer capcity report. Using this query, Alberta ATC data can be obtained for historical dates starting Nov 22, 1999, and for forecasted dates up to six months into the future (AESO, http://itc.aeso.ca/itc/public/atcQuery.do, retrieved 2010-11-14). Due to limitations of the AESO source query end_date - start_date must not exceed six months.

Parameters:
  • start_datedatetime.date
  • end_datedatetime.date
  • timeout – optional parameter specifying timeout in seconds for blocking operations like the connection attempt. If operation times out urllib2.URLError will be raised. ValueError will be raised in Python 2.4 and 2.5 if this parameter is set to anything but None.
Return type:

file-like object as returned by urlopen.

New in version 0.6.

New in version 0.7: timeout parameter.

Usage example:

>>> # Standard python libraries
>>> from datetime import date
>>> from datetime import timedelta
>>>
>>> # 3rd Party Libraries
>>> from aeso import atc
>>>
>>> end_date = date.today()
>>> start_date = end_date - timedelta(1)
>>>
>>> f = atc.urlopen_atc(start_date, end_date)
>>> text = f.read()
>>> f.close()

Note

AESO’s raw ATC report can be accessed at <http://itc.aeso.ca/itc/public/atcQuery.do>.

Previous topic

aeso.asset — Alberta Generation Assets

Next topic

aeso.csd — Current Supply/Demand (CSD) Report Access

This Page