OpenMS icon indicating copy to clipboard operation
OpenMS copied to clipboard

Would you please update the version of pyopenms in PyPI?

Open daemonice opened this issue 3 years ago • 6 comments

Hi Everyone,

I installed the pyopenms from PyPI (using pip install pyopenms, python 3.7.13, Windows 10). I found that the Kernel_MassTrace (the MassTrace class in original C++ code) class can be initialized from a list of Point2D according to the C++ code. However, when I try this in python, it leads to error. The code is like this:

from pyopenms import *
rts = [0.0, 0.1, 0.2]
intensities = [100, 200, 300]
mz = 150
points = []
for idx in range(len(rts)):
    point = Peak2D()
    point.setMZ(mz)
    point.setRT(rts[idx])
    point.setIntensity(intensities[idx])
    points.append(point)
masstrace = Kernel_MassTrace(points)

Traceback (most recent call last): File "D:\Anaconda3\envs\AOS\lib\site-packages\IPython\core\interactiveshell.py", line 3457, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 11, in masstrace = Kernel_MassTrace(points) File "pyopenms\pyopenms_4.pyx", line 4561, in pyopenms.pyopenms_4.Kernel_MassTrace.init Exception: can not handle type of ([<pyopenms.pyopenms_6.Peak2D object at 0x0000013D2DE11750>, <pyopenms.pyopenms_6.Peak2D object at 0x0000013D2DE11690>, <pyopenms.pyopenms_6.Peak2D object at 0x0000013D2DE116F0>],)

It was found to be version related. When a "nightly" version is used instead (I tested it on another computer with Ubuntu system), the codes run correctly. But it seems that the way building MassTrace from Peak2D has been introduced long time ago. Maybe it just wasn't introduced into the pyopenms-2.7.0 in PyPI. Would you please update the version of pyopenms in PyPI? Or would you please tell me how to get a newer version for python3.7 on Windows? I can only find the cp38/cp39/cp310 package when tried to get the wheel from "wget https://nightly.link/OpenMS/OpenMS/workflows/pyopenms-wheels/nightly/Windows-wheels.zip?status=completed"

daemonice avatar Aug 12 '22 06:08 daemonice

Hi. I think we now require newer python / cython versions. Would upgrading to python3.8 or higher be an option for you? We usually don't backport improved python bindings to older versions (we just don't have the resources for that).

timosachsenberg avatar Aug 12 '22 06:08 timosachsenberg

See also #6115. 2.7 is the last official release anyway. You can get 2.8 from conda only. Since #6115 is open for so long, it seems like no one has the capacities to restart the job and upload 2.8 manually, sorry.

jpfeuffer avatar Aug 12 '22 07:08 jpfeuffer

Hi. I think we now require newer python / cython versions. Would upgrading to python3.8 or higher be an option for you? We usually don't backport improved python bindings to older versions (we just don't have the resources for that).

OK. If it is the only viable solution, I will try to build a python3.9 environment and see if all my codes goes well. Thank you all.

daemonice avatar Aug 12 '22 07:08 daemonice

I don't think that will help. It is not available on pip at all.

jpfeuffer avatar Aug 12 '22 07:08 jpfeuffer

I think he might be referring to https://nightly.link/OpenMS/OpenMS/workflows/pyopenms-wheels/nightly/Windows-wheels.zip%5C?status%5C=completed

timosachsenberg avatar Aug 12 '22 07:08 timosachsenberg

Ah yes, we only support the latest three python versions at the time of creation of the package. If you want nightlies, py 3.9 will help.

jpfeuffer avatar Aug 12 '22 08:08 jpfeuffer

We now support loading nightly builds of pyopenms on our own pypi server at https://pypi.cs.uni-tuebingen.de/

poshul avatar Jan 13 '23 08:01 poshul