Comments (26)
As I wrote in the mailing list: I'd vote for adopting the astropy scheme, starting with 0.1 for the pre-release, and then having 1.0 as soon as the open issues are fixed. SInce there is no direct linkt to SOFA, changes from IAU (new versions) and from third-party could be handled equally.
from erfa.
The philosophy of ERFA is meant to be that it is tracking SOFA so I see the parent version of SOFA as being important information. The plan is not to develop ERFA independently and add lots of new features.
from erfa.
I'll just move the discussion in the mailing list here, so here is a (lightly modified) copy:
@timj writes:
On Mon, Aug 12, 2013 at 10:34 AM, @olebole wrote:
@taldcroft writes:
I propose that the first formal release of ERFA should roughly coincide with astropy 0.3, even though they are unbundled.
Why do you think they will diverge? ERFA is tracking SOFA. I didn't think we were developing ERFA independently. Patch releases to do with building tweaks were all that I was envisaging.
I mean that the ERFA version will diverge from astropy: while astropy is under heavy development (and will stay so, hopefully for the future :-)), ERFA is supposed to be stable.
I vote for being explicit and deriving the version number from the SOFA version that it is derived from.
One could; however I would not put too much information into this number. When you look at the evolution of SOFA (and extrapolate that to the future of ERFA), there was not soo much change over the years. the "yyyymmdd"-information does not give much and is less handy than just a "1.0", or "1.1" or so. Except leap seconds.
Also, since erfa is not sofa, we would need to add its own release information. for sofa_c-20120301_a
, we had an erfa-20120301_a_1
, erfa-20120301_a_2
etc.
And if IAU decides just to adopt changes proposed by ERFA, they release a (let's say) sofa-20120301_b
, which we start to integrate into a erfa-20120301_b_1
which is identical to the release before since they just adopted our changes. Sound a bit confusing to me.
However, at the end I really do not care. I happily will take any solution and create an appropriate Debian release number (except that I then will put dots in the date string for readability, as I did for iausofa_c).
Best
Ole
from erfa.
SOFA has an annoying date-based version scheme, however. Would much rather use a semver-compatible version. There doesn't have to be a one-to-one mapping of every SOFA version to every ERFA version either--just update the ERFA version every time it's updated from the latest SOFA. Note the SOFA version it's derived from in the docs somewhere.
from erfa.
I would go for semantic versoning, just for simplicity.
from erfa.
I'm also +1 on semantic versioning starting at 1.0, with something in the README.rst
(for example) that indicates the version of SOFA that was used to derive ERFA. I presume the major version would increment with a new release of IAU SOFA, with minor versions indicating local patches. @timj - it seems most are in favor of semantic, are you OK with that?
from erfa.
@taldcroft I'm happy with your approach.
from erfa.
Semantic would be my preference as well, with an explicit mention of the last version number recorded in the README.rst
(or possibly INFO
) as @taldcroft suggested.
from erfa.
I'm fine with the semantic versioning approach, and I think that we should indeed start at 1.0. Note that these versions will not always match exactly with SOFA releases due to patches such as the one @taldcroft is suggesting, so we can basically say e.g. 1.0 is the same as SOFA version x with the following differences.
from erfa.
In addition to having the version in the README can we please have it in a header file as well. I would like it both as a string and as three integers like:
#define ERFA_VERSION "1.0.0"
#define ERFA_VERSION_MAJOR 1
#define ERFA_VERSION_MINOR 0
#define ERFA_VERSION_MICRO 0
I think this is a must-have. Also please no versions as floats (I'm looking at you CFITSIO). Also these can be added at build time using a config.h.in that gets built into config.h. The version can just be parsed out of a single file so it only needs to be updated in one place.
from erfa.
I would more care about having it in the library, so that a program can check at runtime which version it uses. Just having it in the header is not enough, since libsofa.so can be upgraded after compliation. And so, astropy cannot check whether it runs with the most current version.
from erfa.
@olebole Sure. I think there should be both. In the library there can be a global variable like:
char *liberfa_version_string = ERFA_VERSION;
also
typedef struct {
unsigned int major;
unsigned int minor;
unsigned int micro;
} _liberfa_version_type;
_liberfa_version_type liberfa_version = {ERFA_VERSION_MAJOR, ERFA_VERSION_MINOR, ERFA_VERSION_MICRO};
Add the appropriate extern
declarations in the header.
from erfa.
@embray autoconf provides a PACKAGE_VERSION C macro with the value of the version of the package set in AC_INIT. The macro is written in config.h. So we can do:
#include <config.h>
char *liberfa_version_string = PACKAGE_VERSION;
For the MAJOR/MINOR/MICRO numbers, I'm not aware of standard autotools functions, but I can write one that splits PACKAGE_VERSION and defines PACKAGE_VERSION_MAJOR, etc, in config.h
from erfa.
pkg-config files have a version field and it can be used to check for particular versions of libraries
You can check the version of the library in the command line with:
$ pkg-config --version erfa
1.1.0
or inside a configure
script provided by autotools with:
PKG_CHECK_MODULES([ERFA], [erfa >= 1.0])
In this last case, the check fails if the version of erfa is less than 1.0
I'm not familiar with cmake, but I'm sure that it supports pkg-config files
from erfa.
There is another number that we have to provide, the library interface version. This goes in the soname of the shared libraries and its used at run time by the system loader to determine if the program can be run with the current version of the library.
For example, if a program was compiled with a version with soname liberfa.so.0
, it will not work if the soname of the library in the system is liberfa.so.1
. Thus, the soname is changed on API breackages.
The current Makefile of erfa does not provide soname, but #5 does. I propose to follow the libtool convention to provide the soname.
This convention is followed by lots of open source libraries. If you look into a library directory in your system you will find files like this:
libfoo.so.0.3.0
libfoo.so.0
libfoo.so
where the last two files are links to the first file. A library like this probably follows the libtool convention.
from erfa.
@embray - are the options autoconf
gives (that @sergiopasra outlined here) good enough as far as you're concerned? And are you attached to the major
/minor
/micro
enough that it's worth getting these things parsed out from the char*
, or is PACKAGE_VERSION
mostly acceptable?
So @sergiopasra , based on your discussion of the soname
, should we adopt the convention that the major
be incremented for all API changes? Or only those that are backwards-incompatible?
from erfa.
I should be easy enough to split PACKAGE_VERSION
. It's really useful to have the version split into separate numbers so that you don't have to implement version parsing every time you want to compare some version strings. But if it's a hassle for getting this issue closed we can just open a separate issue about it to address when a specific need arises.
from erfa.
@eteq I believe that major should be updated only in backwards-incompatible changes. Minor for backwards-compatible changes and micro for no changes in the API.
from erfa.
BTW, I have added the code to split the version string in commit sergiopasra@789eb8e
from erfa.
Alright, so any objections to this scheme:
- Major changes only when API is not backwards-compatible
- Minor changes when API changes but is backwards-compatible
- Micro changes for bugfixes.
@olebole @embray @timj @astrofrog ?
from erfa.
@eteq fine.
from erfa.
Hah, it just occurred to me that what I typed above is very nearly the definition of semantic versioning, so we're back where we started :) but good we got the issues flushed out
from erfa.
Yep, pretty much :)
from erfa.
Sounds good!
from erfa.
Sorry, I didn't see that this is still open. Fine for me as well. May be closed :-)
from erfa.
Oops, yeah, I actually meant to close this when #5 was merged. Thanks for the reminder, @olebole
from erfa.
Related Issues (20)
- Make a way to use local device's leap second information
- ERFA 1.7 still has version number 1.6!? HOT 2
- Fix README.rst -- update release info HOT 6
- Porting ERFA to different languages - licensing HOT 17
- starpm does not work for moderate proper motion/no parallax case HOT 1
- Update to match SOFA 20200721
- Unexpected result from d2dtf() very near day boundary in UTC HOT 9
- Have links in docs/README to other languages?
- change in header files to make things better for C++? HOT 4
- Update to SOFA 17a HOT 2
- Should macros in erfam.h be considered part of the API? HOT 1
- Auto-update zenodo HOT 1
- why use fmod in calculating Fundamental arguments in eraNut80?
- Wrong result from d2dtf() in pre-1972 UTC
- d2dtf(), dtf2d(), utctai(), dat(): Inexact table and method of detecting jump HOT 13
- proposal: use integer times internally HOT 8
- Single-precision floating-point level rounding errors when using pmsafe HOT 44
- Need to update to SOFA 19 HOT 2
- Check version number consistency on updates
- Question on tai to utc conversion HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from erfa.