XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 1.1.0
    • data sources, tests

    Description

      There are multiple issues here
      1. The

      if time.day != last_day_of_month:

      on line 3 is incorrect. It should be

      if time_step == 'monthly':

      . Fixing this creates another bug. Read 2.

      def _end_of_date(time, time_step):
      last_day_of_month = calendar.monthrange(time.year, time.month)[1]
          if time.day != last_day_of_month:
              end_time_string = time.strftime('%Y%m%d')
              end_time_string = end_time_string[:6] + str(last_day_of_month)
              time = datetime.strptime(end_time_string, '%Y%m%d')
              ##TODO: Change the 3 lines above with this line:
              ##time = datetime(time.year, time.month, lastDayOfMonth)
          elif time_step.lower() == 'daily':
              end_time_string = time.strftime('%Y%m%d%H%M%S')
              end_time_string = end_time_string[:8] + '235959'
              time = datetime.strptime(end_time_string, '%Y%m%d%H%M%S')
              ##TODO: Change the 3 lines above with this line:
              ##time = datetime(time.year, time.month, end_time.day, 23, 59, 5
      

      2. Multiple tests in test_rcmed.py start failing when 1. is fixed. The bug is on this line

      def return_text(self, url):
          if url == self.url + "datasetId={0}&parameterId={1}&latMin={2}&latMax={3}&lonMin={4}&lonMax={5}&timeStart=20020801T0000Z&timeEnd=20021031T0000Z"\
                      .format(self.dataset_id, self.parameter_id, self.min_lat, self.max_lat, self.min_lon, self.max_lon, self.start_time_for_url, self.end_time_for_url):

      This line expects the

      timeEnd=20021031T0000Z

      but the actual value is

      timeEnd=20021001T2359Z

      . The value of timeEnd depends on

      time_step

      variable that is passed on from function to function. In the rcmed_test the value of

      time_step='daily'

      and hence the value of

      timeEnd

      should be

      20021001T2359Z

      Attachments

        Issue Links

          Activity

            People

              jarifibrahim Ibrahim Jarif
              jarifibrahim Ibrahim Jarif
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: