quartic_sdk.core.entities

Submodules

Package Contents

Classes

Asset

The given class refers to the asset entity which is created based upon the

Batch

The given class refers to the batch entity which is created based upon the batch

ContextFrame

The given class refers to the context frame entity which is created based

ContextFrameOccurrence

The given class refers to the context frame occurrence entity which is created

EdgeConnector

The given class refers to the data source entity which is created based upon the

Tag

The given class refers to the tag entity which is created based upon the

Model

The given class refers to the Model entity which is created based upon the

EventFrame

The given class refers to the event frame entity which is created based upon the

EventFrameOccurrence

The given class refers to the event frame occurrence entity which is created based upon the

Site

The given class refers to the site entity which is created based upon the site response

Procedure

The given class refers to the Procedure entity which is created based upon the procedure response

Product

The given class refers to the product entity which is created based upon the product response

ProcedureStep

The given class refers to the ProcedureStep entity which is created based upon the

class quartic_sdk.core.entities.Asset(body_json, api_helper)

Bases: 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

mapping
__repr__(self)

Override the method to return the asset name

get_tags(self, query_params={})

The given method returns the list of tags for the given asset :param query_params: Dictionary of filter conditions

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

batches(self, query_params={})

The given method returns the list of batches for the given asset :param query_params: Dictionary of filter conditions

data(self, start_time, stop_time, interval_min=1, aggregation_type='last', wide_df=True, return_type=Constants.RETURN_PANDAS, transformations=[])

Get the data of all tags in the asset between the given start_time and stop_time for the given interval duration :param start_time: (epoch) Start_time for getting data :param stop_time: (epoch) Stop_time for getting data :param interval_min: (int) The interval duration in minutes for downsampling the data :param aggregation_type: (str) The aggregation function to be used for the query. (Valid values: first, last) :param wide_df: (bool) If the response is needed in wide or long format. Defaults to True. :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”

Parameters

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”,

}]

Returns

(DataIterator) DataIterator object which can be iterated to get the data between the given duration

__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 quartic_sdk.core.entities.Batch

Bases: 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

__repr__(self)

Override the method to return the asset name

class quartic_sdk.core.entities.ContextFrame

Bases: 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

__repr__(self)

Override the method to return the asset name with id

occurrences(self, query_params={})

Return the list of occurrences for the given context frame :param query_params: Dictionary of filter conditions

class quartic_sdk.core.entities.ContextFrameOccurrence(body_json, api_helper)

Bases: 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

__repr__(self)

Override the method to return the asset name with id

class quartic_sdk.core.entities.EdgeConnector

Bases: 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

mapping
__repr__(self)

Override the method to return the data source name

get_tags(self, query_params={})

The given method returns the list of tags for the given asset :param query_params: Dictionary of filter conditions

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

data(self, start_time, stop_time, interval_min=1, aggregation_type='last', wide_df=True, return_type=Constants.RETURN_PANDAS, transformations=[])

Get the data of all tags in the edge connector between the given start_time and stop_time for the given interval duration :param start_time: (epoch) Start_time for getting data :param stop_time: (epoch) Stop_time for getting data :param interval_min: (int) The interval duration in minutes for downsampling the data :param aggregation_type: (str) The aggregation function to be used for the query. (Valid values: first, last) :param wide_df: (bool) If the response is needed in wide or long format. Defaults to True. :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”

Parameters

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”,

}]

Returns

(DataIterator) DataIterator object which can be iterated to get the data between the given duration

__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 quartic_sdk.core.entities.Tag

Bases: 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

mapping
static raise_exception_for_wavelegths(wavelengths)

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

__repr__(self)

Override the method to return the tag name

data(self, start_time, stop_time, interval_min=1, aggregation_type='last', wide_df=True, return_type=Constants.RETURN_PANDAS, wavelengths=[], transformations=[])

Get the data for the given tag between the start_time and the stop_time for the given interval duration :param start_time: (epoch) Start_time for getting data :param stop_time: (epoch) Stop_time for getting data :param interval_min: (int) The interval duration in minutes for downsampling the data :param aggregation_type: (str) The aggregation function to be used for the query. (Valid values: first, last) :param wide_df: (bool) If the response is needed in wide or long format. Defaults to True. :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”

Parameters
  • 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’]}

  • 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”,

    }]

Returns

(DataIterator) DataIterator object which can be iterated to get the data between the given duration

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

__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 quartic_sdk.core.entities.Model(body_json, api_helper)

Bases: 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

__repr__(self)

Override the method to return the Model with model name

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 quartic_sdk.core.entities.EventFrame(body_json, api_helper)

Bases: 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

__repr__(self)

Override the method to return the event frame name

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 quartic_sdk.core.entities.EventFrameOccurrence(body_json, api_helper)

Bases: 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

__repr__(self)

Override the method to return the event frame occurrence name

class quartic_sdk.core.entities.Site(body_json, api_helper)

Bases: 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

__repr__(self)

Override the method to return the site name

abstract assets(self)

Get the assets belongs to a site

abstract edge_connectors(self)

Get the edge_connectors belongs to a site

class quartic_sdk.core.entities.Procedure(body_json, api_helper)

Bases: 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

UNIT_PROCEDURE = 1
__repr__(self)

Override the method to return the Procedure name

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

class quartic_sdk.core.entities.Product

Bases: 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

__repr__(self)

Override the method to return the product name

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

class quartic_sdk.core.entities.ProcedureStep(body_json, api_helper)

Bases: 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

__repr__(self)

Override the method to return the ProcedureStep name

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