Skip to content

SWIG: add specialised input typemaps for LALDict

Karl Wette requested to merge (removed):pydict-to-laldict into master

Description

Specialised input typemaps for LALDict. Accepts a SWIG-wrapped LALDict, or:

  • For Python, a native dictionary with keys of the form "key[:type]", where "type" specifies the type of the LALDict entry: "[U]INT{2,4,8}" for integer values, "REAL{4,8}" for real values, and "COMPLEX{8,16}" for complex values. If "type" is absent, the entry is assumed to be a string.

Example usage:

pydict = {
    "str": "A string value",
    "2-byte-unsigned:UINT2": 32767,
    "4-byte-unsigned:UINT4": 123456,
    "8-byte-unsigned:UINT8": 9223372036854775807,
    "2-byte-signed:INT2": -32768,
    "4-byte-signed:INT4": -123456,
    "8-byte-signed:INT8": 9223372036854775807,
    "single:REAL4": 987e6,
    "double:REAL8": -543e-21,
    "single complex:COMPLEX8": complex(987e6, -123e4),
    "double complex:COMPLEX16": complex(-543e-21, 345e43)
}
lal.swig_lal_test_pydict_to_laldict(pydict)

API Changes and Justification

Backwards Compatible Changes

  • This change introduces no API changes
  • This change adds new API calls

Backwards Incompatible Changes

  • This change modifies an existing API
  • This change removes an existing API

If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.

Review Status

N/A

Edited by Ghost User

Merge request reports

Loading