Feature #2444

Provide a nice-to-have list toward more pythonic BornAgain PythonAPI

Added by pospelov 9 months ago. Updated 7 months ago.

Status:RejectedStart date:22 Apr 2020
Priority:NormalDue date:
Assignee:-% Done:


Target version:v2.0


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.


#1 Updated by pospelov 8 months ago

  • Tracker changed from Bug to Feature

#2 Updated by wuttke 7 months ago

  • Status changed from Backlog to Rejected

Replaced by issues #2467, #2468, #2469

Also available in: Atom PDF