Re: [RFC 7/7] kernel-shark: Add basic example demonstrating the NumPy interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 27, 2019 at 6:04 PM Yordan Karadzhov <ykaradzhov@xxxxxxxxxx> wrote:
[...]
> diff --git a/kernel-shark/bin/sched_wakeup.py b/kernel-shark/bin/sched_wakeup.py

[...]

> +ks.open_file(fname)
> +ofst, cpu, evt, pid, ts = ks.load_data()

Returning a tuple of 5 numpy arrays as API will be impossible to
extend in the future without breaking existing code. It's also easy
for users to get the order of the return values wrong. Have you
thought of returning a container object that's holding the numpy
arrays? Pandas DataFrame[1] comes to mind although I don't know if
it's worth to take Pandas as dependency for this.

[1] https://pandas.pydata.org/pandas-docs/version/0.23.4/generated/pandas.DataFrame.html

-- Slavi




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux