ELRMileages.search_conn

static ELRMileages.search_conn(start_elr, start_em, end_elr, end_em)[source]

Searches for connections between two pairs of ELRs and their associated mileages.

Parameters:
  • start_elr (str) – The starting ELR.

  • start_em (pandas.DataFrame) – The mileage file associated with the starting ELR.

  • end_elr (str) – The ending ELR.

  • end_em (pandas.DataFrame) – The mileage file associated with the ending ELR.

Returns:

A tuple containing the end mileage of the starting ELR and the start mileage of the ending ELR.

Return type:

tuple

Examples:

>>> from pyrcs.line_data import ELRMileages  # from pyrcs import ELRMileages
>>> em = ELRMileages()
>>> elr_1 = 'AAM'
>>> mileage_file_1 = em.collect_mileage_file(elr_1, confirmation_required=False)
>>> mf_1_mileages = mileage_file_1['Mileage']
>>> mf_1_mileages.head()
  Mileage Mileage_Note  ... Link_2_ELR Link_2_Mile_Chain
0  0.0000               ...
1  0.0154               ...
2  0.0396               ...
3  1.1012               ...
4  1.1408               ...
[5 rows x 11 columns]
>>> elr_2 = 'ANZ'
>>> mileage_file_2 = em.collect_mileage_file(elr_2, confirmation_required=False)
>>> mf_2_mileages = mileage_file_2['Mileage']
>>> mf_2_mileages.head()
   Mileage Mileage_Note Miles_Chains  ...      Link_1 Link_1_ELR Link_1_Mile_Chain
0  84.0924                     84.42  ...         BEA        BEA
1  84.1364                     84.62  ...  AAM (0.18)        AAM              0.18
[2 rows x 8 columns]
>>> elr_1_dest, elr_2_orig = em.search_conn(elr_1, mf_1_mileages, elr_2, mf_2_mileages)
>>> elr_1_dest
'0.0396'
>>> elr_2_orig
'84.1364'