Closed levitsky closed 6 months ago
This looks good to me, thank you for catching that duplicate water constant.
Thank you for checking it @mobiusklein !
Hello. So, I`ve been using your package for a while now, and after this update it seems like something broke with the mass.calculate_mass(composition) function.
On 4.6.2 I could just do this:
from pyteomics import mass
mass.calculate_mass(composition={'H' : 1})
and it would return me:
1.00782503207
but now, on 4.7, when I type the same things I get:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\analyst\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyteomics\mass\mass.py", line 654, in calculate_mass return composition.mass(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\analyst\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyteomics\mass\mass.py", line 485, in mass return self._mass_to_mz(mass, self, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Composition._mass_to_mz() got multiple values for argument 'composition'
Is this intended behavior? If so, how should I adapt my code?
Hi @FrangoST, thank you for reaching out!
This was not an intended change, I'm sorry for the inconvenience. I made a change to fix this in master
, and if everything works as expected now, I will make a release shortly.
This PR adds a new optional argument to
mass.calculate_mass
,proforma
. If specified, it should be a ProForma string or aproforma.ProForma
object. Itsmass
property is then converted to m/z if needed.