コード例 #1
0
ファイル: bounded_time.py プロジェクト: 5n1p/enaml
    def on_action_time_changed(self, content):
        """ The handler for the 'time_changed' action sent from the
        client widget.

        """
        time = parse_iso_dt(content['time']).time()
        self.set_guarded(time=time)
コード例 #2
0
    def on_action_datetime_changed(self, content):
        """ The handler for the 'datetime_changed' action sent from the
        client widget.

        """
        datetime = parse_iso_dt(content['datetime'])
        self.set_guarded(datetime=datetime)
コード例 #3
0
ファイル: bounded_time.py プロジェクト: xiaowenlong100/enaml
    def on_action_time_changed(self, content):
        """ The handler for the 'time_changed' action sent from the
        client widget.

        """
        time = parse_iso_dt(content['time']).time()
        self.set_guarded(time=time)
コード例 #4
0
ファイル: bounded_datetime.py プロジェクト: vahndi/enaml
    def on_action_datetime_changed(self, content):
        """ The handler for the 'datetime_changed' action sent from the
        client widget.

        """
        datetime = parse_iso_dt(content["datetime"])
        self.set_guarded(datetime=datetime)
コード例 #5
0
ファイル: pandas.py プロジェクト: meadowsresearch/scythe
def df_checks_from_task_data(data: dict) -> DataFrame:
    """Create a dataframe with attention checks from an MA task

    Args:
        data (dict): data for one task such as loaded from json

    Returns:
        DataFrame: Each row is one check
    """
    rows = []
    for t, trial in enumerate(data['trials']):
        for annotation in trial['annotations']:
            row = dict(
                trial=t,
                stim1_id=annotation['ids'][0],
                stim2_id=annotation['ids'][1],
                label=annotation['label'],
                start=parse_iso_dt(annotation['start']),
                resp=parse_iso_dt(annotation['resp']),
            )
            if len(annotation['ids']) > 2:
                row['stim3_id'] = annotation['ids'][3]
            rows.append(row)
    return DataFrame(rows)
コード例 #6
0
ファイル: bounded_date.py プロジェクト: xiaowenlong100/enaml
    def on_action_date_changed(self, content):
        """ Handle the 'date_changed' action from the UI control.

        """
        date = parse_iso_dt(content['date']).date()
        self.set_guarded(date=date)
コード例 #7
0
ファイル: bounded_date.py プロジェクト: vahndi/enaml
    def on_action_date_changed(self, content):
        """ Handle the 'date_changed' action from the UI control.

        """
        date = parse_iso_dt(content["date"]).date()
        self.set_guarded(date=date)