Feature #2469

PythonAPI: make 'result' more pythonic

Added by wuttke about 1 month ago. Updated about 1 month ago.

Status:NewStart date:25 Jun 2020
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:v2.0

Description

From notes by Thomas Rod:

'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.

History

#1 Updated by wuttke about 1 month ago

  • Target version set to v2.0

API breaking, therefore scheduled for 2.0

Also available in: Atom PDF