trajdl.datasets.base.abstract module#

class trajdl.datasets.base.abstract.BaseSeq(seq: Any, entity_id: str | None = None, ts_seq: List[int] | None = None, ts_delta: List[float] | None = None, dis_delta: List[float] | None = None, start_ts: int | None = None)[source]#

Bases: ABC

Abstract base class for sequence data representation.

This class provides a structure to initialize and validate sequences, entity IDs, and timestamps.

seq#

The sequence data.

Type:

Any

entity_id#

The identifier for the entity associated with the sequence.

Type:

Optional[str]

ts_seq#

The optional list of timestamps corresponding to the sequence data.

Type:

Optional[List[int]]

ts_delta#

time interval.

Type:

Optional[List[float]]

dis_delta#

distances.

Type:

Optional[List[float]]

start_ts#

θ‘¨η€ΊεΊεˆ—ηš„θ΅·ε§‹ζ—Άι—΄

Type:

Optional[int]

abstract static check_seq(seqs: Any) Any[source]#

Check if the sequence type is valid.

Parameters:

seqs (Any) – The sequence to be checked.

Returns:

The validated sequence.

Return type:

Any

property dis_delta: List[float] | None#
property entity_id: str | None#

Get the entity ID.

property seq: Any#

Get the stored sequence data.

set_entity_id(entity_id: str | None) None[source]#

Set the entity ID.

Parameters:

entity_id (Optional[str]) – The identifier to be set for the entity.

Raises:

ValueError – If entity_id is not a string or None.

property start_ts: int | float | None#
property ts_delta: List[float] | None#
property ts_seq: List[int] | None#

Get the timestamps associated with the sequence.