Beispiel #1
0
    def set_settables(self, *args, **kwargs):
        ensem = args[1]
        self.parent = ensem
        window = args[0]
        if self.brand_new:
            ensem.run_params["plot_targets"].append(self.label)
            plan = ensem.run_params["output_plans"]["Simulation"]
            plan.targeted.append(self.label)
            plan.rewidget(True)
            for subtargeted in plan.outputs:
                subtargeted.append(self.label)

            self.brand_new = not self.brand_new

            # dictionary_support = lgm.dictionary_support_mason(window)
        where_reference = ensem.run_params["variables"]
        cartographer_support = lgm.cartographer_mason(window)
        self.handle_widget_inheritance(*args, **kwargs)
        self.parameter_space_templates = [
            lgeo.interface_template_p_space_axis(
                parent=self, p_sp_bounds=self._p_sp_bounds_[0], instance=self, key="value"
            )
        ]
        self.parameter_space_templates[0].set_settables(*args, **kwargs)
        self.widg_templates.append(
            lgm.interface_template_gui(
                widgets=["spin"],
                doubles=[[True]],
                initials=[[float(self.value)]],
                instances=[[self]],
                keys=[["value"]],
                box_labels=["Variable Value"],
                mason=cartographer_support,
                parameter_space_templates=[self.parameter_space_templates[0]],
            )
        )
        self.widg_templates.append(
            lgm.interface_template_gui(
                widgets=["text"],
                # mason = dictionary_support,
                # wheres = [[where_reference]],
                keys=[["label"]],
                instances=[[self]],
                initials=[[self.label]],
                box_labels=["Variable Name"],
            )
        )
        modular_object.set_settables(self, *args, from_sub=True)
Beispiel #2
0
	def set_settables(self, *args, **kwargs):
		ensem = args[1]
		self.parent = ensem
		window = args[0]
		if self.brand_new:
			ensem.run_params['plot_targets'].append(self.label)
			plan = ensem.run_params['output_plans']['Simulation']
			plan.targeted.append(self.label)
			plan.rewidget(True)
			for subtargeted in plan.outputs:
				subtargeted.append(self.label)

			self.brand_new = not self.brand_new

		#dictionary_support = lgm.dictionary_support_mason(window)
		where_reference = ensem.run_params['variables']
		cartographer_support = lgm.cartographer_mason(window)
		self.handle_widget_inheritance(*args, **kwargs)
		self.parameter_space_templates =\
			[lgeo.interface_template_p_space_axis(parent = self, 
							p_sp_bounds = self._p_sp_bounds_[0], 
								instance = self, key = 'value')]
		self.parameter_space_templates[0].set_settables(*args, **kwargs)
		self.widg_templates.append(
			lgm.interface_template_gui(
				widgets = ['spin'], 
				doubles = [[True]], 
				initials = [[float(self.value)]], 
				instances = [[self]], 
				keys = [['value']], 
				box_labels = ['Variable Value'], 
				mason = cartographer_support, 
				parameter_space_templates =\
					[self.parameter_space_templates[0]]))
		self.widg_templates.append(
			lgm.interface_template_gui(
				widgets = ['text'], 
				#mason = dictionary_support, 
				#wheres = [[where_reference]], 
				keys = [['label']], 
				instances = [[self]], 
				initials = [[self.label]], 
				box_labels = ['Variable Name']))
		modular_object.set_settables(self, *args, from_sub = True)
Beispiel #3
0
	def set_settables(self, *args, **kwargs):
		ensem = args[1]
		self.parent = ensem
		window = args[0]
		self.handle_widget_inheritance(*args, **kwargs)
		self.widg_templates.append(
			lgm.interface_template_gui(
				keys = [['values']], 
				instances = [[self]], 
				widgets = ['text'], 
				box_labels = ['Vector Components']))
		self.widg_templates.append(
			lgm.interface_template_gui(
				widgets = ['text'], 
				keys = [['label']], 
				instances = [[self]], 
				initials = [[self.label]], 
				box_labels = ['Vector Name']))
		modular_object.set_settables(self, *args, from_sub = True)
