liberfa / erfa-fetch Goto Github PK
View Code? Open in Web Editor NEWEssential Routines for Astronomy
Essential Routines for Astronomy
In sofa_deriver.py
Copyright (C) 2013, NumFOCUS Foundation
should be updated to
Copyright (C) 2013-2014, NumFOCUS Foundation
Is that correct?
Apparently this isn't currently catching all the appearences of "SOFA" right now - need to fix that. Probably a tool at the end which looks through all the files for "iau" and "sofa" should run to be 100% sure.
There was a suggestion by the SOFA board that we may not want the function markers that say things like "Status: canonical model", given that it's "canonical" in the sense that SOFA and the IAU have endored it, and we don't have the official authority to call it "canonical".
The most straightforward solution is to just remove the status markers entirely. That seems fine to me because right now they all seem to be advisory (they are all things like "status: support function" rather than "status: broken" or something like that which the user cares about).
We've received permission from the numfocus foundation to use them as the copyright holders. So we should update the license to use them as the organization.
Right now some of the copyright/license/heritage discussion is in the preamble to the functions and some of it is at the end. A SOFA board member suggested we put it all at the end, with just a one-line reference in the function.
In an email thread it was suggested that it's good to put some of this material in the preamble because that makes it marginally more difficult to copy the function and forget the license (because usually you won't forget to include the documentation, but you might leave out the license at the end.)
As far as I can tell there is no reference in the derived ERFA library to the IAU SOFA version that was used to generate it. Did I miss this? It could probably go in the README.rst.
The source-flattener.py script is omitting the closing brace of the extern "C" {
directive. The directive then encloses any C++ source code where the flattened erfa.h is included and breaks compilation.
The end of the flattened erfa.h should look like the following:
...
void eraS2xpv(double s1, double s2, double pv[2][3], double spv[2][3]);
void eraSxp(double s, double p[3], double sp[3]);
void eraSxpv(double s, double pv[2][3], double spv[2][3]);
#ifdef __cplusplus
}
#endif
#endif
Running source_flattener.py
on the latest erfa release (2.0.0) creates the following errors when attempting to compile the result (this is with Apple clang 12.0 on OSX 10.15):
gcc -c -pedantic -Wall -O3 -g -fPIC -I. erfa.c -o erfa.o
In file included from erfa.c:1:
./erfa.h:634:21: error: unknown type name 'eraLEAPSECOND'
int eraDatini(const eraLEAPSECOND *builtin, int n_builtin,
^
./erfa.h:635:15: error: unknown type name 'eraLEAPSECOND'
eraLEAPSECOND **leapseconds);
^
./erfa.h:624:2: error: unterminated conditional directive
#ifndef _ERFA_DAT_EXTRA_H
^
./erfa.h:1:2: error: unterminated conditional directive
#ifndef ERFAHDEF
^
erfa.c:11911:10: error: use of undeclared identifier 'PACKAGE_VERSION'
return PACKAGE_VERSION;
^
erfa.c:11916:10: error: use of undeclared identifier 'PACKAGE_VERSION_MAJOR'
return PACKAGE_VERSION_MAJOR;
^
erfa.c:11921:10: error: use of undeclared identifier 'PACKAGE_VERSION_MINOR'
return PACKAGE_VERSION_MINOR;
^
erfa.c:11926:10: error: use of undeclared identifier 'PACKAGE_VERSION_MICRO'
return PACKAGE_VERSION_MICRO;
^
erfa.c:11931:10: error: use of undeclared identifier 'SOFA_VERSION'
return SOFA_VERSION;
^
erfa.c:15638:21: error: use of undeclared identifier 'DBL_EPSILON'
if ( (f-1.0) >= -DBL_EPSILON/4.0 ) {
^
erfa.c:15645:13: error: use of undeclared identifier 'DBL_EPSILON'
if ( -DBL_EPSILON/2.0 < f ) {
^
11 errors generated.
make[1]: *** [erfa.o] Error 1
make: *** [erfa] Error 2
It looks like the flattener creates a header file with the erfaextra.h
and erfadatextra.h
headers copied in the wrong order (the latter depends on the former), and with missing #endif
directives (or without stripping the existing directives from the headers first). The erfa.c
source file includes the version and leapsecond code, but also includes the testing code in t_erfa_c_extra.c
. The source file is also missing the #include <float.h>
that's required in jd2cal.c
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.