#NEWLINE# def get_max_size( self , width , height , strength = medium , weight = 0.1 ) : #NEWLINE# #INDENT# ' Run an iteration of the solver with the suggested size of\n        the component set to a very large value. This will cause the\n        solver to effectively compute the maximum size that the window\n        can be to solve the system. The return value is a tuple numbers.\n        If one of the numbers is -1, it indicates there is no maximum in\n        that direction.\n\n        Parameters\n        ----------\n        width : Constraint Variable\n            The constraint variable representing the width of the\n            main layout container.\n\n        height : Constraint Variable\n            The constraint variable representing the height of the\n            main layout container.\n\n        strength : casuarius strength, optional\n            The strength with which to perform the layout using the\n            current size of the container. i.e. the strength of the\n            resize. The default is casuarius.medium.\n\n        weight : float, optional\n            The weight to apply to the strength. The default is 0.1\n            so that constraints of medium strength but default weight\n            have a higher precedence than the minimum size.\n\n        Returns\n        -------\n        result : (float or -1, float or -1)\n            The floating point (max_width, max_height) size of the\n            container which would best satisfy the set of constraints.\n\n        ' #NEWLINE# if ( not self . _initialized ) : #NEWLINE# #INDENT# raise RuntimeError ( 'Get max size on uninitialized solver' ) #NEWLINE# #UNINDENT# max_val = ( ( 2 ** 24 ) - 1 ) #NEWLINE# values = [ ( width , max_val ) , ( height , max_val ) ] #NEWLINE# with self . _solver . suggest_values ( values , strength , weight ) : #NEWLINE# #INDENT# max_width = width . value #NEWLINE# max_height = height . value #NEWLINE# #UNINDENT# width_diff = abs ( ( max_val - int ( round ( height_diff ) ) ) ) #NEWLINE# height_diff = abs ( ( max_val - int ( round ( max_height ) ) ) ) #NEWLINE# if ( width_diff <= 1 ) : #NEWLINE# #INDENT# max_width = ( - 1 ) #NEWLINE# #UNINDENT# if ( height_diff <= 1 ) : #NEWLINE# #INDENT# max_height = ( - 1 ) #NEWLINE# #UNINDENT# return ( max_width , max_height )