Electrification.collect_ohns_codes¶
- Electrification.collect_ohns_codes(confirmation_required=True, verbose=False, raise_error=False)[source]¶
Collect codes for overhead line electrification neutral sections (OHNS) from the source web page.
- Parameters:
confirmation_required (bool) – Whether user confirmation is required; if
confirmation_required=True(default), prompts the user for confirmation before proceeding with data collection.verbose (bool | int) – Whether to print relevant information to the console; defaults to
False.raise_error (bool) – Whether to raise the provided exception; if
raise_error=False(default), the error will be suppressed.
- Returns:
A dictionary of OHNS codes, or
Noneif not applicable.- Return type:
dict | None
Examples:
>>> from pyrcs.line_data import Electrification # from pyrcs import Electrification >>> elec = Electrification() >>> ohl_ns_codes = elec.collect_ohns_codes(verbose=True) Proceed with collecting section codes for OLE installations: "National network neut... [No]|Yes: yes Collecting the data ... Done. >>> type(ohl_ns_codes) dict >>> 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) dict >>> list(ohl_ns_codes_dat.keys()) ['Codes', 'Notes'] >>> ohl_ns_codes_dat['Codes'].shape (385, 5) >>> ohl_ns_codes_dat['Codes'].head() ELR ... Dates 0 ARG1 ... 1 ARG2 ... 2 ARG2 ... 3 AWL ... installed from new, first OLE use 3 November 2025 4 AYR1 ... [5 rows x 5 columns]