You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in #6239, Erfa v1.4.0 includes liberfa/erfa#42, which exposes the ERFA and SOFA versions in the API.
Unfortunately, the current erfa_generator.py doesn't handle these correctly, for three different reasons reasons:
Some of the functions return const char* . One would expect const char* functions to return strings at the Python layer. However, the regular SOFA functions return strings via "output arguments" - i.e. char * inputs that get populated inside the function. So the current erfa_generator.py machinery doesn't know what to do with returned const char*'s.
Some of the functions return int . int return values elsewhere in SOFA are status codes, rather than having actual meaning in and of themselves. So the erfa_generator.py machinery handles those functions assuming they are status codes rather than values to just pass through.
The macros needed to actual determine the various version numbers are set in config.h in the standard erfa C build. But we don't want that in the python erfa. My temporary solution is to just hand copy the relevant 5 macros from config.h to erfaversion.c... but that's a manual solution and is not really a good idea from a maintenance point of view (it should be possible to just copy erfa over wholesale without modification).
These are all solvable problems, but probably require someone with knowledge of the Python C API... But we really should try to solve them by v3.0.0 so that the manual copying I did in #6239 is no longer required.
The text was updated successfully, but these errors were encountered:
As mentioned in #6239, Erfa v1.4.0 includes liberfa/erfa#42, which exposes the ERFA and SOFA versions in the API.
Unfortunately, the current
erfa_generator.py
doesn't handle these correctly, for three different reasons reasons:const char*
. One would expectconst char*
functions to return strings at the Python layer. However, the regular SOFA functions return strings via "output arguments" - i.e.char *
inputs that get populated inside the function. So the currenterfa_generator.py
machinery doesn't know what to do with returnedconst char*
's.int
.int
return values elsewhere in SOFA are status codes, rather than having actual meaning in and of themselves. So theerfa_generator.py
machinery handles those functions assuming they are status codes rather than values to just pass through.config.h
in the standarderfa
C build. But we don't want that in the pythonerfa
. My temporary solution is to just hand copy the relevant 5 macros fromconfig.h
toerfaversion.c
... but that's a manual solution and is not really a good idea from a maintenance point of view (it should be possible to just copy erfa over wholesale without modification).These are all solvable problems, but probably require someone with knowledge of the Python C API... But we really should try to solve them by v3.0.0 so that the manual copying I did in #6239 is no longer required.
The text was updated successfully, but these errors were encountered: