Metaclass¶
This part of the framework contains the backbone of the computation and plot part. There have been implemented metaclass of referement for the plot and computation class implementation tailored for your own case.
Important
Both classes take as input, when instantiated, data coming from a private_config.json, if the config file is missing then you can feed this information manually
- class CAF.MetaClass.ComputationClass[source]¶
This metaclass contains the backbone of the computation class . It is composed by 3 different elements:
init : the constructor function through we collect credential to log on database and IBMQ system
run : function designated to gather parameters for each run, then run calculation (on local or remote) and then save the results in the ‘final_json’ class attribute – To implement your class –
save : function designated to save results on database
NB: Instantiating the class will not require any argoument because an automatic feeding has been implemented using a decorator.
- class CAF.MetaClass.PlotClass[source]¶
This metaclass is designed to collect all the routines to query and show results. In this metaclass are provided the basic functions to instantiate the connection with database and query on it. The contructor function will retrieve the db credential and the db name. THe db_name has to be manually feeded by the user, in order to connect with the correct data source.
- query(selector_dict: dict, field_list: list)[source]¶
Query
This function is designet to automatically query on db data just providing a selector and a field list.
- Parameters
selector_dict (dict) – dictionary containing db query following the cloudant standard
field_list (list) – list of field to retrieve for the queried elements