Access to current supply demand (CSD) data. The raw report can be accessed at <http://ets.aeso.ca/ets_web/ip/Market/Reports/CSDReportServlet>.
Superclass of SystemStat and UnitStat
Class representing a system statistic.
New in version 0.6.
>>> from aeso import csd
>>> from datetime import datetime
>>> dt = datetime(2010, 4, 22)
>>> stat = csd.SystemStat(dt, 'Sample System Statistic', 10)
>>> stat.dt
datetime.datetime(2010, 4, 22, 0, 0)
>>> stat.name
'Sample System Statistic'
>>> stat.value
10
>>> dt, name, value = stat
>>> assert stat.dt == dt
>>> assert stat.name == name
>>> assert stat.value == value
Entry datetime.datetime.
Unit name, str.
Value, polymorphic.
Class representing an entry in the Alberta Integrated Electric System Log. This object will iterate over its members returning self.dt, and self.description in succession.
New in version 0.6.
>>> from aeso import csd
>>> from datetime import datetime
>>> dt = datetime(2010, 4, 22)
>>> stat = csd.UnitStat(dt, 'Sample Unit Statistic', 10, 5, 0)
>>> stat.dt
datetime.datetime(2010, 4, 22, 0, 0)
>>> stat.name
'Sample Unit Statistic'
>>> stat.mcr
10
>>> stat.tng
5
>>> stat.dcr
0
>>> dt, name, mcr, tng, dcr = stat
>>> assert stat.dt == dt
>>> assert stat.name == name
>>> assert stat.mcr == mcr
>>> assert stat.tng == tng
>>> assert stat.dcr == dcr
Dispatched contingency reserve.
Return type: | Decimal or None |
---|
Entry datetime.datetime.
Maximum continuous rating.
Return type: | Decimal |
---|
Unit name.
Total net generation.
Return type: | Decimal or None |
---|
Yields subclasses of CsdStat objects containing information from file-like object f (as returned by urlopen()). Subclasses of CsdStat presently yielded include:
AESO presently publishes system statistics with the names (2010-03-10):
These system statistics will be represented by yielded SystemStat objects.
Unit data yielded in UnitStat objects may actually be pseudo-units; For example, AESO provides data on a “Coal” unit that represents the generation output of all coal plants in the province.
Changed in version 0.6: Now yields subclasses of CsdData instead of 3-tuples and 5-tuples. The change should be transparent because CsdData subclasses have tuple behaviours like __len__, __iter__, and __getitem__.
New in version 0.5.
Example Usage:
>>> from aeso import csd
>>> from aeso import AB_TZ
>>> systemstats = []
>>> unitstats = []
>>> f = csd.urlopen()
>>> for datapoint in csd.parse_csd_file(f):
... if isinstance(datapoint, csd.SystemStat):
... systemstats.append(datapoint)
... elif isinstance(datapoint, csd.UnitStat):
... ab_dt = AB_TZ.normalize(datapoint.dt.astimezone(AB_TZ))
... unitstats.append(datapoint)
... else:
... raise TypeError('Unexpected type')
...
>>> f.close()
Returns an open file-object connected to AESO’s Current Supply Demand (CSD) webservice.
Parameters: | 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. |
New in version 0.5.
New in version 0.7: timeout parameter.