Beispiel #4
0
 def set_settables(self, *args, **kwargs):
     ensem = args[1]
     self.parent = ensem
     window = args[0]
     self.handle_widget_inheritance(*args, **kwargs)
     self.widg_templates.append(
         lgm.interface_template_gui(
             keys=[["values"]], instances=[[self]], widgets=["text"], box_labels=["Vector Components"]
         )
     )
     self.widg_templates.append(
         lgm.interface_template_gui(
             widgets=["text"],
             keys=[["label"]],
             instances=[[self]],
             initials=[[self.label]],
             box_labels=["Vector Name"],
         )
     )
     modular_object.set_settables(self, *args, from_sub=True)
Beispiel #5
0
 def set_settables(self, *args, **kwargs):
     ensem = args[1]
     window = args[0]
     spec_list = ensem.run_params['species'].keys()
     cartographer_support = lgm.cartographer_mason(window)
     self.handle_widget_inheritance(*args, **kwargs)
     self.parameter_space_templates =\
      [lgeo.interface_template_p_space_axis(parent = self,
          p_sp_bounds = self._p_sp_bounds_[0],
           instance = self, key = 'rate')]
     self.parameter_space_templates[0].set_settables(*args, **kwargs)
     left_template = lgm.interface_template_gui(
         panel_position=(0, 2),
         mason=cartographer_support,
         layout='vertical',
         keys=[['label'], ['rate']],
         instances=[[self], [self]],
         widgets=['text', 'text'],
         minimum_sizes=[[(400, 100)], [(100, 100)]],
         box_labels=['Reaction Name', 'Reaction Rate'],
         initials=[[self.label], [self.rate]],
         parameter_space_templates=[
             None, self.parameter_space_templates[0]
         ])
     self.verify_agents(spec_list)
     agents_template = lgm.interface_template_gui(
         panel_position=(0, 0),
         layout='horizontal',
         widgets=['check_spin_list', 'check_spin_list'],
         keys=[['used'], ['produced']],
         instances=[[self], [self]],
         labels=[spec_list, spec_list],
         box_labels=['Reagents', 'Products'])
     self.widg_templates.append(
         lgm.interface_template_gui(
             widgets=['splitter'],
             orientations=[['horizontal']],
             templates=[[left_template, agents_template]]))
     modular_object.set_settables(self, *args, from_sub=True)
Beispiel #6
0
	def set_settables(self, *args, **kwargs):
		ensem = args[1]
		self.parent = ensem
		window = args[0]
		'''
		if self.brand_new:
			ensem.run_params['plot_targets'].append(self.label)
			plan = ensem.run_params['output_plans']['Simulation']
			plan.targeted.append(self.label)
			plan.rewidget(True)
			for subtargeted in plan.outputs:
				subtargeted.append(self.label)

			self.brand_new = not self.brand_new
		'''

		#dictionary_support = lgm.dictionary_support_mason(window)
		#where_reference = ensem.run_params['vectors']
		#cartographer_support = lgm.cartographer_mason(window)
		self.handle_widget_inheritance(*args, **kwargs)
		#self.parameter_space_templates =\
		#	[lgeo.interface_template_p_space_axis(parent = self, 
		#					p_sp_bounds = self._p_sp_bounds_[0], 
		#						instance = self, key = 'value')]
		#self.parameter_space_templates[0].set_settables(*args, **kwargs)
		self.widg_templates.append(
			lgm.interface_template_gui(
				keys = [['values']], 
				instances = [[self]], 
				widgets = ['text'], 
				box_labels = ['Vector Components']))
		self.widg_templates.append(
			lgm.interface_template_gui(
				widgets = ['text'], 
				keys = [['label']], 
				instances = [[self]], 
				initials = [[self.label]], 
				box_labels = ['Vector Name']))
		modular_object.set_settables(self, *args, from_sub = True)
