KPLRecordDataset

class dragon.io.KPLRecordDataset(
  path,
  name=None
)[source]

Dataset to load the KPLRecord.

You can create this dataset for DataReader:

reader = dragon.io.DataReader(
    dataset=dragon.io.KPLRecordDataset,
    source=path,
)

For the detailed reading procedure, see DataReader.

__init__

KPLRecordDataset.__init__(
  path,
  name=None
)[source]

Create a KPLRecordDataset.

Parameters:
  • path (str) – The path of record file.
  • name (str, optional) – The optional dataset name.

Properties

protocol

KPLRecordDataset.protocol

Return the protocol of dataset.

Returns:
RecordType – The descriptor of dataset.

size

KPLRecordDataset.size

Return the total number of examples.

Returns:
int – The number of examples.

Methods

get

KPLRecordDataset.get()[source]

Pop a example starting from cursor.

Returns:
ProtocolType – The example.

redirect

KPLRecordDataset.redirect(index)[source]

Move the cursor to the specified index.

Parameters:
  • index (int) – The index to move.