Exemplo n.º 1
0
 def _onEditParsAction(self):
     row = self.ui.curvesTable.currentIndex().row()
     if row >= 0:
         c = self.model.curves[row]
         params = [p for p in (c.curveparam, c.axesparam,
                               c.taurusparam) if p is not None]
         if params:
             from guidata.dataset.datatypes import DataSetGroup
             group = DataSetGroup(
                 params, "Parameters for curve %s" % c.curveparam.label)
             group.edit()
             c.x.processSrc(c.taurusparam.xModel)
             c.y.processSrc(c.taurusparam.yModel)
             self.dataChanged.emit(self.model.index(
                 row, 0), self.model.index(row, self.model.rowCount()))
Exemplo n.º 2
0
 def _onEditParsAction(self):
     row = self.ui.curvesTable.currentIndex().row()
     if row >= 0:
         c = self.model.curves[row]
         params = [p for p in (c.curveparam, c.axesparam,
                               c.taurusparam) if p is not None]
         if params:
             from guidata.dataset.datatypes import DataSetGroup
             group = DataSetGroup(
                 params, "Parameters for curve %s" % c.curveparam.label)
             group.edit()
             c.x.processSrc(c.taurusparam.xModel)
             c.y.processSrc(c.taurusparam.yModel)
             self.dataChanged.emit(
                     self.model.index(row, 0),
                     self.model.index(row, self.model.rowCount() - 1)
             )
Exemplo n.º 3
0
def gui_config(remove_prefixes=['_']):
    shell = get_core_plugin().shell
    datasets = []
    all_items = {}
    for configurable in sorted(shell.configurables,
                               key=lambda c: c.__class__.__name__):
        items = {}

        conf_name = configurable.__class__.__name__
        for name, trait in configurable.traits().items():
            skip = False
            for prefix in remove_prefixes:
                if name.startswith(prefix):
                    skip = True
                    break

            if not skip:
                mapped = map_trait(configurable, name, trait)
                if mapped is not None:
                    item_key = '%s.%s' % (conf_name, name)
                    items[item_key] = mapped
                    all_items[item_key] = mapped

        if items:
            ds_class = type(conf_name, (dt.DataSet,), items)
            datasets.append(ds_class())

    app = guidata.qapplication()  # <-- this already checks if one exists
    group = DataSetGroup(datasets, title='ECLI Configuration')
    group.edit()

    #for ds in datasets:
    #    print('------------- %s ---------------' % (ds.__class__.__name__, ))
    #    print(ds)
    #    print()
    #    print()
    for key, item in all_items.items():
        print(key, item)

    #return datasets
    return all_items
Exemplo n.º 4
0
#
# Copyright © 2009-2010 CEA
# Pierre Raybaut
# Licensed under the terms of the CECILL License
# (see guidata/__init__.py for details)
"""
DataSetGroup demo

DataSet objects may be grouped into DataSetGroup, allowing them to be edited
in a single dialog box (with one tab per DataSet object).
"""

from __future__ import print_function

SHOW = True  # Show test in GUI-based test launcher

from guidata.tests.all_features import TestParameters
from guidata.dataset.datatypes import DataSetGroup

if __name__ == "__main__":
    # Create QApplication
    import guidata
    _app = guidata.qapplication()

    e1 = TestParameters("DataSet #1")
    e2 = TestParameters("DataSet #2")
    g = DataSetGroup([e1, e2], title='Parameters group')
    g.edit()
    print(e1)
    g.edit()
Exemplo n.º 5
0
# Copyright © 2009-2010 CEA
# Pierre Raybaut
# Licensed under the terms of the CECILL License
# (see guidata/__init__.py for details)

"""
DataSetGroup demo

DataSet objects may be grouped into DataSetGroup, allowing them to be edited
in a single dialog box (with one tab per DataSet object).
"""

from __future__ import print_function

SHOW = True # Show test in GUI-based test launcher

from guidata.tests.all_features import TestParameters
from guidata.dataset.datatypes import DataSetGroup

if __name__ == "__main__":
    # Create QApplication
    import guidata
    _app = guidata.qapplication()

    e1 = TestParameters("DataSet #1")
    e2 = TestParameters("DataSet #2")
    g = DataSetGroup( [e1, e2], title='Parameters group' )
    g.edit()
    print(e1)
    g.edit()
Exemplo n.º 6
0
class RunWorkflows(DataSet):
    """
    My Home analysis
    *tab1 includes stock market analysis, identifier is name of stock, check out metadata.

    """


if __name__ == "__main__":
    # prepare the gui app
    import guidata

    _app = guidata.qapplication()
    # e = RunWorkflows()
    e1 = first_tab("Stock Market")
    e = DataSetGroup([e1], title='Home Analysis')
    # show the gui and proceed further if the user presses OK.
    if e.edit():
        # file with session to analyze
        experiments_to_analyze = e1.experiments_to_analyze
        if e1.sleep_hours:
            print("Sleeping for %s hours" % str(e1.sleep_hours))
            stime = e1.sleep_hours * 60 * 60
            sleep(stime)

        # import all the stuff we need from freely moving
        import logging
        from StockMarket_analysis.data_upload.workflow import workflow

        # let's log options introduced by the user
        curlogger = logging.getLogger()