The Python implementation of the standard API works in terms of scipy distribution objects. For the C++ wrapper, we need to get the high level features stored in the TOML file; i.e. a name and a set of named parameters (I think!). Ideally, we would like a function which converted a Distribution into something like {'name' : 'gamma', 'params' : {'shape' : 1.0, 'scale' : 2.0}}, i.e using the logic in parameter_file.py.
In the short term, I can just replicate that code in pybind, but since the python code will presumably be updated to support more distributions with different sets of parameters, it would be good to avoid duplication of logic.
Note: one way to make this clean would be to have a keyword argument on read_distribution to say whether you wanted to return a scipy distribution object, or the high level representation (name, params, etc). The latter doesn't even need to go via the scipy distribution, as it's directly available in the TOML file.
The Python implementation of the standard API works in terms of scipy distribution objects. For the C++ wrapper, we need to get the high level features stored in the TOML file; i.e. a name and a set of named parameters (I think!). Ideally, we would like a function which converted a Distribution into something like {'name' : 'gamma', 'params' : {'shape' : 1.0, 'scale' : 2.0}}, i.e using the logic in parameter_file.py.
In the short term, I can just replicate that code in pybind, but since the python code will presumably be updated to support more distributions with different sets of parameters, it would be good to avoid duplication of logic.
Note: one way to make this clean would be to have a keyword argument on read_distribution to say whether you wanted to return a scipy distribution object, or the high level representation (name, params, etc). The latter doesn't even need to go via the scipy distribution, as it's directly available in the TOML file.