How to use the omas.omas_uda.pyuda.Client function in omas

To help you get started, we’ve selected a few omas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gafusion / omas / omas / omas_uda.py View on Github external
:param verbose: print loading progress

    :return: OMAS data set
    '''

    if pulse is None or run is None:
        raise Exception('`pulse` and `run` must be specified')

    if server is not None:
        pyuda.Client.server = server
    elif not os.environ['UDA_HOST']:
        raise pyuda.UDAException('Must set UDA_HOST environmental variable')

    if port is not None:
        pyuda.Client.port = port
    elif not os.environ['UDA_PORT']:
        raise pyuda.UDAException('Must set UDA_PORT environmental variable')

    # set this to get pyuda metadata (maybe of interest for future use):
    # pyuda.Client.set_property(pyuda.Properties.PROP_META, True)

    client = pyuda.Client()

    # if paths is None then figure out what IDS are available and get ready to retrieve everything
    if paths is None:
        requested_paths = [[structure] for structure in list_structures(imas_version=imas_version)]
    else:
        requested_paths = map(p2l, paths)

    available_ds = []
    for ds in numpy.unique([p[0] for p in requested_paths]):
github gafusion / omas / omas / omas_uda.py View on Github external
raise Exception('`pulse` and `run` must be specified')

    if server is not None:
        pyuda.Client.server = server
    elif not os.environ['UDA_HOST']:
        raise pyuda.UDAException('Must set UDA_HOST environmental variable')

    if port is not None:
        pyuda.Client.port = port
    elif not os.environ['UDA_PORT']:
        raise pyuda.UDAException('Must set UDA_PORT environmental variable')

    # set this to get pyuda metadata (maybe of interest for future use):
    # pyuda.Client.set_property(pyuda.Properties.PROP_META, True)

    client = pyuda.Client()

    # if paths is None then figure out what IDS are available and get ready to retrieve everything
    if paths is None:
        requested_paths = [[structure] for structure in list_structures(imas_version=imas_version)]
    else:
        requested_paths = map(p2l, paths)

    available_ds = []
    for ds in numpy.unique([p[0] for p in requested_paths]):

        if uda_get(client, [ds, 'ids_properties', 'homogeneous_time'], pulse, run) is None:
            if verbose:
                print('- ', ds)
            continue
        if verbose:
            print('* ', ds)
github gafusion / omas / omas / omas_uda.py View on Github external
:param paths: list of paths to load from IMAS

    :param imas_version: IMAS version

    :param skip_uncertainties: do not load uncertain data

    :param verbose: print loading progress

    :return: OMAS data set
    '''

    if pulse is None or run is None:
        raise Exception('`pulse` and `run` must be specified')

    if server is not None:
        pyuda.Client.server = server
    elif not os.environ['UDA_HOST']:
        raise pyuda.UDAException('Must set UDA_HOST environmental variable')

    if port is not None:
        pyuda.Client.port = port
    elif not os.environ['UDA_PORT']:
        raise pyuda.UDAException('Must set UDA_PORT environmental variable')

    # set this to get pyuda metadata (maybe of interest for future use):
    # pyuda.Client.set_property(pyuda.Properties.PROP_META, True)

    client = pyuda.Client()

    # if paths is None then figure out what IDS are available and get ready to retrieve everything
    if paths is None:
        requested_paths = [[structure] for structure in list_structures(imas_version=imas_version)]