Published October 22, 2023 | Version 1.1
Software Open

Unity: multi-syntax unit parsing

  • 1. University of Glasgow

Description

This is the Unity library, which is able to parse scientific unit specifications using a variety of syntaxes.

The library was written with the following goals:

  • Producing formal grammars of the existing and proposed standard unit syntaxes, for reference purposes.
  • Participating in the VOUnit standardisation process by acting as a locus for experimentation with syntaxes and proposed standards.
  • To that end, discovering edge cases and producing test cases.
  • Producing parsing libraries which are fast and standalone, and so could be conveniently used by other software; this will act as an implementation of the eventual VOUnits standard.  The distribution is buildable using no extra software beyond a Java and a C compiler.  It is also a goal that the distributed Java is source-compatible with Java 1.8 (though this isn't automatically tested, so bugreports are welcome).

It is not a goal for this library to do any processing of the resulting units, such as unit conversion or arithmetic.  Parsing unit strings isn't a deep or particularly interesting problem, but it's more fiddly than one might expect, and so it's useful for it to be done properly once.

A major goal of the VOUnits process is to identify a syntax for unit strings (called 'VOUnits') which is as nearly as possible in the intersection of the various existing standards.  The intention is that if file creators target the VOUnits syntax, the resulting string has a chance of being readable by as many other parsers as possible.  This isn't completely possible (the OGIP syntax doesn't allow dots as multipliers), but we can get close.

This release is v1.1, and matches v1.1 of the VOUnits specification. For release notes, see below, and in the release-notes file in the distribution.

The contents of this upload are

  • unity-1.1-repo.zip : the repository code, as found at tag `1.1` of the repository (note, this is the code repository at release time, when this upload was made; the location of the master repository has changed before and may change again)
  • unity-1.1-srcdist.zip : the software distribution, as assembled from the repository code after some preprocessing
  • unity-1.1.jar : the executable jar file
  • unity-1.1-doxygen.zip and unity-1.1-javadocs.zip : the HTML versions of the documentation for the C and Java versions of the library

Changes in this version:

  • Build bugfix: the build from a repository now works with GNU Make 3, as well as v4.
  • Change the repository location (from sourcehut to heptapod).
  • Updates to a couple of other URIs.
  • VOUnits function-application can now include a 'scalefactor', thus `log(1e3MHz)` (issue #11, in part).
  • Recognise the four additional SI prefixes of 27th CGPM, resolution 3 (ie, ronto, ronno, quecto and quetta) (issue #13).
  • Recognise `%` as a unit (indicating multiplication by 0.01) in the VOUnits syntax (issue #11, in part).
  • Adjust parsing of leading floats: these now parse correctly with large positive positive or negative exponents (issue #12)
  • The `unity.jar` file is now installed to `@prefix@/data/java` (issue #16)
  • Fix status of Besselian/tropical years in FITS.
  • We now require, and claim compatibility with, Java 8.
  • Various build, configuration and documentation tweaks, avoiding warnings. Builds tested on a slightly broader range of platforms (including Alma 9 and Debian 12).

 

Files

unity-1.1-doxygen.zip

Files (2.2 MB)

Name Size Download all
md5:e0cc4fc4a3b15ac299b30ac5ab2cb12d
338.8 kB Preview Download
md5:45ce38af5987534502ec26d7aedbc965
119.8 kB Preview Download
md5:21756c00c750ca0f4fa10395ded5561b
762.6 kB Preview Download
md5:8ca3ae895abbf0b9766c1836132fae7e
844.3 kB Preview Download
md5:e08cf05c5ea3b3ba4edb97eb38b002fb
124.9 kB Download

Additional details

Related works

Cites
Technical note: 10.5479/ADS/bib/2014ivoa.spec.0523D (DOI)
Is derived from
Software: https://heptapod.host/nxg/unity/-/releases/1.1 (URL)

Funding

EUROVO-ICE – Euro-VO International Cooperation Empowerment 261541
European Commission

Dates

Updated
2023-10-22