#NEWLINE# @ system . setter #NEWLINE# def system( self , new_system ) : #NEWLINE# #INDENT# if ( ( new_system is not None ) and ( not isinstance ( new_system , System ) ) ) : #NEWLINE# #INDENT# msg = '{} should be a valid pydy.System object' . format ( new_system ) #NEWLINE# raise TypeError ( msg ) #NEWLINE# #UNINDENT# if ( new_system is not None ) : #NEWLINE# #INDENT# msg = 'The {} attribute has already been set, so the system cannot be set. Use the clear_trajectories method to set all relevant attributes to None.' #NEWLINE# for attr in [ 'times' , 'constants' , 'states_symbols' , 'states_trajectories' ] : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# if ( getattr ( self , attr ) is not None ) : #NEWLINE# #INDENT# raise ValueError ( msg . format ( attr ) ) #NEWLINE# #UNINDENT# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . _system = new_system