amepproject / amep

The Active Matter Evaluation Package (AMEP) - a Python library for the analysis of particle-based and continuum simulation data of soft and active matter systems
https://amepproject.de/
GNU General Public License v3.0
9 stars 2 forks source link

FRQ: extend functionality of frame.data() to accept lists #35

Open kay-ro opened 1 month ago

kay-ro commented 1 month ago

Proposed new feature or change:

The Frame s of Trajectory objects store all data and specific values can be extracted with frame.data() by supplying the wanted keys as arguments. But often it is easier to supply a list or array of keys which is not possible at the moment, therefore it would help to add a recursive call at the beginning of the function to accept lists as well as arguments.

if isinstance(args, (list, np.ndarray)):
    return data(self, *args, ptype = ptype, zerofill = zerofill, return_keys = return_keys)