def update_trim_case(self, trimcase, parameter): print 'update_trim_case' self.get_parameters_info_from_avl(self.avl) self.avl.sendline('oper') self.avl.sendline(trimcase.type_) self.avl.expect(AVL.patterns['/oper/m']) #print self.parameters.keys() #for p, v in trimcase.parameters.iteritems(): self.avl.sendline('%s %f' % (parameter.cmd, parameter.value)) AVL.goto_state(self.avl)
operations=[], editable=False), show_label=False), Item('object.matrix.matrix', editor=TabularEditor(adapter=EigenMatrixAdapter(), operations=[], editable=False), show_label=False)), resizable=True) if __name__ == '__main__': from pyavl.avl import AVL from pyavl.runutils import RunConfig from pyavl import runs_dir, join avl = AVL(cwd=runs_dir) filename = join(runs_dir, 'allegro.avl') avl.load_case_from_file(filename) rv = RunConfig(runcase=RunCase.get_case_from_avl(avl.avl)) print rv.configure_traits(kind='livemodal') print 'rv configured' output = rv.run() print output print 'rv ran' opv = OutputPlotViewer(runoutput=output) opv.configure_traits() ovv = OutputVariablesViewer(runoutput=output) ovv.configure_traits() osv = OutputSystemViewer(runoutput=output)
self.update() def _root_object_items_changed(self, list_event): """Trait handler called when the items of the list change.""" self._root_object_changed(self.root_object) def _on_dclick(self, obj): """Callback that is called when nodes are double-clicked.""" if hasattr(obj, 'object') and hasattr(obj.object, 'edit_traits'): object = obj.object view = object.trait_view() view.handler = UICloseHandler(browser=self) #object.on_trait_change(self.render) ui = object.edit_traits(view=view) #view = View() if __name__ == '__main__': from pyavl import runs_dir, join file = open(join(runs_dir, 'vanilla.avl')) avl = AVL(cwd=runs_dir) avl.load_case_from_file(join(runs_dir, 'vanilla.avl')) #tv = AVLTreeView(avl=avl) tv = AVLTreeBrowser(avl) #gui = GUI() #tv.show() #gui.start_event_loop() tv.configure_traits(view=tv.view)
def _root_object_items_changed(self, list_event): """Trait handler called when the items of the list change.""" self._root_object_changed(self.root_object) def _on_dclick(self, obj): """Callback that is called when nodes are double-clicked.""" if hasattr(obj, 'object') and hasattr(obj.object, 'edit_traits'): object = obj.object view = object.trait_view() view.handler = UICloseHandler(browser=self) #object.on_trait_change(self.render) ui = object.edit_traits(view=view) #view = View() if __name__ == '__main__': from pyavl import runs_dir, join file = open(join(runs_dir, 'vanilla.avl')) avl = AVL(cwd=runs_dir) avl.load_case_from_file(join(runs_dir, 'vanilla.avl')) #tv = AVLTreeView(avl=avl) tv = AVLTreeBrowser(avl) #gui = GUI() #tv.show() #gui.start_event_loop() tv.configure_traits(view=tv.view)
variable_names = sorted(var_names.keys(), key=lambda x:var_names[x]) vars = numpy.empty((len(outs), num_vars)) for i, out in enumerate(outs): for n, v in out.iteritems(): vars[i, var_names[n]] = v #print 'variable runs', len(vars) #print 'modes', len(modes) #print 'matrices', len(matrices) output = RunOutput(variable_names=variable_names, variable_values=vars, eigenmodes=modes, eigenmatrix=matrices) return output if __name__ == '__main__': from pyavl import runs_dir from os.path import join avl = AVL(cwd=runs_dir) filename = join(runs_dir, 'allegro.avl') avl.load_case_from_file(filename) rv = RunConfig(runcase=RunCase.get_case_from_avl(avl.avl)) print rv.configure_traits(kind='livemodal') print 'rv configured' #gui = GUI() #window = ApplicationWindow() #window.open() #print 'window opened' output = rv.run() print output print 'rv ran' #gui.start_event_loop() #print 'main loop finished'