impy-project / chromo

Hadronic Interaction Model interface in PYthon
Other
30 stars 7 forks source link

Why chromo have no define? #181

Closed Xiaozizhuo closed 11 months ago

Xiaozizhuo commented 12 months ago

Hello dear developers, I'm a beginner at Chromo. When I use your package, I find that the contents of the chromo file do not have function definitions, so some functions cannot be used. How can this be solved? N`JXZ~AV_$20ERTI$TYY~JO

afedynitch commented 12 months ago

Hi @Xiaozizhuo ,

We’re waiting for one issue to be solved in numpy #127 before publishing the first full official release. We currently have a prerelease version of chromo with most features on pypi. To install it you need to add the ‘—pre’ option to ‘pip install’.

Xiaozizhuo commented 11 months ago

Thank you for your kind reply, here I have two questions: 1. How long will the latest version be online? 2. You said this installation method, I'm sorry I didn't understand what you mean.Do you mean to use 'pip install chromo' to install? I used this method, but the installed chromo definition file does not have any information in it.Can you please go into more detail?

jncots commented 11 months ago

Hi @Xiaozizhuo,

You can install pre-release version like this:

# Uninstall empty version
pip uninstall chromo 

# Install pre-release version
pip install --pre chromo

Note that

pip install chromo 

currently doesn't work. It will work after we release the full version. We are planning to release it as soon as the issue with numpy in https://github.com/impy-project/chromo/pull/127 will be solved.

Xiaozizhuo commented 11 months ago

Thank you for your help, following your method I got a complete definition of a chromo file.

But there is also a new bug:

numpy.core.multiarray failed to import

I initially thought it was due to incompatibility between my version of numpy and the version of numpy used by your package, so I reinstalled a lot of versions, but to no avail.

Can you tell me what version of numpy is in your package? I would also like to hear your opinion, what is the problem causing this?

jncots commented 11 months ago

I initially thought it was due to incompatibility

It is because of incompatibility. Chromo from pip works for numpy >=1.23. This should work:

pip install numpy==1.24.0
Xiaozizhuo commented 11 months ago

Thank you for your help, I have successfully run the example on the official page. I'm starting to learn the meaning of each function in your package now, and I'll ask for more advice in the future.