Electrification.collect_etz_codes¶
- Electrification.collect_etz_codes(confirmation_required=True, verbose=False)[source]¶
Collects OLE section codes for national network energy tariff zones from the source web page.
- Parameters:
confirmation_required (bool) – Whether user confirmation is required before proceeding; defaults to
True
.verbose (bool | int) – Whether to print relevant information to the console; defaults to
False
.
- Returns:
A dictionary of OLE section codes for national network energy tariff zones.
- Return type:
dict | None
Examples:
>>> from pyrcs.line_data import Electrification # from pyrcs import Electrification >>> elec = Electrification() >>> rail_etz_codes = elec.collect_etz_codes() To collect section codes for OLE installations: national network energy tariff zones ? [No]|Yes: yes >>> type(rail_etz_codes) dict >>> list(rail_etz_codes.keys()) ['National network energy tariff zones', 'Last updated date'] >>> elec.KEY_TO_ENERGY_TARIFF_ZONES 'National network energy tariff zones' >>> rail_etz_codes_dat = rail_etz_codes[elec.KEY_TO_ENERGY_TARIFF_ZONES] >>> type(rail_etz_codes_dat) dict >>> list(rail_etz_codes_dat.keys()) ['Railtrack', 'Network Rail'] >>> rail_etz_codes_dat['Railtrack']['Codes'] Code Energy tariff zone 0 EA East Anglia 1 EC East Coast Main Line 2 GE Great Eastern † 3 LT LTS † 4 MD Midland Main Line 5 ME Merseyside † 6 MS Merseyside (North West DC traction) 7 NE North East 8 NL North London (DC traction) 9 SC Scotland 10 SO South 11 SW South West 12 WA West Anglia † 13 WC West Coast/North West