pyNAVIS.utils

Utils

class pyNAVIS.utils.Utils[source]

Methods:

execution_time(executing_function, ...)

Calculate the time that a function takes to execute (in seconds).

extract_addr_and_ts(zipped_addr_ts)

Converts a list of [address, timestamp] tuples into a SpikesFile.

getKey(item)

Get timestamps.

get_info(spikes_file)

Prints the number of spikes and the number of microseconds of audio that the SpikesFile contains.

order_timestamps(spikes_file)

Order the spikes contained in a SpikesFile by timestamp.

static execution_time(executing_function, function_params)[source]

Calculate the time that a function takes to execute (in seconds).

Parameters:
  • executing_function (function) – The name of the function whose execution time wants to be calculated.

  • function_params (list) – List of the parameters that want to be used in the executing_function.

Returns:

float – Time that the function takes to execute.

static extract_addr_and_ts(zipped_addr_ts)[source]

Converts a list of [address, timestamp] tuples into a SpikesFile.

Parameters:

aedat_addr_ts (list) – A list of [address, timestamp] tuples.

Returns:

SpikesFile – A SpikesFile object with the addresses and timestamps obtained from zipped_addr_ts

static getKey(item)[source]

Get timestamps. Used to sort zipped list of [address, timestamp] tuples by timestamp.

Parameters:

item (tuple) – [address, timestamp] tuple.

Returns:

int – Timestamp.

static get_info(spikes_file)[source]

Prints the number of spikes and the number of microseconds of audio that the SpikesFile contains.

Parameters:

spikes_file (SpikesFile) – File to get the information from.

Returns:

None.

static order_timestamps(spikes_file)[source]

Order the spikes contained in a SpikesFile by timestamp.

Parameters:

spikes_file (SpikesFile) – Input SpikesFile to order.

Returns:

SpikesFile – Ordered SpikesFile.