:mod:`quartic_sdk.core.entities` ================================ .. py:module:: quartic_sdk.core.entities Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 asset/index.rst base/index.rst batch/index.rst context_frame/index.rst context_frame_occurrence/index.rst edge_connector/index.rst event_frame/index.rst event_frame_occurrence/index.rst model/index.rst procedure/index.rst procedure_step/index.rst product/index.rst site/index.rst tag/index.rst type_mapping/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: quartic_sdk.core.entities.Asset quartic_sdk.core.entities.Batch quartic_sdk.core.entities.ContextFrame quartic_sdk.core.entities.ContextFrameOccurrence quartic_sdk.core.entities.EdgeConnector quartic_sdk.core.entities.Tag quartic_sdk.core.entities.Model quartic_sdk.core.entities.EventFrame quartic_sdk.core.entities.EventFrameOccurrence quartic_sdk.core.entities.Site quartic_sdk.core.entities.Procedure quartic_sdk.core.entities.Product quartic_sdk.core.entities.ProcedureStep .. class:: Asset(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the asset entity which is created based upon the asset object returned from the API .. attribute:: mapping .. method:: __repr__(self) Override the method to return the asset name .. method:: get_tags(self, query_params={}) The given method returns the list of tags for the given asset :param query_params: Dictionary of filter conditions .. method:: event_frames(self, query_params={}) The given method returns the list of event frames for the given asset :param query_params: Dictionary of filter conditions .. method:: batches(self, query_params={}) The given method returns the list of batches for the given asset :param query_params: Dictionary of filter conditions .. method:: data(self, start_time, stop_time, sampling_ratio=1, return_type=Constants.RETURN_PANDAS, batch_size=Constants.DEFAULT_PAGE_LIMIT_ROWS, transformations=[]) Get the data of all tags in the asset between the given start_time and stop_time for the given sampling_ratio :param start_time: (epoch) Start_time for getting data :param stop_time: (epoch) Stop_time for getting data :param sampling_ratio: sampling_ratio of the data :param return_type: The param decides whether the data after querying will be json(when value is "json") or pandas dataframe(when value is "pd"). By default, it takes the value as "json" :param transformations: Refers to the list of transformations. It supports either interpolation or aggregation, depending upon which, we pass the value of this dictionary. If `transformation_type` is "aggregation", an optional key can be passed called `aggregation_timestamp`, which determines how the timestamp information will be retained after aggregation. Valid options are "first", "last" or "discard". By default, the last timestamp in each group will be retained. An example value here is: [{ "transformation_type": "interpolation", "column": "3", "method": "linear" }, { "transformation_type": "aggregation", "aggregation_column": "4", "aggregation_dict": {"3": "max"}, "aggregation_timestamp": "last", }] :return: (DataIterator) DataIterator object which can be iterated to get the data between the given duration .. method:: __getattribute__(self, name) This method overrides the python's object __getattribute__ method. This is used to map some constant value of an object to some meaningful string constants for better readability :param name: name of the object attribute we want to access for example asset.status :return: Either mapped value or raw value with respect to the object attribute .. class:: Batch(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the batch entity which is created based upon the batch object returned from the API .. method:: __repr__(self) Override the method to return the asset name .. class:: ContextFrame(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the context frame entity which is created based upon the context frame object returned from the API .. method:: __repr__(self) Override the method to return the asset name with id .. method:: occurrences(self, query_params={}) Return the list of occurrences for the given context frame :param query_params: Dictionary of filter conditions .. class:: ContextFrameOccurrence(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the context frame occurrence entity which is created based upon the context frame occurrence object returned from the API .. method:: __repr__(self) Override the method to return the asset name with id .. class:: EdgeConnector Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the data source entity which is created based upon the data source object returned from the API .. attribute:: mapping .. method:: __repr__(self) Override the method to return the data source name .. method:: get_tags(self, query_params={}) The given method returns the list of tags for the given asset :param query_params: Dictionary of filter conditions .. method:: historical_data(self, start_time, stop_time, batch_size=Constants.DEFAULT_BATCH_SIZE, max_records=None, tags=None, return_type=Constants.RETURN_PANDAS) Fetch historical data for the given OPCUA edge connector .. method:: data(self, start_time, stop_time, sampling_ratio=1, return_type=Constants.RETURN_PANDAS, batch_size=Constants.DEFAULT_PAGE_LIMIT_ROWS, transformations=[]) Get the data of all tags in the edge connector between the given start_time and stop_time for the given sampling_ratio :param start_time: (epoch) Start_time for getting data :param stop_time: (epoch) Stop_time for getting data :param sampling_ratio: sampling_ratio of the data :param return_type: The param decides whether the data after querying will be json(when value is "json") or pandas dataframe(when value is "pd"). By default, it takes the value as "json" :param transformations: Refers to the list of transformations. It supports either interpolation or aggregation, depending upon which, we pass the value of this dictionary. If `transformation_type` is "aggregation", an optional key can be passed called `aggregation_timestamp`, which determines how the timestamp information will be retained after aggregation. Valid options are "first", "last" or "discard". By default, the last timestamp in each group will be retained. An example value here is: [{ "transformation_type": "interpolation", "column": "3", "method": "linear" }, { "transformation_type": "aggregation", "aggregation_column": "4", "aggregation_dict": {"3": "max"}, "aggregation_timestamp": "last", }] :return: (DataIterator) DataIterator object which can be iterated to get the data between the given duration .. method:: __getattribute__(self, name) This method overrides the python's object __getattribute__ method. This is used to map some constant value of an object to some meaningful string constants for better readability :param name: name of the object attribute we want to access for example edge_connector.connector_protocol :return: Either mapped value or raw value with respect to the object attribute .. class:: Tag(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the tag entity which is created based upon the tag object returned from the API .. attribute:: mapping .. method:: raise_exception_for_wavelegths(wavelengths) :staticmethod: Validate wavelengths passed for a spectral tag. Schema as following {"wavelengths" : ['1460000.0','1460001.0]} :param wavelengths: dict containing key as 'wavelengths' and value as list of wavelengths .. method:: __repr__(self) Override the method to return the tag name .. method:: data(self, start_time, stop_time, sampling_ratio=1, return_type=Constants.RETURN_PANDAS, batch_size=Constants.DEFAULT_PAGE_LIMIT_ROWS, wavelengths={}, transformations=[]) Get the data for the given tag between the start_time and the stop_time for the given sampling_ratio :param start_time: (epoch) Start_time for getting data :param stop_time: (epoch) Stop_time for getting data :param sampling_ratio: sampling_ratio of the data :param return_type: The param decides whether the data after querying will be json(when value is "json") or pandas dataframe(when value is "pd"). By default, it takes the value as "json" :param wavelengths: dict containing list of wavelengths(string) as value with key "wavelengths" Used for getting data for a spectral tag for specified wavelengths. An example value here is: {"wavelengths:['1460000.0','1460001.0']} :param transformations: Refers to the list of transformations. It supports either interpolation or aggregation, depending upon which, we pass the value of this dictionary. If `transformation_type` is "aggregation", an optional key can be passed called `aggregation_timestamp`, which determines how the timestamp information will be retained after aggregation. Valid options are "first", "last" or "discard". By default, the last timestamp in each group will be retained. An example value here is: [{ "transformation_type": "interpolation", "column": "3", "method": "linear" }, { "transformation_type": "aggregation", "aggregation_column": "4", "aggregation_dict": {"3": "max"}, "aggregation_timestamp": "last", }] :return: (DataIterator) DataIterator object which can be iterated to get the data between the given duration .. method:: wavelengths(self, start_time=None, stop_time=None) This method is used to get the list of wavelengths of a spectral tag within the provided start and stop times. if start, stop times are not provided, by default it will fetch all available wavelengths. :param: start_time(epoch): Optional :param: stop_time(epoch): Optional :return: dict containing list of wavelengths or error message and status from server .. method:: __getattribute__(self, name) This method overrides the python's object __getattribute__ method. This is used to map some constant value of an object to some meaningful string constants for better readability :param name: name of the object attribute we want to access for example tag.tag_type :return: Either mapped value or raw value with respect to the object attribute .. class:: Model(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the Model entity which is created based upon the Model object returned from the API .. method:: __repr__(self) Override the method to return the Model with model name .. method:: model_instance(self, query_params={}) Returns the model object saved in the model :param query_params: Dictionary of filter conditions :return: Returns a Model which is subclass of BaseQuarticModel .. class:: EventFrame(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the event frame entity which is created based upon the event frame object returned from the API .. method:: __repr__(self) Override the method to return the event frame name .. method:: occurrences(self, start_time, stop_time, query_params={}) The given method returns the list of event frame occurrences for the given asset in the given time frame :param start_time: (epoch) Start_time of event frame occurrence :param stop_time: (epoch) Stop_time of event frame occurrence :param query_params: Dictionary of filter conditions .. class:: EventFrameOccurrence(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the event frame occurrence entity which is created based upon the event frame occurrence object returned from the API .. method:: __repr__(self) Override the method to return the event frame occurrence name .. class:: Site(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the site entity which is created based upon the site response returned by the API .. method:: __repr__(self) Override the method to return the site name .. method:: assets(self) :abstractmethod: Get the assets belongs to a site .. method:: edge_connectors(self) :abstractmethod: Get the edge_connectors belongs to a site .. class:: Procedure Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the Procedure entity which is created based upon the procedure response returned by the API .. attribute:: UNIT_PROCEDURE :annotation: = 1 .. method:: __repr__(self) Override the method to return the Procedure name .. method:: fetch_unit_procedures(self, query_params={}) This method is used for fetching all the UnitProcedures belongs to a particular procedure in PH hierarchy :param query_params: Dictionary of filter conditions :return: List of UnitProcedure(ProcedureStep Entity) Objects .. method:: create_unit_procedure(self, name, start_batch_tag, stop_batch_tag, order, start_rule, stop_rule, asset_list) This method is used to create UnitProcedure inside a particular Procedure :param name: UnitProcedure Name :param start_batch_tag: Tag Object :param stop_batch_tag: Tag Object :param order: sequence in which we want to add child nodes inside parent(procedure) node :param start_rule: Rule (Util Class) Object :param stop_rule: Rule (Util Class) Object :param asset_list: List containing asset ids :return: UnitProcedure(ProcedureStep Entity) Object .. class:: Product(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the product entity which is created based upon the product response returned by the API .. method:: __repr__(self) Override the method to return the product name .. method:: get_procedures(self, query_params={}) This method id used for fetching all the procedures belongs to a product :param query_params: Dictionary of filter conditions :return: List of Procedure(Procedure Entity) objects .. method:: create_procedure(self, name, site, start_batch_tag, stop_batch_tag, additional_attributes, start_rule, stop_rule) This method is used for creating procedure of PH hierarchy inside particular product :param name: Procedure Name :param site: Site Object :param start_batch_tag: Tag Object :param stop_batch_tag: Tag Object :param additional_attributes: Additional attributes required to create procedure in the dictionary format and contains fields of Procedure like receipe_type, formula and receipe_version :param start_rule: Rule Class Object :param stop_rule: Rule Class Object :return: Procedure(Procedure Entity) Object .. class:: ProcedureStep(body_json, api_helper) Bases: :class:`quartic_sdk.core.entities.base.Base` The given class refers to the ProcedureStep entity which is created based upon the procedure step response returned by the API .. method:: __repr__(self) Override the method to return the ProcedureStep name .. method:: fetch_substep_details(self, query_params={}) This method is used for fetching procedure substep details like Operation/Phase/PhaseStep :param query_params: Dictionary of filter conditions :return: List of ProcedureStep(ProcedureStep Entity) Objects .. method:: create_procedure_step(self, name, start_batch_tag, stop_batch_tag, procedure, order, start_rule, stop_rule, asset_list) This method is used to create Procedure Step like Operation/Phase/PhaseStep :param name: ProcedureStep Name :param start_batch_tag: Tag Object :param stop_batch_tag: Tag Object :param procedure: Procedure Object :param order: Sequence in which we want to add child nodes inside parent(UnitProcedure/Operation/Phase) node :param start_rule: Rule (Util Class) Object :param stop_rule: Rule (Util Class) Object :param asset_list: List containing asset ids :return: ProcedureStep(ProcedureStep Entity) Object