def _createTimeSeriesObjects(self, timeSeries, filename):
        """
        Create GSSHAPY TimeSeries and TimeSeriesValue Objects Method
        """
        try:
            # Determine number of value columns
            valColumns = len(timeSeries[0]['values'])

            # Create List of GSSHAPY TimeSeries objects
            series = []
            for i in range(0, valColumns):
                ts = TimeSeries()
                ts.timeSeriesFile = self
                series.append(ts)

            for record in timeSeries:
                for index, value in enumerate(record['values']):
                    # Create GSSHAPY TimeSeriesValue objects
                    tsVal = TimeSeriesValue(simTime=record['time'],
                                            value=value)

                    # Associate with appropriate TimeSeries object via the index
                    tsVal.timeSeries = series[index]
        except IndexError:
            log.warning(('%s was opened, but the contents of the file were empty.'
                     'This file will not be read into the database.') % filename)
        except:
            raise
def _createTimeSeriesObjects ( self , timeSeries , filename ) : try : valColumns = len ( timeSeries [ 0 ] [ 'values' ] ) series = [ ] for i in range ( 0 , valColumns ) : ts = TimeSeries ( ) ts . timeSeriesFile = self series . append ( ts ) for record in timeSeries : for index , value in enumerate ( record [ 'values' ] ) : tsVal = TimeSeriesValue ( simTime = record [ 'time' ] , value = value ) tsVal . timeSeries = series [ index ] except IndexError : log . warning ( ( '%s was opened, but the contents of the file were empty.' 'This file will not be read into the database.' ) % filename ) except : raise
Create GSSHAPY TimeSeries and TimeSeriesValue Objects Method