Beispiel #7
0
	def set_settables(self, *args, **kwargs):
		ensem = args[1]
		window = args[0]
		spec_list = ensem.run_params['species'].keys()
		cartographer_support = lgm.cartographer_mason(window)
		self.handle_widget_inheritance(*args, **kwargs)
		self.parameter_space_templates =\
			[lgeo.interface_template_p_space_axis(parent = self, 
							p_sp_bounds = self._p_sp_bounds_[0], 
								instance = self, key = 'rate')]
		self.parameter_space_templates[0].set_settables(*args, **kwargs)
		left_template = lgm.interface_template_gui(
				panel_position = (0, 2), 
				mason = cartographer_support, 
				layout = 'vertical', 
				keys = [['label'], ['rate']], 
				instances = [[self], [self]], 
				widgets = ['text', 'text'], 
				minimum_sizes = [[(400, 100)], [(100, 100)]], 
				box_labels = ['Reaction Name', 'Reaction Rate'], 
				initials = [[self.label], [self.rate]], 
				parameter_space_templates = [None, 
					self.parameter_space_templates[0]])
		self.verify_agents(spec_list)
		agents_template = lgm.interface_template_gui(
				panel_position = (0, 0), 
				layout = 'horizontal', 
				widgets = ['check_spin_list', 'check_spin_list'], 
				keys = [['used'], ['produced']], 
				instances = [[self], [self]], 
				labels = [spec_list, spec_list],
				box_labels = ['Reagents', 'Products'])
		self.widg_templates.append(
			lgm.interface_template_gui(
				widgets = ['splitter'], 
				orientations = [['horizontal']], 
				templates = [[left_template, agents_template]]))
		modular_object.set_settables(self, *args, from_sub = True)
Beispiel #8
0
	def set_settables(self, *args, **kwargs):
		window = args[0]
		self.parent = args[1]
		ensem = self.parent
		cartographer_support = lgm.cartographer_mason(window)
		self.handle_widget_inheritance(*args, **kwargs)
		if self.brand_new:
			ensem.run_params['plot_targets'].append(self.label)
			plan = ensem.run_params['output_plans']['Simulation']
			plan.targeted.append(self.label)
			plan.rewidget(True)
			for subtargeted in plan.outputs:
				subtargeted.append(self.label)

			self.brand_new = not self.brand_new

		label_data_links = [lfu.interface_template_dependance(
								(self, 'label', self.label), 
								linkages = [(ensem.run_params, 
										'plot_targets', True, 
											'append_list')])]
		#this will cause a bug if a propensity_function_maker class
		# with a .key attribute which should not be linked to the
		# species name exists - so do not use one with this module
		#on the other hand, a subclass which uses .key exploits this
		#	this bug can be fixed with name mangling on the base class!!

		label_data_links.extend([lfu.interface_template_dependance(
			(self, 'label', self.label), linkages =\
				[(ensem.run_params['output_plans']['Simulation'], 
							'targeted', True, 'append_list')])])
		[label_data_links.extend([lfu.interface_template_dependance(
			(self, 'label', self.label), linkages =\
				[(ensem.run_params['output_plans']['Simulation'], 
					'outputs', True, 'append_list_nested', dex)])]) 
											for dex in range(4)]
		label_data_links.extend(
			[lfu.interface_template_dependance(
				(self, 'label', self.label), 
				linkages = [(rxn, 'used', True, 
					'append_tuples_list', 0, 0)]) 
					for rxn in ensem.run_params['reactions']])
		label_data_links.extend(
			[lfu.interface_template_dependance(
				(self, 'label', self.label), 
				linkages = [(rxn, 'produced', True, 
					'append_tuples_list', 0, 0)]) 
					for rxn in ensem.run_params['reactions']])		
		window = args[1]
		self.handle_widget_inheritance(*args, **kwargs)
		self.parameter_space_templates =\
			[lgeo.interface_template_p_space_axis(instance = self, 
							key = 'initial_count', parent = self, 
							p_sp_bounds = self._p_sp_bounds_[0], 
							p_sp_increment = self._p_sp_increments_[0], 
											p_sp_continuous = False)]
		self.parameter_space_templates[0].set_settables(*args, **kwargs)
		self.widg_templates.append(
			lgm.interface_template_gui(
				mason = cartographer_support, 
				widgets = ['spin'], 
				instances = [[self]], 
				keys = [['initial_count']], 
				minimum_values = [[0]], 
				maximum_values = [[sys.maxint]], 
				initials = [[self.initial_count]], 
				box_labels = ['Initial Count'], 
				parameter_space_templates =\
					[self.parameter_space_templates[0]]))
		self.widg_templates.append(
			lgm.interface_template_gui(
				keys = [['label']], 
				minimum_sizes = [[(150, 50)]], 
				instances = [[self]], 
				widgets = ['text'], 
				box_labels = ['Species Name']))
		modular_object.set_settables(self, *args, from_sub = True)
