PEATSA/Core/Data.py
def addMatrix(self, matrix, name):
	
		'''Adds a matrix called name to the data dir.
		
		Note: Name is capitalized if its not already
		
		If data for name is already present, and overwriting is disabled,
		an Exceptions.DataAlreadyExistsError is raised.
		Otherwise the data is added to the self.data dictionary.'''
	
		if self.data.has_key(name):
			if not self.overwrite:
				raise Exceptions.DataAlreadyExistsError, 'A matrix called %s already present' % name
		
		name = name.capitalize()[0] + name[1:]
		
		if self.environment.isRoot():
			filename = os.path.join(self.path, name + '.csv')
			file = open(filename, 'w')
			file.write(matrix.csvRepresentation())
			file.close()
			
			#Update the matrixNames list with the new name
			matrixNames = self.data.keys()
			matrixNames.append(name)
			matrixNames.sort(lambda a,b: cmp(a.lower(), b.lower()))
			stream = open(os.path.join(self.path, 'matrixNames'), 'w+')
			pickle.dump(matrixNames, stream)
			stream.close()
		
		self.environment.wait()
		self.data[name] = matrix
Adds a matrix called name to the data dir.
		
		Note: Name is capitalized if its not already
		
		If data for name is already present, and overwriting is disabled,
		an Exceptions.DataAlreadyExistsError is raised.
		Otherwise the data is added to the self.data dictionary.
Adds a matrix called name to the data dir.
Note: Name is capitalized if its not already

If data for name is already present, and overwriting is disabled,
an Exceptions.DataAlreadyExistsError is raised.
Otherwise the data is added to the self.data dictionary.
Adds a matrix called name to the data dir . Note : Name is capitalized if its not already If data for name is already present and overwriting is disabled an Exceptions . DataAlreadyExistsError is raised . Otherwise the data is added to the self . data dictionary .
def addMatrix(self, matrix, name):
		if self.data.has_key(name):
			if not self.overwrite:
				raise Exceptions.DataAlreadyExistsError, 'A matrix called %s already present' % name
		name = name.capitalize()[0] + name[1:]
		if self.environment.isRoot():
			filename = os.path.join(self.path, name + '.csv')
			file = open(filename, 'w')
			file.write(matrix.csvRepresentation())
			file.close()
			matrixNames = self.data.keys()
			matrixNames.append(name)
			matrixNames.sort(lambda a,b: cmp(a.lower(), b.lower()))
			stream = open(os.path.join(self.path, 'matrixNames'), 'w+')
			pickle.dump(matrixNames, stream)
			stream.close()
		self.environment.wait()
		self.data[name] = matrix
def addMatrix ( self , matrix , name ) : if self . data . has_key ( name ) : if not self . overwrite : raise Exceptions . DataAlreadyExistsError , 'A matrix called %s already present' % name name = name . capitalize ( ) [ 0 ] + name [ 1 : ] if self . environment . isRoot ( ) : filename = os . path . join ( self . path , name + '.csv' ) file = open ( filename , 'w' ) file . write ( matrix . csvRepresentation ( ) ) file . close ( ) matrixNames = self . data . keys ( ) matrixNames . append ( name ) matrixNames . sort ( lambda a , b : cmp ( a . lower ( ) , b . lower ( ) ) ) stream = open ( os . path . join ( self . path , 'matrixNames' ) , 'w+' ) pickle . dump ( matrixNames , stream ) stream . close ( ) self . environment . wait ( ) self . data [ name ] = matrix
Adds a matrix called name to the data dir.
Adds a matrix called name to the data dir .
'''Adds a matrix called name to the data dir.
		
		Note: Name is capitalized if its not already
		
		If data for name is already present, and overwriting is disabled,
		an Exceptions.DataAlreadyExistsError is raised.
		Otherwise the data is added to the self.data dictionary.''' #Update the matrixNames list with the new name
self
matrix
name