omfit-toksearch 2020.12.2.22.59
omfit_toksearch
Requires Python: >=3.6

**TOKSEARCH** files used as part of the OMFIT project: https://omfit.io/

Provides:
=========
* OMFITtoksearch
* TKS_MdsSignal
* TKS_PtDataSignal
* TKS_Aligner
* TKS_OMFITLoader

Requires:
=========
* numpy>=1.12
* psutil>=5.4
* scipy>=1.0
* uncertainties>=3
* omfit_commonclasses==2020.12.2.22.59

Authors:
=========
https://omfit.io/contributors.html

Documentation:
==============
OMFITtoksearch
--------------

        This class is used to query from database through tokesearch API

        :param serverPicker: (string)A string designating the server to create the toksearch query on.

        :param shots: A list of shot numbers (ints) to be fetched

        :param signals: A dict where each key corresponds to the signal name returned by toksearch, and each entry is a list
            which corresponds to a signal object fetched by toksearch. The first element of the list is the string
            corresponding to each signal name, i.e. 'PtDataSignal', the 2nd and 3rd entries are the args (list), and keyword
            args (dict) respectively. Ex) ['PtDataSignal',['ip'],{}] corresponds to a fetch for
            PtData 'ip' signal.

        :param datasets: A dict representing xarray datasets to be created from fetched signals.

        :param aligners: A dict where the keys are name of the dataset to align and the entries are a corresponding list of Aligners

        :param functions: A list of functions or executable strings to be executed in the toksearch mapping stage

        :param where: (string) An evaluatable string (executed in namespace of record) which should return a boolean when
            the record should be returned by toksearch query. This shall be used when trying to filter out shots by certain
            criteria. i.e. return False when you wish to filter out a shot, when string evaluates to True.

        :param keep: A list of strings pertaining to which attributes (signal,dataset etc.) of each record to be
            returned by toksearch query default: returns all attrs in namespace record

        :param compute_type: (string) Type of method to be used to run the pipeline. Options: 'serial','spark','ray'
                                      compute_type='ray' gives better memory usage and parallelization

        :param return_data: (string) A string pertaining on how the data fetched by toksearch should be structured.
            Options: 'by_shot','by_signal'. 'by_shot' will return a dictionary with shots as keys, with each record namespace
            stored in each entry. 'by_signal' will return a dictionary organized with the union of all record attrs as keys,
            and a dictionary organized by shot numbers under it. default: 'by_shot'
            NOTE: When fetching 'by_signal' Datasets will concatinated together over all valid shots.

        :param warn: (bool) If flag is true, the user will be warned if they are about to pull back more than 50% of their available memory and can respond accordingly. This is a safety precaution when pulling back large datasets that may cause you to run out of memory. (default: True).

        :param use_dask: (bool) If flag is True then created datasets will be loaded using dask. Loading with dasks reduces the amount of
            RAM used by saving the data to disk and only loading into memory by chunks. (default: False)

        :param load_data: (bool) If this flag is False, then data will be transferred to disk under OMFIT current working directory, but the data will not be loaded into memory (RAM) and thus the OMFITtree will not be updated. This is to be used when fetching data too large to fit into memory. (default True).

        :param **compute_kwargs: keyword arguments to be passed into the toksearch compute functions
    

TKS_MdsSignal
-------------
N/A

TKS_PtDataSignal
----------------
N/A

TKS_Aligner
-----------

    Function that takes in a signal name, and keyword arguments and puts them in correct format that the toksearch query method expects.
    The signal specified is the one that the dataset is intended to be aligned with.

    :param align_with: A string respresenting the name of the signal name in 'signals' that the dataset is to be aligned with respect to.
    

TKS_OMFITLoader
---------------
N/A