qsrlib_qsrs.qsr_abstractclass module

class qsrlib_qsrs.qsr_abstractclass.QSR_Abstractclass[source]

Bases: object

Root abstract class of the QSR implementators.

Abstract properties
  • _unique_id (str): Unique identifier of a QSR.
  • _all_possible_relations (tuple): All possible relations of a QSR.
  • _dtype (str): Kind of data the QSR operates with, see self._dtype_map for possible values.
Members
  • _dtype_map (dict): Mapping of _dtype to methods. It is equal to:

`python {"points": self._return_points,        "bounding_boxes": self._return_bounding_boxes_2d,        "bounding_boxes_2d": self._return_bounding_boxes_2d} `

all_possible_relations

Getter for self._all_possible_relations.

Returns:All the possible relations of the QSR.
Return type:tuple
get_qsrs(**req_params)[source]

Compute the QSRs.

This method is called from QSRlib so no need to call it directly from anywhere else.

Parameters:req_params (dict) – The request parameters.
Returns:Computed world qsr trace.
Return type:qsrlib_io.world_qsr_trace.World_QSR_Trace
make_world_qsr_trace(world_trace, timestamps, qsr_params, req_params, **kwargs)[source]

The main function that generates the world QSR trace.

[QSR_Dyadic_Abstractclass](qsrlib_qsrs.qsr_dyadic_abstractclass.QSR_Dyadic_Abstractclass), etc.) need to provide this function. * When inheriting from one of the special case meta-abstract classes (e.g. QSR_Monadic_2t_Abstractclass <qsrlib_qsrs.qsr_monadic_abstractclass.QSR_Monadic_2t_Abstractclass>, QSR_Dyadic_1t_Abstractclass qsrlib_qsrs.qsr_dyadic_abstractclass.QSR_Dyadic_1t_Abstractclass, etc.) then usually there is no need to do so; check with the documentation of these special cases to see if they already implement one.

Parameters:
  • world_trace (qsrlib_io.world_trace.World_Trace) – The input data.
  • timestamps (list) – List of sorted timestamps of world_trace.
  • qsr_params (dict) – QSR specific parameters passed in dynamic_args.
  • dynamic_args (dict) – The dynamic arguments passed with the request.
  • kwargs – Optional further arguments.
Returns:

The computed world QSR trace.

Return type:

qsrlib_io.world_qsr_trace.World_QSR_Trace

unique_id

Getter for self._unique_id.

Returns:The unique identifier of the QSR.
Return type:str