Beispiel #1
0
    def is_active(self, date=None):
        """ :return False whenever we see that the stop has zero stop_times on the given
                    input date (which defaults to 'today')
        """
        ret_val = False
        if date is None:
            date = datetime.date.today()

        #import pdb; pdb.set_trace()
        from gtfsdb.model.stop_time import StopTime
        st = StopTime.get_departure_schedule(self.session, self.stop_id, date, limit=1)
        if st and len(st) > 0:
            ret_val = True
        return ret_val
Beispiel #2
0
    def is_active(self, date=None):
        """
        :return False whenever we see that the stop has zero stop_times on the given input date
                (which defaults to 'today')

        @NOTE: use caution with this routine.  calling this for multiple stops can really slow things down,
               since you're querying large trip and stop_time tables, and asking for a schedule of each stop
               I used to call this multiple times via route_stop to make sure each stop was active ... that
               was really bad performance wise.
        """
        from gtfsdb.model.stop_time import StopTime

        # import pdb; pdb.set_trace()
        _is_active = False
        date = util.check_date(date)
        st = StopTime.get_departure_schedule(self.session, self.stop_id, date, limit=1)
        if st and len(st) > 0:
            _is_active = True
        return _is_active
Beispiel #3
0
    def is_active(self, date=None):
        """ :return False whenever we see that the stop has zero stop_times on the given input date
                    (which defaults to 'today')

            @NOTE: use caution with this routine.  calling this for multiple stops can really slow things down,
                   since you're querying large trip and stop_time tables, and asking for a schedule of each stop
                   I used to call this multiple times via route_stop to make sure each stop was active ... that
                   was really bad performance wise.
        """
        _is_active = False
        if date is None:
            date = datetime.date.today()

        #import pdb; pdb.set_trace()
        from gtfsdb.model.stop_time import StopTime
        st = StopTime.get_departure_schedule(self.session, self.stop_id, date, limit=1)
        if st and len(st) > 0:
            _is_active = True
        return _is_active