def mapPoint(self):

		#debug
		self.debug(
				[
					'We map point here',
					'PointMapVariable is ',
					SYS._str(self.PointMapVariable)
				]
			)

		#map
		map(
				lambda __ElementVariable:
				self.point(
					*__ElementVariable
				)
				if type(__ElementVariable) in [list,tuple]
				else self.point(
					__ElementVariable
				),
				self.PointMapVariable if type(
					self.PointMapVariable
				)==list else self.PointMapVariable.items()
			)
Exemplo n.º 2
0
def getDebuggedStrWithPrintVariable(_PrintVariable):

	#Type
	Type=type(_PrintVariable)

	#Debug
	'''
	print('l 62 Debugger')
	print('Type is ',Type)
	print('SYS.StrTypesList is ',SYS.StrTypesList)
	print('')
	'''
	
	#set the DebuggedStr with the _PrintVariable
	if type(_PrintVariable) in SYS.StrTypesList:
		return _PrintVariable
	elif type(_PrintVariable)==tuple:

		#Check for an end
		if len(_PrintVariable)>3:
			DebuggedEndStr=_PrintVariable[3]
		else:
			DebuggedEndStr=""

		#join
		DebuggedStr='\n'.join(
		map(
				lambda __KeyStr:
				_PrintVariable[0]+__KeyStr+DebuggedEndStr+' is '+SYS._str(
					_PrintVariable[1][__KeyStr] if type(
						_PrintVariable[1]
					) in [collections.OrderedDict,dict]
					else getattr(
							_PrintVariable[1],
							__KeyStr
						) 
					if hasattr(_PrintVariable[1],__KeyStr) 
					else "WARNING : No attribute like this"
				,**{
						'RepresentingAlineaIsBool':False
					}),
				_PrintVariable[2]
			)
		)+'\n'

		#return
		return DebuggedStr

	elif type(_PrintVariable)==list:
		return '\n'.join(map(getDebuggedStrWithPrintVariable,_PrintVariable))

	else:

		#return
		return str(_PrintVariable)
	def do_view(self):

		#debug
		'''
		self.debug(
				[
					'We view here',
					('self.',self,[
						'ViewingQtBool'
					])
				]
			)
		'''

		#Check
		if self.ViewingIdStr=="":
			self.ViewingIdStr=str(self.PrintIdInt)

		#debug
		self.debug(
			[
				"id(self) is ",
				str(id(self)),
				('self.',self,['ViewingIdStr']),
				'SYS.IdDict["+self.ViewingIdStr+"]',
				SYS._str(SYS.IdDict[int(self.ViewingIdStr)]),
				#SYS._str(SYS.IdDict[id(self)]),
				('self.',self,[
					'ViewingXVariable',
					'ViewingYVariable'
				])
			]
		)

		#set
		self.ViewedTagStr=self.StructureTagStr.replace('*','')

		#/####################/#
		# Now we view each Axe
		#

		#map
		map(
			lambda __AxeStr:
			self.viewAxe(__AxeStr),
			[
				'X',
				'Y'
			]
		)


		"""
Exemplo n.º 4
0
	def do_text(self):

		#Init
		self.TextedConsoleStr=""

		#Check
		if hasattr(self,'hdfview'):
			
			#Add
			self.TextedConsoleStr+="Associated Hdf file :\n"
			self.TextedConsoleStr+=self.ViewedPointDeriveControllerVariable.hdfview(
							).HdformatedConsoleStr

		#Check
		if self.ViewedPointDeriveControllerVariable.PymongoneDatabaseVariable!=None:
			
			#Check
			if self.TextingConditionVariable==None:
				self.TextingConditionVariable={}

			#map
			self.TextedCollectionStrsList=map(
					lambda __CollectionTuple:
					__CollectionTuple[0]+' : \n'+SYS._str(
						list(
							__CollectionTuple[1].find(
									self.TextingConditionVariable[__CollectionTuple[0]]
									if __CollectionTuple[0] in self.TextingConditionVariable
									else {},
									self.TextingQueryVariable[__CollectionTuple[0]]
									if __CollectionTuple[0] in self.TextingQueryVariable
									else {}
								)
						)
					),
					self.ViewedPointDeriveControllerVariable.PymongoneDatabaseVariable.__dict__.items()
				)

			self.TextedConsoleStr+="Associated Mongo db :\n"
			self.TextedConsoleStr='\n'.join(self.TextedCollectionStrsList)
	#DatabasingSealTuplesList
	[
		#GetStr #ColumnStr #Col
		('MyInt','MyInt',tables.Int64Col()),
		('MyStr','MyStr',tables.StringCol(10)),
		('MyIntsList','MyIntsList',tables.Int64Col(shape=3))
	]
)
							
	
#Definition the AttestedStr
SYS._attest(
	[
		'MyController is '+SYS._str(
		MyController,
		**{
			'RepresentingBaseKeyStrsListBool':False,
			'RepresentingAlineaIsBool':False
		}
		),
		'MyController["<Databasers>ThingsDatabaser"].DatabasedModelClass.__dict__ is '+SYS._str(
		dict(MyController['<Databasers>ThingsDatabaser'].DatabasedModelClass.__dict__.items()
			) if MyController['<Databasers>ThingsDatabaser'
		].DatabasedModelClass!=None else {},**{'RepresentingAlineaIsBool':False}
		)
	]
) 

#Print

	def mimic_set(self):

		#Check
		if self.SettingKeyVariable in [
											FigurePlotKeyStr,
											FigureScatterKeyStr,
											FigureBarKeyStr
										]:

			#debug
			'''
			self.debug(
					[
						'before plot',
						('self.',self,[
							#'ViewDeriveControllerVariable',
							'SettingValueVariable'
						])
					]
				)
			'''

			#init
			FigurePlotArgumentDict=Setter.ArgumentDict(
					self.SettingValueVariable,
					self.ViewDeriveControllerVariable
				)

			#debug
			'''
			self.debug(
					[
						'We plot here',
						'FigurePlotArgumentDict is',
						SYS._str(FigurePlotArgumentDict)
					]
				)
			'''

			#plot
			self.FigureCartoonVariablesList.append(
				self.FiguredAxesVariable.plot(
					*FigurePlotArgumentDict['LiargVariablesList'],
					**FigurePlotArgumentDict['KwargVariablesDict']
				)[0]
			)

			#debug
			'''
			self.debug(
				[
					('self.',self,['FigureCartoonVariablesList']),
					#str(self.FigureCartoonVariablesList[0][0]),
				]
			)
			'''

			#return 
			return {'HookingIsBool':False}

		elif self.SettingKeyVariable==FigureAxesKeyStr:

			#debug
			'''
			self.debug(
					[
						'before axes',
						('self.',self,[
							#'ViewDeriveControllerVariable',
							'FiguredAxesVariable'
						])
					]
				)
			'''

			#map
			ArgumentTuplesList=map(
					lambda __ItemTuple:
					(
						__ItemTuple[0],
						Setter.ArgumentDict(
								__ItemTuple[1],
								self.ViewDeriveControllerVariable
							)
					),
					SYS.SetList(
						self.SettingValueVariable
					)
				)

			
			#/#################/#
			# Special case for the legend
			#

			#dict
			ArgumentDict=dict(ArgumentTuplesList)
			if 'legend' in ArgumentDict:

				"""
				#Check
				if '#kwarg' not in ArgumentDict['legend']:
					ArgumentDict['legend']['#kwarg']={}

				#add
				ArgumentDict['legend']['#kwarg']['handles']=SYS.flat(
						map(
							lambda __Figurer:
							__Figurer.FigureCartoonVariablesList,
							self.TeamDict['Plots'].ManagementDict.values()
						)
					)
				"""

				#legend
				self.FiguredAxesVariable.legend()

				#link
				#ArgumentTuplesList[SYS.unzip(ArgumentTuplesList,[0]).index('legend')]=(
				#	'legend',
				#	ArgumentDict['legend']
				#)

				#remove
				del ArgumentTuplesList[SYS.unzip(ArgumentTuplesList,[0]).index('legend')]

			#debug
			self.debug(
					[
						'We axe here',
						'ArgumentTuplesList is ',
						SYS._str(ArgumentTuplesList)
					]
				)
			
			#map
			map(
					lambda __ArgumentTuple:
					getattr(
						self.FiguredAxesVariable,
						__ArgumentTuple[0]
					)()
					if len(__ArgumentTuple[1]['LiargVariablesList']
						)==0 and __ArgumentTuple[1]['KwargVariablesDict']==None
					else(
						getattr(
							self.FiguredAxesVariable,
							__ArgumentTuple[0],
							**__ArgumentTuple[1]['KwargVariablesDict']
						)()
						if len(__ArgumentTuple[1]['LiargVariablesList']
						)==0
						else(
							getattr(
								self.FiguredAxesVariable,
								__ArgumentTuple[0]
							)(
								*__ArgumentTuple[1]['LiargVariablesList'],
								**__ArgumentTuple[1]['KwargVariablesDict']
							) 
							if __ArgumentTuple[1]['KwargVariablesDict']!=None
							else
							getattr(
								self.FiguredAxesVariable,
								__ArgumentTuple[0]
							)(
								*__ArgumentTuple[1]['LiargVariablesList']
							)
						)
					),
					ArgumentTuplesList
				)

			#return 
			return {'HookingIsBool':False}

		elif type(self.SettingKeyVariable)==str and self.SettingKeyVariable.startswith(
			FigureMpld3KeyStr):

			#deprefix
			ToolTipKeyStr=SYS.deprefix(
					self.SettingKeyVariable,
					FigureMpld3KeyStr
				)

			#debug
			'''
			self.debug(
					[
						'before plugins',
						('self.',self,['ViewDeriveControllerVariable'])
					]
				)
			'''

			#init
			FigurePluginArgumentDict=Setter.ArgumentDict(
					self.SettingValueVariable,
					self.ViewDeriveControllerVariable
				)

			#debug
			'''
			self.debug(
					[
						'We plugin here',
						'FigurePluginArgumentDict is ',
						SYS._str(FigurePluginArgumentDict)
					]
				)
			'''

			#plugin
			from mpld3 import plugins
			self.FigureTooltipVariablesList=map(
				lambda __FigureCartoonVariable:
				getattr(
					plugins,
					ToolTipKeyStr
				)(
					*[
						__FigureCartoonVariable
					]+FigurePluginArgumentDict['LiargVariablesList'],
					**FigurePluginArgumentDict['KwargVariablesDict']
				),
				self.FigureCartoonVariablesList
			)

			#debug
			'''
			self.debug(
					[
						('self.',self,['FigureTooltipVariablesList'])
					]
				)
			'''
			
			#connect
			map(
				lambda __FigureTooltipVariable:
				plugins.connect(
					self.FigurePyplotVariable,
					__FigureTooltipVariable
				),
				self.FigureTooltipVariablesList
			)

			#return 
			return {'HookingIsBool':False}

		#call the base method
		BaseClass.set(self)
#ImportModules
import ShareYourSystem as SYS

#Definition of a Packager instance and module
MyPackager=SYS.PackagerClass(
	).package(
		'ShareYourSystem.Standards.Interfacers.Printer'	
	)

#Definition the AttestedStr
print('MyPackager'+SYS._str(MyPackager))


		#IntegratingStepsInt
		20,
		#IntegratingInitFloatsArray
		np.array([0.,0.1]),
		#IntegratingMoniterVariableIndexIntsArray
		np.array([0,1]),
		#IntegratingTimeDelayVariable
		10,
		**{'EuleringJacMethodStr':"euler_leak"}
	)

#Definition the AttestedStr
SYS._attest(
	[
		'MyIntegrater is '+SYS._str(
		MyIntegrater,
		**{
			'RepresentingBaseKeyStrsListBool':False,
			'RepresentingAlineaIsBool':False
		}
		),
	]
) 

#plot
from matplotlib import pyplot
pyplot.plot(MyIntegrater['<StateMoniters>VariableMoniter'].MoniteredTotalVariablesArray.T)
pyplot.show()

#Print
				('MyIntsList','MyIntsList',SYS.tables.Int64Col(shape=3))
			]	
		}
	).model(
	)

#Build a structure with a database
SYS.mapSet(
		MyModeler.ModeledHdfTable,
		[
			('row.__setitem__',{'#liarg':('MyStr',"hello")}),
			('row.append',{'#liarg':None}),
			('row.__setitem__',{'#liarg':('MyStr',"bonjour")}),
			('row.__setitem__',{'#liarg':('MyIntsList',[4,5,6])}),
			('row.append',{'#liarg':None}),
			('flush',{'#liarg':None})
		]
)

#Definition the AttestedStr
print('MyModeler is ')
SYS._print(MyModeler)

#view
print('hdf5 file is : \n'+SYS._str(MyModeler.hdfview()))

#close
MyModeler.file(_ModeStr='c')


import ShareYourSystem as SYS
from ShareYourSystem.Guiders import Documenter

#Definition a Documenter instance
MyDocumenter=Documenter.DocumenterClass().document(
	True,
	**{
		'PackagingModuleVariable':'ShareYourSystem.Objects'
	}
)
		
#Definition the AttestedStr
SYS._attest(
	[
		'MyDocumenter is '+SYS._str(
		MyDocumenter,
		**{
			'RepresentingBaseKeyStrsListBool':False
			}
		)
	]
)  

#Print






		}
	).model(
	).mapSet(
		{
			'MyInt':0,
			'MyStr':"hello",
			'MyIntsList':[2,4,1]
		}
	).insert(
	).mapSet(
		{
			'MyInt':5,
			'MyStr':"bonjour",
			'MyIntsList':[0,0,0]
		}
	).insert(
	).retrieve(
		#RetrievingIndexIntsList
		[0,0]	
	)
		
#Definition the AttestedStr
print('MyRetriever is ')
SYS._print(MyRetriever) 

#print
print('mongo db is : \n'+SYS._str(MyRetriever.pymongoview()))

#Print
MyRetriever.file(_ModeStr='c')
	def do_point(self):

		#debug
		'''
		self.debug(
			[
				'we point here',
				('self.',self,[
								'PointingToGetVariable',
								'PointingToSetKeyVariable'
							])
			]
		)
		'''

		#Check
		if self.PointingToGetVariable!=None:

			#/###################/#
			# First point TO like a classic set
			#

			#debug
			self.debug(
				[
					'First we get the target',
					('self.',self,['PointingToGetVariable'])
				]
			)

			#get
			PointedToVariable=self[
				self.PointingToGetVariable
			]

			#debug
			'''
			self.debug(
				[
					'PointedToVariable is '+SYS._str(
						PointedToVariable
					),
					'If it is None, maybe we have to parent first'
				]
			)
			'''

			#Check
			"""
			if PointedToVariable==None:

				#parent
				self['?^']

				#debug
				self.debug(
						[
							'We have parented',
							('self.',self,['ParentedTotalPathStr']),
							'So we can get again'
						]
					)

				#get
				PointedToVariable=self[
					self.PointingToGetVariable
				]
			"""

			#debug
			'''
			self.debug(
				[
					'PointedToVariable is '+SYS._str(
						PointedToVariable
					),
					'Now we check the set key str'
				]
			)
			'''

			#/####################/#
			# Check for the SetKeyVariable
			#

			#Check
			if self.PointingToSetKeyVariable in [None,""]:

				#debug
				'''
				self.debug(
						[
							"self.PointingToSetKeyVariable in [None,""]...",
							"so we use the PointingGetVariable to name the pointer"
						]
					)
				'''

				#str
				PointedToSetKeyVariable=str(
						self.PointingToGetVariable
					).replace('/','_')

				#debug
				self.debug(
						[
							'PointedToSetKeyVariable is '+PointedToSetKeyVariable
						]
					)

				#Check
				if self.PointingManagementBool:

					#debug
					self.debug(
							[
								'We put that in the Management dict'
							]
						)

					#add
					PointedToSetKeyVariable=Manager.ManagementChildPrefixStr+PointedToSetKeyVariable

			else:

				#set direct
				PointedToSetKeyVariable=self.PointingToSetKeyVariable

			#debug
			'''
			self.debug(
					'PointedToSetKeyVariable is '+SYS._str(
						PointedToSetKeyVariable
					)
				)
			'''

			#Check
			if type(PointedToSetKeyVariable)==str and PointedToSetKeyVariable.endswith(
				Pather.PathPrefixStr)==False:

				#debug
				'''
				self.debug('It is a direct path')
				'''
				
				if self.PointingEncapsulationBool==False:

					#set
					self.set(
							PointedToSetKeyVariable,
							PointedToVariable
						)
				else:

					pass



			else:

				#debug
				'''
				self.debug(
					[
						'It is an encapsulate path',
						'PointedToSetKeyVariable is ',
						str(PointedToSetKeyVariable),
						'Check if it is with a str or a variable'
					]
				)
				'''

				#/###############/#
				# Case where it is just a default encapsulator
				#

				#Check
				if type(PointedToSetKeyVariable)==str:

					#previous
					PointedPreviousSetTagStr,PointedKeyStr=SYS.previous(
						PointedToSetKeyVariable
					)

					#debug
					self.debug(
						[
							'PointedPreviousSetTagStr is ',
							PointedPreviousSetTagStr,
							'PointedKeyStr is ',
							PointedKeyStr
						]
					)

					#Check
					if self.PointingManagementBool:

						#debug
						self.debug(
								[
									'We put that in the Management dict'
								]
							)

						#add
						PointedPreviousSetTagStr=Manager.ManagementChildPrefixStr+PointedPreviousSetTagStr

					#get
					PointedGettedValueVariable=self[
						PointedPreviousSetTagStr
					]

					#Check
					if PointedKeyStr!="":

						#debug
						self.debug(
								'We just set normally'
							)

						#point
						PointedGettedValueVariable.set(
								PointedKeyStr,
								PointedToVariable
							)

					else:

						#debug
						self.debug(
								'We set the PointToVariable and PointFromVariable'
							)

						#point
						PointedGettedValueVariable.set(
								'PointToVariable',
								PointedToVariable
							)

						#point
						PointedGettedValueVariable.set(
								'PointFromVariable',
								self
							)



			#debug
			'''
			self.debug(
						[
							'After getting',
							('locals()["',locals(),[
											'PointedToVariable',
											],']
										)
						]
					)
			'''

			#/###################/#
			# Maybe do a back point
			#

			#Check
			if self.PointingBackBool:

				#debug
				'''
				self.debug(
						[
							'We point back',
							('self.',self,['PointingBackSetKeyVariable'])
						]
					)
				'''

				#Check
				if self.PointingBackSetKeyVariable==None:
					
					#debug
					'''
					self.debug(
						'PointedToSetKeyVariable is '+str(PointedToSetKeyVariable)
					)
					'''

					#/###################/#
					# Case where the PointedToSetKeyVariable is derived from a pathsetstr
					#

					#split
					PointedKeyStrsList=PointedToSetKeyVariable.split('_')
					if len(PointedKeyStrsList)>1:

						#remove the last
						PointedKeyStrsList=PointedKeyStrsList[1:]

						#reverse
						PointedKeyStrsList.reverse()

						#join
						PointedBackSetKeyVariable='_'.join(PointedKeyStrsList)

					#/###################/#
					# else just take the id and put a prefix
					#

					else:

						#set default
						PointedBackSetKeyVariable=str(self.PrintIdInt)

					#add
					PointedBackSetKeyVariable=PointBackPrefixStr+PointedBackSetKeyVariable+self.NameStr

				else:

					#just alias
					PointedBackSetKeyVariable=self.PointingBackSetKeyVariable

				#debug
				self.debug(
						[
							'we set the back',
							'PointedBackSetKeyVariable is '+SYS._str(
								PointedBackSetKeyVariable
							),
							'PointedToVariable is '+SYS._str(
								PointedToVariable
							)
						]
					)

				#set
				PointedToVariable.point(
						self,
						PointedBackSetKeyVariable,
						_BackBool=False
					)

			#alias
			self.PointedToVariable=PointedToVariable
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Modelers import Explorer
import tables

#Definition a structure with a db
ThingsExplorer=Explorer.ExplorerClass()

#Definition the AttestedStr
SYS._attest(
	[
		'ThingsExplorer is '+SYS._str(
		ThingsExplorer,
		**{
			'RepresentingBaseKeyStrsListBool':False,
			'RepresentingAlineaIsBool':False
		}
		),
		'hdf5 file is : '+ThingsExplorer.hdfview().hdfclose().HdformatedConsoleStr
	]
) 

#Print


#Definition a Nbconverter
MyNbconverter=Nbconverter.NbconverterClass().package(
		'ShareYourSystem.Standards.Objects.Concluder'
	).scriptbook(
		**{
			'GuidingBookStr':'Doc'
		}
	).notebook(
		'Presentation.ipynb'
	).nbconvert(
		'Readme.md',
		'Slide'
)
		
#Definition the AttestedStr
SYS._attest(
	[
		'MyNbconverter is '+SYS._str(
		MyNbconverter,
		**{
			'RepresentingBaseKeyStrsListBool':False,
			'RepresentingAlineaIsBool':False
			}
		)
	]
)  

#Print


MyDistinguisher.distinguish(
	"Distinguishers",[
	[('MyStr',"hello")],
	[('MyInt',0)]
])

#distinguish through setting
MyDistinguisher.__setitem__(
	"Dis_<Distinguishers>",
	[
		[('MyOtherStr',"bonjour")],
		[('MyOtherInt',1)]
	]
)

#Definition the AttestedStr
SYS._attest(
	[
		'MyDistinguisher is '+SYS._str(
		MyDistinguisher,
		**{
			'RepresentingBaseKeyStrsListBool':False,
			'RepresentingAlineaIsBool':False
		}
		)
	]
)  

#Print

					'MyIntsList'
			]	
		}
	).model(
	).mapSet(
		{
			'MyStr':"hello",
			'MyIntsList':[2,4,1]
		}
	).insert(
	).mapSet(
		{
			'MyStr':"bonjour",
			'MyIntsList':[0,0,1]
		}
	).insert(
	)

#print
print('MyInserter is ')
SYS._print(MyInserter)

#view
print('hdf5 file is : \n'+SYS._str(MyInserter.hdfview()))

#close
MyInserter.file(_ModeStr='c')



#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Itemizers import Sharer

#Explicit expression
MySharer=Sharer.SharerClass().__setitem__(
	'__class__.MyStr',
	'I am setted at the level of the class'
)

#Return
SYS._attest(
	[

		'MySharer is '+SYS._str(
				MySharer,
				**{
				'RepresentingBaseKeyStrsListBool':False
				}
			),
		'MySharer.__class__.MyStr is '+MySharer.__class__.MyStr,
		'MySharer["__class__.MyStr"] is '+MySharer['__class__.MyStr'],
	]
)

#Print

#ImportModules
import ShareYourSystem as SYS

#Definition of a Packager instance and module
MyPackager=SYS.PackagerClass().package(
	'ShareYourSystem.Standards.Interfacers.Printer'
)

#Definition the AttestedStr
SYS._attest(
	[
		'MyPackager'+SYS._str(MyPackager)
	]
) 

#Print

#make once
MyMaker.make(3.)

#Print
print('After the first make, MyMaker is ')
SYS._print(MyMaker)

#Reset
print('Now we reset')
MyMaker.WatchMakeWithMakerBool=False

#Print
print('After the reset, MyMaker is ')
SYS._print(MyMaker)

#Definition the AttestedStr
SYS._attest(
	[
		'MakerClass.WatchMakeBoolWithMaker is '+str(MakerClass.WatchMakeWithMakerBool),
		'MakerClass.setResetBoolWithMaker_ is '+str(MakerClass.setResetBoolWithMaker_),
		'MakerClass.make is '+str(MakerClass.make),
		'MyMaker is '+SYS._str(
			MyMaker,**{'RepresentingAlineaIsBool':False}
		),
	]
) 

#Print

import ShareYourSystem as SYS
from ShareYourSystem.Noders import Settler

# Short expression and set in the appended manner
MySettler = (
    Settler.SettlerClass()
    .__setitem__("<Settlome>ChildSettler", Settler.SettlerClass())
    .update(
        [
            ("<Settlome>GrandFirstChildSettler", Settler.SettlerClass()),
            (
                "<Settlome>GrandSecondChildSettler",
                Settler.SettlerClass(**{"SettlingParentBool": True, "SettlingLinkBool": True}).__setitem__(
                    "LinkingPointListsList",
                    [("/NodePointDeriveNoder/<Settlome>GrandFirstChildSettler", "GrandFirstChildSettler")],
                ),
            ),
        ]
    )
)


# Definition the AttestedStr
SYS._attest(
    [
        "MySettler is "
        + SYS._str(MySettler, **{"RepresentingBaseKeyStrsListBool": False, "RepresentingAlineaIsBool": False})
    ]
)
# Print
# make again
print("Now we reset")
MyBuilder.WatchMakeWithMakerBool = False

# Print
print("After the reset MyBuilder is ")
SYS._print(MyBuilder, **{"RepresentingKeyStrsList": ["MakingMyFloat", "MadeMyInt"]})

# make again
MyBuilder.make(7.0)

# Print
print("After the third make, MyBuilder is ")
SYS._print(MyBuilder, **{"RepresentingKeyStrsList": ["MakingMyFloat", "MadeMyInt"]})

# Definition the AttestedStr
SYS._attest(
    [
        "BuilderClass.WatchMakeWithMakerBool is " + str(BuilderClass.WatchMakeWithMakerBool),
        "BuilderClass.setResetBoolWithMaker_ is " + str(BuilderClass.setResetBoolWithMaker_),
        "BuilderClass.make is " + str(BuilderClass.make),
        "MyBuilder is "
        + SYS._str(
            MyBuilder, **{"RepresentingAlineaIsBool": False, "RepresentingKeyStrsList": ["MakingMyFloat", "MadeMyInt"]}
        ),
    ]
)

# Print
Exemplo n.º 22
0
	def pyplotChart(self):

		#debug
		'''
		self.debug(
				[
					'Chart level.'
				]
			)
		'''

		#/#################/#
		# Determine the parent
		#

		#set
		self.PyplotedParentPanelDerivePyploterVariable=self.ParentDeriveTeamerVariable.ParentDeriveTeamerVariable

		#debug
		'''
		self.debug(
				[
					'self.PyplotedParentPanelDerivePyploterVariable.PyplotedParentSingularStr is ',
					self.PyplotedParentPanelDerivePyploterVariable.PyplotedParentSingularStr,
					'Check now who are the parents'
				]
			)
		'''

		#Check
		if self.PyplotedParentPanelDerivePyploterVariable.ParentDeriveTeamerVariable!=None:
				
			#debug
			self.debug(
				[
					'Ok there is a parent parent for this Chart'
				]
			)

			#alias
			PyplotedParentFigureDerivePyploterVariable=self.PyplotedParentPanelDerivePyploterVariable.ParentDeriveTeamerVariable.ParentDeriveTeamerVariable
				
			if PyplotedParentFigureDerivePyploterVariable!=None:

				#set
				self.PyplotedParentFigureDerivePyploterVariable=PyplotedParentFigureDerivePyploterVariable

				#debug
				self.debug(
					[
						'Yes the panel parent parent exists'
					]
				)

			else:

				#debug
				self.debug(
					[
						'Nope the parent parent not exist so direct set figure with panel parent'
					]
				)

				#set
				self.PyplotedParentFigureDerivePyploterVariable=self.PyplotedParentPanelDerivePyploterVariable

		else:

			#set
			self.PyplotedParentFigureDerivePyploterVariable=self

		#debug
		self.debug(
			[
				'Ok for this Chart, we have determined the panel and figure parent',
				#('self.',self,[
				#	'PyplotedParentFigureDerivePyploterVariable'
				#])
			]
		)

		#/#################/#
		# First shift in the grid
		#

		#Check
		if self.ManagementIndexInt>0:

			#debug
			'''
			self.debug(
					[
						'first we shift',
						'self.PyplotedParentPanelDerivePyploterVariable.PyplotedCursorIntsList is ',
						str(self.PyplotedParentPanelDerivePyploterVariable.PyplotedCursorIntsList),
						('self.',self,['PyplotingShapeIntsTuple','PyplotingShiftIntsTuple'])
					]
				)
			'''

			#get
			PreviousChartPyploter=self.ParentDeriveTeamerVariable.ManagementDict.getValue(
				self.ManagementIndexInt-1
			)

			#debug
			self.debug(
				[
					'We have getted the PreviousChartPyploter',
					'PreviousChartPyploter is ',
					SYS._str(PreviousChartPyploter)
				]
			)

			#shift
			if self.PyplotingShiftIntsTuple[0]>0:
				self.PyplotedParentPanelDerivePyploterVariable.PyplotedCursorIntsList[0
				]+=self.PyplotingShiftIntsTuple[0]+PreviousChartPyploter.PyplotingShapeIntsTuple[0]
			if self.PyplotingShiftIntsTuple[1]>0:
				self.PyplotedParentPanelDerivePyploterVariable.PyplotedCursorIntsList[1
				]+=self.PyplotingShiftIntsTuple[1]+PreviousChartPyploter.PyplotingShapeIntsTuple[1]

			#debug
			'''
			self.debug(
					[
						'Ok we have shifted',
						'now we link with the fig',
						('self.PyplotedParentPanelDerivePyploterVariable.',self.PyplotedParentPanelDerivePyploterVariable,
							['PyplotedCursorIntsList']),
					]
				)
			'''

		#set
		if self.PyplotedParentPanelDerivePyploterVariable!=None:
			self.PyplotedAnchorIntsList=copy.copy(
				self.PyplotedParentPanelDerivePyploterVariable.PyplotedCursorIntsList
			)

		#/#################/#
		# init
		#

		#debug
		'''
		self.debug(
				[
					'Ok we set an axes here',
					('self.',self,[
							'PyplotingGridIntsTuple',
							'PyplotedAnchorIntsList',
							'PyplotingShapeIntsTuple'
						]),
					''
				]
			)
		'''

		#init
		from matplotlib import pyplot
		self.PyplotedAxesVariable=pyplot.subplot2grid(
				self.PyplotedParentFigureDerivePyploterVariable.PyplotingGridIntsTuple, 
				self.PyplotedAnchorIntsList, 
				rowspan=self.PyplotingShapeIntsTuple[0],
				colspan=self.PyplotingShapeIntsTuple[1]
			)

		#debug
		'''
		self.debug(
				[
					'Ok we have initiated the axes',
					('self.',self,['PyplotedAxesVariable'])
				]
			)
		'''

		#/#################/#
		# link to the fig
		#

		#link
		self.PyplotedAxesVariable._figure=self.PyplotedFigureVariable	

		#debug
		'''
											}
										),
										(
											'<Output>ImageMultiplier/update',
											{
												'LiargVariablesList':[
													[
														('MultiplyingFirstInt',1),
														('MultiplyingSecondInt',1),
													]
												]
											}
										)
									]).modulize()

#Definition the AttestedStr
SYS._attest(
	[
		'MyModulizer is '+SYS._str(
		MyModulizer,
		**{
			'RepresentingBaseKeyStrsListBool':False,
			'RepresentingAlineaIsBool':False
		}
		)
	]
) 

#Print

        # set the FactorizedTotalFloat
        self.FactorizedTotalFloat = np.power(
            sum(map(lambda __DeriveSumer: __DeriveSumer.SumedTotalInt, self[self.OrganizedComponentsGetStr])),
            self.FactorizingPowerFloat,
        )


# Definition of a Factorizer
MyFactorizer = FactorizerClass().__setitem__(
    "Dis_<Component>",
    [
        [("GridingScanTuplesList", [("SumingFirstInt", [1]), ("SumingSecondInt", [2, 4])])],
        [("GridingScanTuplesList", [("SumingFirstInt", [0, 1]), ("SumingSecondInt", [3])])],
    ],
)

# grid
MyFactorizer.grid([("FactorizingPowerFloat", [1, 2])])

# Definition the AttestedStr
SYS._attest(
    [
        "MyFactorizer is "
        + SYS._str(MyFactorizer, **{"RepresentingBaseKeyStrsListBool": False, "RepresentingAlineaIsBool": False}),
        "hdf5 file is : " + MyFactorizer.hdfview().hdfclose().HdformatedConsoleStr,
    ]
)

# Print
print('Now we switch all')
MyBuilder.setSwitch('make',BuilderClass)

#Print
print('After the switch MyBuilder.__dict__ is ')
SYS._print(MyBuilder.__dict__)

#make again
MyBuilder.make(7.)

#Print
print('After the third make, MyBuilder.__dict__ is ')
SYS._print(MyBuilder.__dict__)

#Definition the AttestedStr
SYS._attest(
	[
		'BuilderClass.WatchBeforeMakeWithMakerBool is '+str(BuilderClass.WatchBeforeMakeWithMakerBool),
		'BuilderClass.make is '+str(BuilderClass.make),
		'BuilderClass.build is '+str(BuilderClass.build),
		'MyBuilder.__dict__ is '+SYS._str(
			MyBuilder.__dict__
		)
	]
) 

#Print



							'SynapsePreStr':'gi-=9*mV',
							'SynapseProbabilityFloat':0.02
						}
					)
				]
			}
		]
	).brian()
		
#Definition the AttestedStr
SYS._attest(
	[
		'MyBrianer is '+SYS._str(
		MyBrianer,
		**{
			'RepresentingBaseKeyStrsList':False,
			'RepresentingAlineaIsBool':False
		}
		),
	]
) 

#SYS._print(MyBrianer.BrianedMonitorsList[0].__dict__)

#SYS._print(
#	MyBrianer.BrianedNeuronGroupsList[0].__dict__
#)

#import matplotlib
#plot(MyBrianer['<Connectome>FirstRater'].)
	).command(
		'/-Models/|Result',
		[
			'#call:insert',
			('setSwitch',['insert'])
		]
	).mapSet(
		[
			('SumingFirstInt',3),
			('SumingSecondInt',5)
		]
	).sum(
	).command(
		'/-Models/|Result',
		'#call:insert'
	)

#/######################/#
# Print
#

#print
print('MySumer is ')
SYS._print(MySumer)

#view
print('hdf5 file is : \n'+SYS._str(MySumer.hdfview()))

#close
MySumer.file(_ModeStr='c')
					"hello"
				)
			)
		]
	)


#Map some gets
GatheredVariablesList=MyGatherer.gather(
							[
								['MyInt'],
								['/FirstChildGatherer/MyStr','/SecondChildGatherer/MyStr']
							]
						)
		
#Definition the AttestedStr
SYS._attest(
	[
		'GatheredVariablesList is '+SYS._str(
			GatheredVariablesList
			,**{
					'RepresentingBaseKeyStrsListBool':False,
					'RepresentingAlineaIsBool':False
			}
		)
	]
) 

#Print

Exemplo n.º 29
0
#FrozenIsBool False

#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Objects.Hdformater import Drafts
		
#Definition the AttestedStr
SYS._attest(
	[
		'DefaultAttributeItemTuplesList is '+SYS._str(
			Drafts.DraftsClass.DefaultAttributeItemTuplesList,
			**{'RepresentingAlineaIsBool':False}
		)
	]
) 

#Print

#Definition 
MyController=SYS.ControllerClass(
		**{
			'FolderingPathStr':SYS.Tabularer.LocalFolderPathStr,
			'ControllingModelClassVariable':SYS.TabularerClass
		}
	).set(
		'/-Models/|Things',
		{
			'ModelingDescriptionTuplesList':
			[
				#GetStr #ColumnStr #Col
				('MyInt','MyInt',tables.Int64Col()),
				('MyStr','MyStr',tables.StringCol(10)),
				('MyIntsList','MyIntsList',tables.Int64Col(shape=3))
			]	
		}
	)

#Definition the AttestedStr
print('MyController is ')
SYS._print(MyController)

#view
print('hdf5 file is : \n'+SYS._str(MyController.hdfview()))

#close
MyController.file(_ModeStr='c')


Exemplo n.º 31
0
#Definition 
MyController=SYS.ControllerClass(
		**{
			'FolderingPathStr':SYS.Tabler.LocalFolderPathStr,
			'ControllingModelClassVariable':SYS.TabularerClass
		}
	).get(
		'/-Models/|Things'
	)


#Build a structure with a database
SYS.set(
		MyController['/-Models/|Things'].ModeledMongoCollection,
		[
			('remove',{}),
			('insert',{'MyStr':"hello"})
		]
)

#print
print('mongo db is : \n'+SYS._str(MyController.pymongoview()))

#print
print('MyController is ')
SYS._print(MyController)

#kill
MyController.process(_ActionStr='kill')