Source code for kappa_sdk.document_vector
from datetime import datetime
from typing import List, Optional
from .vector import Vector
[docs]
class DocumentVector(Vector):
    """ KW document vector object.
    Container of the document data that, in addition to the :class:`Vector`, stores the name and the dimension of the data.
    .. note:: Should not be instantiated directly.
    """
[docs]
    def __init__(self,
                 dates: List[datetime],
                 values: List[float],
                 name: str,
                 measure: str,
                 is_derivative: bool,
                 is_model: bool,
                 is_by_step: bool = False,
                 vector_id: Optional[str] = None,
                 first_x: Optional[datetime] = None):
        Vector.__init__(self, dates, values, first_x, vector_id)
        self.__name: str = name
        self.__measure: str = measure
        self.__is_derivative: bool = is_derivative
        self.__is_model: bool = is_model
        self.__is_by_step: bool = is_by_step 
    @property
    def data_name(self) -> str:
        """ Name of this :class:`DocumentVector`.
        """
        return self.__name
    @property
    def data_measure(self) -> str:
        """ KW Measure associated with this :class:`DocumentVector`.
        """
        return self.__measure
    @property
    def is_derivative(self) -> bool:
        """ A value indicating whether this :class:`DocumentVector` is a derivative data or not.
        """
        return self.__is_derivative
    @property
    def is_model(self) -> bool:
        """ A value indicating whether this :class:`DocumentVector` is a model data or not.
        """
        return self.__is_model
    @property
    def is_by_step(self) -> bool:
        """ A value indicating whether this :class:`DocumentVector` is a step data or not.
        """
        return self.__is_by_step