#NEWLINE# def change_model_ws( self , new_pth = None , reset_external = False ) : #NEWLINE# #INDENT# '\n        Change the model work space.\n\n        Parameters\n        ----------\n        new_pth : str\n            Location of new model workspace.  If this path does not exist,\n            it will be created. (default is None, which will be assigned to\n            the present working directory).\n\n        Returns\n        -------\n        val : list of strings\n            Can be used to see what packages are in the model, and can then\n            be used with get_package to pull out individual packages.\n\n        ' #NEWLINE# if ( new_pth is None ) : #NEWLINE# #INDENT# new_pth = os . getcwd ( ) #NEWLINE# #UNINDENT# if ( not os . path . exists ( new_pth ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# sys . stdout . write ( '\ncreating model workspace...\n   {}\n' . format ( new_pth ) ) #NEWLINE# os . makedirs ( new_pth ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# print ( '\n{0:s} not valid, workspace-folder was changed to {1:s}\n' . format ( new_pth , os . getcwd ( ) ) ) #NEWLINE# new_pth = os . getcwd ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . _model_ws = new_pth #NEWLINE# sys . stdout . write ( '\nchanging model workspace...\n   {}\n' . format ( new_pth ) ) #NEWLINE# for pp in self . packagelist : #NEWLINE# #INDENT# pp . fn_path = os . path . join ( self . model_ws , pp . file_name [ 0 ] ) #NEWLINE# #UNINDENT# if ( hasattr ( self , 'external_path' ) and ( self . external_path is not None ) and ( not os . path . exists ( os . path . join ( self . _model_ws , self . external_path ) ) ) ) : #NEWLINE# #INDENT# pth = os . path . join ( self . _model_ws , self . external_path ) #NEWLINE# os . makedirs ( pth ) #NEWLINE# if reset_external : #NEWLINE# #INDENT# self . _reset_external ( pth ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if reset_external : #NEWLINE# #INDENT# self . _reset_external ( self . _model_ws ) #NEWLINE# #UNINDENT# #UNINDENT# return None