qcodes/data/format.py
def group_arrays(self, arrays):
        """
        Find the sets of arrays which share all the same setpoint arrays.

        Some Formatters use this grouping to determine which arrays to save
        together in one file.

        Args:
            arrays (Dict[DataArray]): all the arrays in a DataSet

        Returns:
            List[Formatter.ArrayGroup]: namedtuples giving:

            - shape (Tuple[int]): dimensions as in numpy
            - set_arrays (Tuple[DataArray]): the setpoints of this group
            - data (Tuple[DataArray]): measured arrays in this group
            - name (str): a unique name of this group, obtained by joining
              the setpoint array ids.
        """

        set_array_sets = tuple({array.set_arrays
                                   for array in arrays.values()})
        all_set_arrays = set()
        for set_array_set in set_array_sets:
            all_set_arrays.update(set_array_set)

        grouped_data = [[] for _ in set_array_sets]

        for array in arrays.values():
            i = set_array_sets.index(array.set_arrays)
            if array not in all_set_arrays:  # array.set_arrays[-1] != array:
                # don't include the setpoint array itself in the data
                grouped_data[i].append(array)

        out = []
        id_getter = attrgetter('array_id')
        for set_arrays, data in zip(set_array_sets, grouped_data):
            leni = len(set_arrays)
            if not data and any(1 for other_set_arrays in set_array_sets if
                                len(other_set_arrays) > leni and
                                other_set_arrays[:leni] == set_arrays):
                # this is an outer loop that doesn't have any data of its own,
                # so skip it.
                # Inner-loop setpoints with no data is weird (we set values
                # but didn't measure anything there?) but we should keep it.
                continue

            group_name = '_'.join(sai.array_id for sai in set_arrays)
            out.append(self.ArrayGroup(shape=set_arrays[-1].shape,
                                       set_arrays=set_arrays,
                                       data=tuple(sorted(data, key=id_getter)),
                                       name=group_name))
        return out

        Find the sets of arrays which share all the same setpoint arrays.

        Some Formatters use this grouping to determine which arrays to save
        together in one file.

        Args:
            arrays (Dict[DataArray]): all the arrays in a DataSet

        Returns:
            List[Formatter.ArrayGroup]: namedtuples giving:

            - shape (Tuple[int]): dimensions as in numpy
            - set_arrays (Tuple[DataArray]): the setpoints of this group
            - data (Tuple[DataArray]): measured arrays in this group
            - name (str): a unique name of this group, obtained by joining
              the setpoint array ids.
        
Find the sets of arrays which share all the same setpoint arrays.
Some Formatters use this grouping to determine which arrays to save
together in one file.
Find the sets of arrays which share all the same setpoint arrays . Some Formatters use this grouping to determine which arrays to save together in one file .
def group_arrays(self, arrays):
        set_array_sets = tuple({array.set_arrays
                                   for array in arrays.values()})
        all_set_arrays = set()
        for set_array_set in set_array_sets:
            all_set_arrays.update(set_array_set)
        grouped_data = [[] for _ in set_array_sets]
        for array in arrays.values():
            i = set_array_sets.index(array.set_arrays)
            if array not in all_set_arrays:  
                grouped_data[i].append(array)
        out = []
        id_getter = attrgetter('array_id')
        for set_arrays, data in zip(set_array_sets, grouped_data):
            leni = len(set_arrays)
            if not data and any(1 for other_set_arrays in set_array_sets if
                                len(other_set_arrays) > leni and
                                other_set_arrays[:leni] == set_arrays):
                continue
            group_name = '_'.join(sai.array_id for sai in set_arrays)
            out.append(self.ArrayGroup(shape=set_arrays[-1].shape,
                                       set_arrays=set_arrays,
                                       data=tuple(sorted(data, key=id_getter)),
                                       name=group_name))
        return out
def group_arrays ( self , arrays ) : set_array_sets = tuple ( { array . set_arrays for array in arrays . values ( ) } ) all_set_arrays = set ( ) for set_array_set in set_array_sets : all_set_arrays . update ( set_array_set ) grouped_data = [ [ ] for _ in set_array_sets ] for array in arrays . values ( ) : i = set_array_sets . index ( array . set_arrays ) if array not in all_set_arrays : grouped_data [ i ] . append ( array ) out = [ ] id_getter = attrgetter ( 'array_id' ) for set_arrays , data in zip ( set_array_sets , grouped_data ) : leni = len ( set_arrays ) if not data and any ( 1 for other_set_arrays in set_array_sets if len ( other_set_arrays ) > leni and other_set_arrays [ : leni ] == set_arrays ) : continue group_name = '_' . join ( sai . array_id for sai in set_arrays ) out . append ( self . ArrayGroup ( shape = set_arrays [ - 1 ] . shape , set_arrays = set_arrays , data = tuple ( sorted ( data , key = id_getter ) ) , name = group_name ) ) return out
Find the sets of arrays which share all the same setpoint arrays.
Find the sets of arrays which share all the same setpoint arrays .
"""
        Find the sets of arrays which share all the same setpoint arrays.

        Some Formatters use this grouping to determine which arrays to save
        together in one file.

        Args:
            arrays (Dict[DataArray]): all the arrays in a DataSet

        Returns:
            List[Formatter.ArrayGroup]: namedtuples giving:

            - shape (Tuple[int]): dimensions as in numpy
            - set_arrays (Tuple[DataArray]): the setpoints of this group
            - data (Tuple[DataArray]): measured arrays in this group
            - name (str): a unique name of this group, obtained by joining
              the setpoint array ids.
        """ # array.set_arrays[-1] != array: # don't include the setpoint array itself in the data # this is an outer loop that doesn't have any data of its own, # so skip it. # Inner-loop setpoints with no data is weird (we set values # but didn't measure anything there?) but we should keep it.
namedtuples giving:
shape (Tuple[int]): dimensions as in numpy
set_arrays (Tuple[DataArray]): the setpoints of this group
data (Tuple[DataArray]): measured arrays in this group
name (str): a unique name of this group, obtained by joining
the setpoint array ids.
namedtuples giving : shape ( Tuple [ int ] ) : dimensions as in numpy set_arrays ( Tuple [ DataArray ] ) : the setpoints of this group data ( Tuple [ DataArray ] ) : measured arrays in this group name ( str ) : a unique name of this group obtained by joining the setpoint array ids .
List[Formatter.ArrayGroup]
self
arrays
all the arrays in a DataSet
all the arrays in a DataSet