wonambi.widgets.info module

Widget with general information about the dataset.

class wonambi.widgets.info.ExportDatasetDialog(parent)[source]

Bases: QDialog

Dialog for choosing export dataset options.

button_clicked(button)[source]

Action when button was clicked.

Parameters:

button (instance of QPushButton) – which button was pressed

create_dialog()[source]

Create the dialog.

get_channels()[source]

Get the selected channel(s in order).

save_as()[source]

Dialog for getting name, location of dataset export.

toggle_buttons()[source]

Turn buttons on and off.

update()[source]

Get info from dataset before opening dialog.

class wonambi.widgets.info.Info(parent)[source]

Bases: QWidget

Display information about the dataset.

parent

the main window.

Type:

instance of QMainWindow

filename

the full path of the file.

Type:

str

dataset

the dataset already read in.

Type:

instance of wonambi.Dataset

markers

list of the markers in the dataset

Type:

list

idx_filename

button to select dataset / show current dataset

Type:

QPushButton

idx_s_freq

show sampling frequency

Type:

QLabel

idx_n_chan

show number of channels

Type:

QLabel

idx_start_time

show start time of the dataset

Type:

QLabel

idx_end_time

show end time of the dataset

Type:

QLabel

idx_start

show start time of the window

Type:

QLabel

idx_length

show length of the time window

Type:

QLabel

idx_scaling

show current scaling

Type:

QLabel

idx_distance

show current distance between traces

Type:

QLabel

create()[source]

Create the widget layout with all the information.

create_action()[source]

Create actions associated with this widget.

Notes

I think that this should be a function or a property.

The good thing about the property is that it is updated every time you run it (for example, if you change some parameters in the settings). The main drawback is that you cannot reference back to the QAction, as it creates new ones every time.

display_dataset()[source]

Update the widget with information about the dataset.

display_view()[source]

Update information about the size of the traces.

export(new_format, filename=None, chan=None, begtime=None, endtime=None)[source]

Export current dataset to wonambi format (.won).

Parameters:
  • new_format (str) – Format for exported record: ‘edf’ or ‘wonambi’

  • filename (str or PosixPath) – filename to export to

  • chan (list of str, opt) – list of original channel names to export. if None, all channels are exported

  • begtime (int or datedelta or datetime) – start of the data to read; if it’s int or float, it’s assumed it’s s; if it’s timedelta, it’s assumed from the start of the recording; if it’s datetime, it’s assumed it’s absolute time.

  • endtime (int or datedelta or datetime) – end of the data to read; if it’s int or float, it’s assumed it’s s; if it’s timedelta, it’s assumed from the start of the recording; if it’s datetime, it’s assumed it’s absolute time.

open_dataset(recent=None, debug_filename=None, bids=False)[source]

Open a new dataset.

Parameters:

recent (path to file) – one of the recent datasets to read

reset()[source]

Reset widget to original state.