<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_reach_number_data(self):
 """ Update the reach number data for the namelist based on input files. .. warning:: You need to make sure you set *rapid_connect_file* and *riv_bas_id_file* before running this function. Example: .. code:: python from RAPIDpy import RAPID rapid_manager = RAPID( rapid_connect_file='../rapid-io/input/rapid_connect.csv', riv_bas_id_file='../rapid-io/input/riv_bas_id.csv', ) rapid_manager.update_reach_number_data() Example with forcing data: .. code:: python from RAPIDpy import RAPID rapid_manager = RAPID( rapid_connect_file='../rapid-io/input/rapid_connect.csv', riv_bas_id_file='../rapid-io/input/riv_bas_id.csv', Qfor_file='../rapid-io/input/qfor_file.csv', for_tot_id_file='../rapid-io/input/for_tot_id_file.csv', for_use_id_file='../rapid-io/input/for_use_id_file.csv', ZS_dtF=3*60*60, BS_opt_for=True ) rapid_manager.update_reach_number_data() """

        if not self.rapid_connect_file:
            log("Missing rapid_connect_file. "
                "Please set before running this function ...",
                "ERROR")

        if not self.riv_bas_id_file:
            log("Missing riv_bas_id_file. "
                "Please set before running this function ...",
                "ERROR")

        # get rapid connect info
        rapid_connect_table = np.loadtxt(self.rapid_connect_file,
                                         ndmin=2, delimiter=",", dtype=int)

        self.IS_riv_tot = int(rapid_connect_table.shape[0])
        self.IS_max_up = int(rapid_connect_table[:, 2].max())

        # get riv_bas_id info
        riv_bas_id_table = np.loadtxt(self.riv_bas_id_file,
                                      ndmin=1, delimiter=",",
                                      usecols=(0,), dtype=int)
        self.IS_riv_bas = int(riv_bas_id_table.size)

        # add the forcing files
        if not self.for_tot_id_file:
            self.IS_for_tot = 0
            log("Missing for_tot_id_file. Skipping ...",
                "WARNING")
        else:
            # get riv_bas_id info
            for_tot_id_table = np.loadtxt(self.for_tot_id_file,
                                          ndmin=1, delimiter=",",
                                          usecols=(0,), dtype=int)
            self.IS_for_tot = int(for_tot_id_table.size)

        if not self.for_use_id_file:
            self.IS_for_use = 0
            log("Missing for_use_id_file. Skipping ...",
                "WARNING")
        else:
            # get riv_bas_id info
            for_use_id_table = np.loadtxt(self.for_use_id_file,
                                          ndmin=1, delimiter=",",
                                          usecols=(0,), dtype=int)
            self.IS_for_use = int(for_use_id_table.size)