Beispiel #9
0
    def set_settables(self, *args, **kwargs):
        window = args[0]
        self.parent = args[1]
        ensem = self.parent
        cartographer_support = lgm.cartographer_mason(window)
        self.handle_widget_inheritance(*args, **kwargs)
        if self.brand_new:
            ensem.run_params['plot_targets'].append(self.label)
            plan = ensem.run_params['output_plans']['Simulation']
            plan.targeted.append(self.label)
            plan.rewidget(True)
            for subtargeted in plan.outputs:
                subtargeted.append(self.label)

            self.brand_new = not self.brand_new

        label_data_links = [
            lfu.interface_template_dependance(
                (self, 'label', self.label),
                linkages=[(ensem.run_params, 'plot_targets', True,
                           'append_list')])
        ]
        #this will cause a bug if a propensity_function_maker class
        # with a .key attribute which should not be linked to the
        # species name exists - so do not use one with this module
        #on the other hand, a subclass which uses .key exploits this
        #	this bug can be fixed with name mangling on the base class!!

        label_data_links.extend([lfu.interface_template_dependance(
         (self, 'label', self.label), linkages =\
          [(ensem.run_params['output_plans']['Simulation'],
             'targeted', True, 'append_list')])])
        [label_data_links.extend([lfu.interface_template_dependance(
         (self, 'label', self.label), linkages =\
          [(ensem.run_params['output_plans']['Simulation'],
           'outputs', True, 'append_list_nested', dex)])])
                 for dex in range(4)]
        label_data_links.extend([
            lfu.interface_template_dependance(
                (self, 'label', self.label),
                linkages=[(rxn, 'used', True, 'append_tuples_list', 0, 0)])
            for rxn in ensem.run_params['reactions']
        ])
        label_data_links.extend([
            lfu.interface_template_dependance(
                (self, 'label', self.label),
                linkages=[(rxn, 'produced', True, 'append_tuples_list', 0, 0)])
            for rxn in ensem.run_params['reactions']
        ])
        window = args[1]
        self.handle_widget_inheritance(*args, **kwargs)
        self.parameter_space_templates =\
         [lgeo.interface_template_p_space_axis(instance = self,
             key = 'initial_count', parent = self,
             p_sp_bounds = self._p_sp_bounds_[0],
             p_sp_increment = self._p_sp_increments_[0],
                 p_sp_continuous = False)]
        self.parameter_space_templates[0].set_settables(*args, **kwargs)
        self.widg_templates.append(
         lgm.interface_template_gui(
          mason = cartographer_support,
          widgets = ['spin'],
          instances = [[self]],
          keys = [['initial_count']],
          minimum_values = [[0]],
          maximum_values = [[sys.maxint]],
          initials = [[self.initial_count]],
          box_labels = ['Initial Count'],
          parameter_space_templates =\
           [self.parameter_space_templates[0]]))
        self.widg_templates.append(
            lgm.interface_template_gui(keys=[['label']],
                                       minimum_sizes=[[(150, 50)]],
                                       instances=[[self]],
                                       widgets=['text'],
                                       box_labels=['Species Name']))
        modular_object.set_settables(self, *args, from_sub=True)