Changeset 7071 for cows_wps


Ignore:
Timestamp:
24/06/10 10:36:17 (9 years ago)
Author:
astephen
Message:

fixes to validators.

Location:
cows_wps/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/controllers/submitter.py

    r7069 r7071  
    4343 
    4444        # Now we are only dealing with async requests 
    45         return wps_request_url 
     45####        return wps_request_url 
    4646        cost_only_request_url = wps_request_url + "&Costonly=true" 
    4747 
  • cows_wps/trunk/process_modules/extract_uk_station_data.py

    r7070 r7071  
    4444 
    4545 
     46 
    4647    def _executeProc(self, context, dry_run): 
    4748        """ 
     
    6566        nStations = len(stationList) 
    6667 
    67         if nStations > 100 and a["OutputTimeChunk"] == "decadal": 
    68             raise Exception("The number of selected station IDs has been calculated to be greater than 100. Please select a chunk size other than 'decadal' for such as large volume of data.") 
     68        STATION_LIMIT = 10000 
     69        if nStations > STATION_LIMIT  and a["OutputTimeChunk"] == "decadal": 
     70            raise Exception("The number of selected station IDs has been calculated to be greater than %d. Please select a chunk size other than 'decadal' for such as large volume of data." % STATION_LIMIT) 
    6971 
    7072        nYears = int(a["EndDateTime"][:4]) - int(a["StartDateTime"][:4]) 
    7173 
    72         if nYears > 1 and nStations > 100: 
    73             raise Exception("The number of selected station IDs has been calculated to be greater than 100. Please select a time window no longer than 1 year.") 
     74        if nYears > 1 and nStations > STATION_LIMIT: 
     75            raise Exception("The number of selected station IDs has been calculated to be greater than %d. Please select a time window no longer than 1 year." % STATION_LIMIT) 
    7476 
    7577        # Define data file base 
     
    102104 
    103105        else: 
    104             outputPaths = ["%s-%s.%s" % (dataFileBase, i, ext) for i in range(3)]  
     106            outputPaths = ["%s-%s.%s" % (dataFileBase, i, ext) for i in range(nYears + 1)]  
    105107            for outputPath in outputPaths: 
    106                 self._addFileToOutputs(outputPath, "Station data file.", size = 100000) 
     108                size = nStations * 200 * 365 
     109                self._addFileToOutputs(outputPath, "Station data file.", size = size) 
    107110 
    108             estimated_duration = 300 # seconds 
     111            estimated_duration = (nYears + 1) * 60 # seconds 
    109112            process_support.finishDryRun(context, [], self.fileSet, 
    110113                            estimated_duration, acceptedMessage = 'Dry run complete') 
     
    156159            if len(a["Counties"]) > 0: 
    157160                nEstimatedStations = len(a["Counties"]) * 15 
    158             else: 
     161            elif a["BBox"]: 
    159162                (w, s, e, n) = a["BBox"] 
    160163                lonExtent = abs(e - w) 
    161164                latExtent = n - s 
    162165                nEstimatedStations = int(lonExtent * latExtent * 50) 
     166            else: 
     167                nEstimatedStations = len(stationList) 
    163168 
    164169            estimatedVolume = nEstimatedStations * 5 
     
    166171 
    167172            # Make up a station list 
    168             stationList = [-1] * 100 
     173            stationList = [-1] * nEstimatedStations 
    169174 
    170175        return stationList 
Note: See TracChangeset for help on using the changeset viewer.