cta-observatory / pycorsikaio

Python reader for CORSIKA binary file format
MIT License
9 stars 2 forks source link

Unable to read longitudinal profiles with python3.10 #31

Closed Jean1995 closed 1 year ago

Jean1995 commented 1 year ago

The package appears to be incompatible with python3.10.

I'll use the filepycorsikaio/tests/resources/corsika757_particleas an example, and want to execute the following lines of code

from corsikaio import CorsikaFile
PATH = "pycorsikaio/tests/resources/corsika757_particle"
with CorsikaFile(PATH) as f:
    for e in f:
        print(e.longitudinal['vertical_depth'])

which print only a list of empty arrays. This is identical to the result of issue #24.

With python3.8, everything is fine, the problem only started to appear for python3.10.

maxnoe commented 1 year ago

Can you make sure this is not e.g. an old Version of pycorsikaio sneaking in from the user path?

Please show:

corsikaio.__version__
corsikaio.__file__

and try exporting PYTHONNOUSERSITE=1 if you are using a conda env.

I highly recommend to set

conda env config -n <env name> vars set PYTHONNOUSERSITE=1

to make sure conda envs are actually isolated

maxnoe commented 1 year ago

The CI tests on python 3.10 and the specific test added for #24 passes.

Jean1995 commented 1 year ago

This was indeed due to the old corsikaio version