Electrification

class pyrcs.line_data.elec.Electrification(data_dir=None, update=False, verbose=True)

A class for collecting section codes for overhead line electrification (OLE) installations.

Parameters
  • data_dir (str or None) – name of data directory, defaults to None

  • update (bool) – whether to do an update check (for the package data), defaults to False

  • verbose (bool or int) – whether to print relevant information in console, defaults to True

Variables
  • catalogue (dict) – catalogue of the data

  • last_updated_date (str) – last update date

  • data_dir (str) – path to the data directory

  • current_data_dir (str) – 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

KEY

Key of the dict-type data

KEY_TO_ENERGY_TARIFF_ZONES

Key of the dict-type data of the 'UK railway electrification tariff zones'

KEY_TO_INDEPENDENT_LINES

Key of the dict-type data of the 'independent lines'

KEY_TO_LAST_UPDATED_DATE

Key of the data of the last updated date

KEY_TO_NATIONAL_NETWORK

Key of the dict-type data of the 'national network'

KEY_TO_OHNS

Key of the dict-type data of the 'overhead line electrification neutral sections (OHNS)'

NAME

Name of the data

URL

URL of the main web page of the data

Methods

collect_etz_codes([confirmation_required, ...])

Collect OLE section codes for national network energy tariff zones from source web page.

collect_indep_lines_codes([...])

Collect OLE section codes for independent lines from source web page.

collect_national_network_codes([...])

Collect OLE section codes for national network from source web page.

collect_ohns_codes([confirmation_required, ...])

Collect codes for overhead line electrification neutral sections (OHNS) from source web page.

fetch_codes([update, dump_dir, verbose])

Fetch OLE section codes listed in the Electrification catalogue.

fetch_etz_codes([update, dump_dir, verbose])

Fetch OLE section codes for national network energy tariff zones.

fetch_indep_lines_codes([update, dump_dir, ...])

Fetch OLE section codes for independent lines.

fetch_national_network_codes([update, ...])

Fetch OLE section codes for national network.

fetch_ohns_codes([update, dump_dir, verbose])

Fetch codes for overhead line electrification neutral sections (OHNS).

get_indep_line_catalogue([update, verbose])

Get a catalogue for independent lines.