def numbering(self):

        headertxt = 'Checking for continuity in segment and reach numbering...\n'
        if self.verbose:
            print(headertxt.strip())
        txt = ''
        passed = False
        for per in range(self.sfr.nper):
            if per > 0 > self.sfr.dataset_5[per][0]:
                continue
            # check segment numbering
            txt += _check_numbers(self.sfr.nss,
                                  self.segment_data[per]['nseg'],
                                  level=self.level,
                                  datatype='segment')

        # check reach numbering
        for segment in np.arange(1, self.sfr.nss + 1):
            reaches = self.reach_data.ireach[self.reach_data.iseg == segment]
            t = _check_numbers(len(reaches),
                               reaches,
                               level=self.level,
                               datatype='reach')
            if len(t) > 0:
                txt += 'Segment {} has {}'.format(segment, t)
        if txt == '':
            passed = True
        self._txt_footer(headertxt, txt, 'continuity in segment and reach numbering', passed, warning=False)

        headertxt = 'Checking for increasing segment numbers in downstream direction...\n'
        txt = ''
        passed = False
        if self.verbose:
            print(headertxt.strip())
        for per, segment_data in self.segment_data.items():

            decreases = segment_data.outseg[segment_data.outseg < segment_data.nseg]
            decreases = decreases[decreases > 0]

        if len(decreases) >= 1:
            txt += '{} instances of segment numbers decreasing in the downstream direction.\n'.format(len(decreases))
            txt += 'MODFLOW will run but convergence may be appreciably slowed.\n'
            if self.level == 1:
                txt += 'at segments:'
                t = ''
                for s in decreases:
                    t += ' {}'.format(s)
                txt += '\n'.join(textwrap.wrap(t, width=10))
        if len(t) == 0:
                passed = True
        self._txt_footer(headertxt, txt, 'segment numbering order', passed)
checks for continuity in segment and reach numbering
dataset/ETHPy150Open modflowpy/flopy/flopy/modflow/mfsfr2.py/check.numbering