hitranonline / hapi

HITRAN Application Programming Interface (HAPI)
Other
80 stars 35 forks source link

Can not import HAPI V.1.2.2.0 under Python 3.4 #38

Open zhanyifan opened 2 years ago

zhanyifan commented 2 years ago

Hello, Thanks for providing the HAPI for scientific research! I am a freshman for HAPI and Python. I am using Python 3.4.1 with Anaconda 2.1.0 (64-bit) and the numpy has been intalled. When I tried to import the newest version of HAPI[V.1.2.2.0], I got the following error message (can also be checked within the attachment ):

from hapi import * File "C:\Users\xxx\Anaconda3\lib\hapi.py", line 35549 return absorptionCoefficient_Generic(*args,**kwargs, SyntaxError: invalid syntax

20220825145957

I have tested that the HAPI [V.1.2.2.0] can be imported under Python 3.9+ while the HAPI [V.1.1.0.7] can be imported under Python 3.4. But I have to use Python 3.4 now, can you help finding out what a issue exist?

Thank you!

jmmelko commented 10 months ago

I am not an historian of Python, but it looks likes 3.4 does not like "line breaks" in the code. I would suggest upgrading to 3.6 or more, or edit hapi manually to add a line continuation character ' \' at the end of each line like this one.

either that or your file got corrupted

zhanyifan commented 10 months ago

I am not an historian of Python, but it looks likes 3.4 does not like "line breaks" in the code. I would suggest upgrading to 3.6 or more, or edit hapi manually to add a line continuation character ' \' at the end of each line like this one.

either that or your file got corrupted

Thank you very much for the comment! I will try it later. :)