def change_specimen(self, old_spec_name, new_spec_name,
                        new_sample_name=None, new_er_data=None, new_pmag_data=None,
                        replace_data=False):
        """
        Find actual data objects for specimen and sample.
        Then call Specimen class change method to update specimen name and data.
        """
        specimen = self.find_by_name(old_spec_name, self.specimens)
        if not specimen:
            print('-W- {} is not a currently existing specimen, so cannot be updated'.format(old_spec_name))
            return False
        if new_sample_name:
            new_sample = self.find_by_name(new_sample_name, self.samples)
            if not new_sample:
                print("""-W- {} is not a currently existing sample.
Creating a new sample named: {} """.format(new_sample_name, new_sample_name))
                new_sample = self.add_sample(new_sample_name)
        else:
            new_sample = None
        specimen.change_specimen(new_spec_name, new_sample, new_er_data, new_pmag_data, replace_data)
        return specimen
def change_specimen ( self , old_spec_name , new_spec_name , new_sample_name = None , new_er_data = None , new_pmag_data = None , replace_data = False ) : specimen = self . find_by_name ( old_spec_name , self . specimens ) if not specimen : print ( '-W- {} is not a currently existing specimen, so cannot be updated' . format ( old_spec_name ) ) return False if new_sample_name : new_sample = self . find_by_name ( new_sample_name , self . samples ) if not new_sample : print ( """-W- {} is not a currently existing sample.
Creating a new sample named: {} """ . format ( new_sample_name , new_sample_name ) ) new_sample = self . add_sample ( new_sample_name ) else : new_sample = None specimen . change_specimen ( new_spec_name , new_sample , new_er_data , new_pmag_data , replace_data ) return specimen
Find actual data objects for specimen and sample.
        Then call Specimen class change method to update specimen name and data.