astrorigin / pyswisseph

Python extension to the Swiss Ephemeris
https://astrorigin.com/pyswisseph
GNU Affero General Public License v3.0
237 stars 65 forks source link

Wrong python stub for function calc_ut #29

Closed praveen-astro closed 3 years ago

praveen-astro commented 4 years ago

The function calc_ut in swisseph.py shows the following documentation,

def calc_ut(jd, pl): # real signature unknown; restored from doc """ Calculate body positions (UT).

Args: float julday, int planet, int flag=FLG_SWIEPH+FLG_SPEED
Return: tuple of 6 float, and returned flags

Usage example:

  res, flg = swisseph.calc_ut(jd, pl)
"""
pass

Where as it also accepts a flag variable, the pycharm linter warns about unexpected argument, but passing the flag works, i checked the corresponding c code. Here it sets the flag, and again parse the kargs for the &flag, and so int flag=FLG_SWIEPH+FLG_SPEED has no effect.

I think this function should continue having the flag cofigurable to programmer, and still have it in the python stub.

https://github.com/astrorigin/pyswisseph/blob/master/pyswisseph.c#L165

praveen-astro commented 4 years ago

I think we should just change the comment, as the stub is getting generated by comment

astrorigin commented 4 years ago

How should we change the comment?

astrorigin commented 3 years ago

No answers, closing.