#NEWLINE# def update_expression_list( self ) : #NEWLINE# #INDENT# 'Extract a list of expressions from the dictionary of expressions.' #NEWLINE# self . expression_list = [ ] #NEWLINE# self . expression_keys = [ ] #NEWLINE# self . expression_order = [ ] #NEWLINE# for ( fname , fexpressions ) in self . expressions . items ( ) : #NEWLINE# #INDENT# for ( type , texpressions ) in fexpressions . items ( ) : #NEWLINE# #INDENT# if ( type == 'function' ) : #NEWLINE# #INDENT# self . expression_list . append ( texpressions ) #NEWLINE# self . expression_keys . append ( [ fname , type ] ) #NEWLINE# self . expression_order . append ( 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( type [ ( - 10 ) : ] == 'derivative' ) : #NEWLINE# #INDENT# for ( dtype , expression ) in texpressions . items ( ) : #NEWLINE# #INDENT# self . expression_list . append ( expression ) #NEWLINE# self . expression_keys . append ( [ fname , type , dtype ] ) #NEWLINE# if ( ( type [ : ( - 10 ) ] == 'first_' ) or ( type [ : ( - 10 ) ] == '' ) ) : #NEWLINE# #INDENT# self . expression_order . append ( 3 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( type [ : ( - 10 ) ] == 'second_' ) : #NEWLINE# #INDENT# self . expression_order . append ( 4 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( type [ : ( - 10 ) ] == 'third_' ) : #NEWLINE# #INDENT# self . expression_order . append ( 5 ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . expression_list . append ( fexpressions [ type ] ) #NEWLINE# self . expression_keys . append ( [ fname , type ] ) #NEWLINE# self . expression_order . append ( 2 ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# ( self . expression_order , self . expression_list , self . expression_keys ) = zip ( * sorted ( zip ( self . expression_order , self . expression_list , self . expression_keys ) ) )