Provide a nice-to-have list toward more pythonic BornAgain PythonAPI
|Status:||Rejected||Start date:||22 Apr 2020|
A list of potential improvements to the python API, written by Thomas (maybe you're speaking about this list?): Potential improvements: The documentation does not show how to use keyword variables, which usually is very good for tutorials. On the contrary, the variable names used in the tutorial does not corresponds to keyword variables plot_simulation_result should have a different options for units. It should be xunit rather than just units and xunits should be defined through a string. E.g. "degrees", "radians", "q", etc. 'result' seems to some kind of swig object rather than just a python object. This seems a bit overkill result.histogram2d kills the kernel. This should just be a 2d array representing the histogram, which is directly plotable with matplotlib. Alternatively a pandas DataFrame could be useful, this would easily enable the user to plot with different units. MultiLayer should behave like a list or perhaps an ordered dictionary, e.g. class Multilayer(list): Online documentation is not comprehensive (e.g. sample?) Would be nice if the the following worked: plt.plot(*result) It should be easy to convert result to array (and DataFrame) It would be useful if result was of a Python or numpy builtin type so users readily would know how to deal with it. Many operations on result e.g. list(result) cause the kernel to fail rather than throwing an exception. This is pretty bad from a usability point of view.