Skip to content

Transition to json string inputs

Currently we attempt to support a wide-range of possible inputs for tuples/dictionaries/lists parsed using these functions tuple, dict, list.

This is useful in many cases, but can cause various headaches. For example, strings containing colons cannot be parsed.

As a first step, I suggest adding a line that attempts to parse the string using the bilby_decode_json hook for json

json.loads(string_input, object_hook=decode_bilby_json))

and keep the current method with add a deprecation warning as a fallback.

cc @daniel-williams @rhiannon.udall

Edited by Colm Talbot