Electrification.collect_ohns_codes(confirmation_required=True, verbose=False)[source]

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

  • confirmation_required (bool) – whether to confirm before proceeding, defaults to True

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


OHNS codes

Return type:

dict or None


>>> from pyrcs.line_data import Electrification  # from pyrcs import Electrification

>>> elec = Electrification()

>>> ohl_ns_codes = elec.collect_ohns_codes()
To collect section codes for OLE installations: national network neutral sections
? [No]|Yes: yes
>>> type(ohl_ns_codes)
>>> list(ohl_ns_codes.keys())
['National network neutral sections', 'Last updated date']

>>> elec.KEY_TO_OHNS
'National network neutral sections'

>>> ohl_ns_codes_dat = ohl_ns_codes[elec.KEY_TO_OHNS]
>>> type(ohl_ns_codes_dat)
>>> list(ohl_ns_codes_dat.keys())
['Codes', 'Notes']
>>> ohl_ns_codes_dat['Codes']
    ELR         OHNS Name  Mileage    Tracks Dates
0  ARG1        Rutherglen  0m 03ch
1  ARG2   Finnieston East  4m 23ch      Down
2  ARG2   Finnieston West  4m 57ch        Up
3  AYR1  Shields Junction  0m 68ch    Up Ayr
4  AYR1  Shields Junction  0m 69ch  Down Ayr