tensorbay.client.diff

Class about the diff.

DiffBase defines the basic structure of a diff.

NotesDiff defines the basic structure of a brief diff of notes.

CatalogDiff defines the basic structure of a brief diff of catalog.

FileDiff defines the basic structure of a brief diff of data file.

LabelDiff defines the basic structure of a brief diff of data label.

SensorDiff defines the basic structure of a brief diff of sensor.

DataDiff defines the basic structure of a brief diff of data.

SegmentDiff defines the basic structure of a brief diff of a segment.

DatasetDiff defines the basic structure of a brief diff of a dataset.

class tensorbay.client.diff.DiffBase(action)[source]

Bases: tensorbay.utility.attr.AttrsMixin, tensorbay.utility.repr.ReprMixin

This class defines the basic structure of a diff.

Parameters

action (str) –

Return type

None

action

The concrete action.

Type

str

classmethod loads(contents)[source]

Loads a DiffBase instance from the given contents.

Parameters

contents (Dict[str, Any]) –

A dict containing all the information of the diff:

{
    "action": <str>
}

Returns

A DiffBase instance containing all the information in the given contents.

Return type

tensorbay.client.diff._T

dumps()[source]

Dumps all the information of the diff into a dict.

Returns

A dict containing all the information of the diff:

{
    "action": <str>
}

Return type

Dict[str, Any]

class tensorbay.client.diff.NotesDiff(action)[source]

Bases: tensorbay.client.diff.DiffBase

This class defines the basic structure of a brief diff of notes.

Parameters

action (str) –

Return type

None

class tensorbay.client.diff.CatalogDiff(action)[source]

Bases: tensorbay.client.diff.DiffBase

This class defines the basic structure of a brief diff of catalog.

Parameters

action (str) –

Return type

None

class tensorbay.client.diff.FileDiff(action)[source]

Bases: tensorbay.client.diff.DiffBase

This class defines the basic structure of a brief diff of data file.

Parameters

action (str) –

Return type

None

class tensorbay.client.diff.LabelDiff(action)[source]

Bases: tensorbay.client.diff.DiffBase

This class defines the basic structure of a brief diff of data label.

Parameters

action (str) –

Return type

None

class tensorbay.client.diff.SensorDiff(action)[source]

Bases: tensorbay.client.diff.DiffBase

This class defines the basic structure of a brief diff of sensor.

Parameters

action (str) –

Return type

None

class tensorbay.client.diff.DataDiff(action)[source]

Bases: tensorbay.client.diff.DiffBase

This class defines the basic structure of a diff statistic.

Parameters

action (str) –

Return type

None

remote_path

The remote path.

Type

str

action

The action of data.

Type

str

file

The brief diff information of the file.

Type

tensorbay.client.diff.FileDiff

label

The brief diff information of the labels.

Type

tensorbay.client.diff.LabelDiff

classmethod loads(contents)[source]

Loads a DataDiff instance from the given contents.

Parameters

contents (Dict[str, Any]) –

A dict containing all the brief diff information of data:

{
    "remotePath": <str>,
    "action": <str>,
    "file": {
        "action": <str>
    },
    "label": {
        "action": <str>
    }
}

Returns

A DataDiff instance containing all the information in the given contents.

Return type

tensorbay.client.diff._T

dumps()[source]

Dumps all the brief diff information of data into a dict.

Returns

A dict containing all the brief diff information of data:

{
    "remotePath": <str>,
    "action": <str>,
    "file": {
        "action": <str>
    },
    "label": {
        "action": <str>
    }
}

Return type

Dict[str, Any]

class tensorbay.client.diff.SegmentDiff(name, action, data)[source]

Bases: tensorbay.utility.user.UserSequence[tensorbay.client.diff.DataDiff], tensorbay.utility.name.NameMixin

This class defines the basic structure of a brief diff of a segment.

Parameters
  • name – The segment name.

  • action – The action of a segment.

class tensorbay.client.diff.DatasetDiff(name, segments)[source]

Bases: Sequence[tensorbay.client.diff.SegmentDiff], tensorbay.utility.name.NameMixin

This class defines the basic structure of a brief diff of a dataset.

Parameters
  • name – The segment name.

  • action – The action of a segment.