diff --git a/src/amuse/community/mesa_r15140/interface.py b/src/amuse/community/mesa_r15140/interface.py index 2fb291a0e6..0ff48d43f0 100644 --- a/src/amuse/community/mesa_r15140/interface.py +++ b/src/amuse/community/mesa_r15140/interface.py @@ -1090,10 +1090,10 @@ def set_accrete_composition_metals_identifier(self, index_of_the_star, zfracs): def get_accrete_composition_metals(self, index_of_the_star): result = {} - for element in ['li','be','b','c','n','o','f','ne','mg','al','si','p', + for element in ['li','be','b','c','n','o','f','ne','na','mg','al','si','p', 's','cl','ar','k','ca','sc','ti','v','cr','mn','fe', 'co','ni','cu','zn']: - r = self.get_control(index_of_the_star,'z_fraction_'+element) + r = self.get_control(index_of_the_star,f'z_fraction_{element}') result[element] = r['value'] return result @@ -1102,13 +1102,13 @@ def set_accrete_composition_metals(self, index_of_the_star, **kwargs): ''' Sets the accretion composition based on the following elements: - 'li','be','b','c','n','o','f','ne','mg','al','si','p' + 'li','be','b','c','n','o','f','ne','na','mg','al','si','p' 's','cl','ar','k','ca','sc','ti','v','cr','mn','fe', 'co','ni','cu','zn' Thus to set the li accretion fraction to 1/2 then pass li=0.5 - If an element is not set then its left with its currernt value + If an element is not set then its left with its current value These must sum to 1.0 (the total z fraction is set by setting the non_metals to the 1-Z value) @@ -1116,11 +1116,11 @@ def set_accrete_composition_metals(self, index_of_the_star, **kwargs): result = {} for element,value in kwargs.items(): - if element not in ['li','be','b','c','n','o','f','ne','mg','al','si','p', + if element not in ['li','be','b','c','n','o','f','ne','na','mg','al','si','p', 's','cl','ar','k','ca','sc','ti','v','cr','mn','fe', 'co','ni','cu','zn']: - raise ValueError("Bad element "+str(element)) - r = self.set_control(index_of_the_star,'z_fraction_'+element,value) + raise ValueError(f"Bad element {element}") + r = self.set_control(index_of_the_star,f'z_fraction_{element}',value) return r