Electrification¶
- class pyrcs.line_data.Electrification(data_dir=None, update=False, verbose=True)[source]¶
A class for collecting section codes for overhead line electrification (OLE) installations.
- Parameters:
data_dir (str | None) – Name of the data directory; defaults to
None
.update (bool) – Whether to check for updates to the data catalogue; defaults to
False
.verbose (bool | int) – Whether to print relevant information to the console; defaults to
True
.
- Variables:
catalogue (dict) – The catalogue of the data.
last_updated_date (str) – The date when the data was last updated.
data_dir (str) – The path to the directory containing the data.
current_data_dir (str) – The path to the current data directory.
Examples:
>>> from pyrcs.line_data import Electrification # from pyrcs import Electrification >>> elec = Electrification() >>> elec.NAME 'Section codes for overhead line electrification (OLE) installations' >>> elec.URL 'http://www.railwaycodes.org.uk/electrification/mast_prefix0.shtm'
Attributes
The key for accessing the data.
The key used to reference the data of the 'UK railway electrification tariff zones'.
The key used to reference the data of the 'independent lines'.
The key used to reference the last updated date in the data.
The key used to reference the data of the 'national network'.
The key used to reference the data of the 'overhead line electrification neutral sections (OHNS)'.
The name of the data.
The URL of the main web page for the data.
Methods
collect_etz_codes
([confirmation_required, ...])Collects OLE section codes for national network energy tariff zones from the source web page.
Collects OLE section codes for independent lines from the source web page.
Collects the section codes for Overhead Line Electrification (OLE) installations for the national network from the source web page.
collect_ohns_codes
([confirmation_required, ...])Collects codes for overhead line electrification neutral sections (OHNS) from the source web page.
fetch_codes
([update, dump_dir, verbose])Fetches OLE section codes listed in the Electrification catalogue.
fetch_etz_codes
([update, dump_dir, verbose])Fetches OLE section codes for national network energy tariff zones.
fetch_independent_lines_codes
([update, ...])Fetches OLE section codes for independent lines.
fetch_national_network_codes
([update, ...])Fetches section codes for Overhead Line Electrification (OLE) installations on the national network.
fetch_ohns_codes
([update, dump_dir, verbose])Fetches the overhead line electrification neutral sections (OHNS) codes.
get_independent_lines_catalogue
([update, ...])Gets the catalogue for the independent lines.