Ejemplo n.º 1
0
 def _get_accumulator(self, field) -> Optional[Accumulator]:
     if field == 'document_id':
         return None
     elif field == 'assay_type':
         return FrequencySetAccumulator(max_size=100)
     else:
         return SetAccumulator()
Ejemplo n.º 2
0
 def _get_accumulator(self, field) -> Optional[Accumulator]:
     if field == 'document_id':
         return None
     elif field == 'file':
         return SetOfDictAccumulator(max_size=100, key=itemgetter('uuid'))
     else:
         return SetAccumulator()
Ejemplo n.º 3
0
 def _get_accumulator(self, field) -> Optional[Accumulator]:
     if field == 'document_id':
         return ListAccumulator(max_size=100)
     elif field in ('project_description', 'contact_names', 'contributors',
                    'publication_titles', 'publications'):
         return None
     else:
         return SetAccumulator(max_size=100)
Ejemplo n.º 4
0
 def _get_accumulator(self, field) -> Optional[Accumulator]:
     if field == 'file_format':
         return SingleValueAccumulator()
     elif field == 'content_description':
         return SetAccumulator(max_size=100)
     elif field in ('size', 'count'):
         return DistinctAccumulator(SumAccumulator(0))
     else:
         return None
Ejemplo n.º 5
0
 def _get_accumulator(self, field) -> Optional[Accumulator]:
     if field in ('content_description', 'file_format', 'is_intermediate'):
         return SingleValueAccumulator()
     elif field == 'file_source':
         return SetAccumulator(max_size=100)
     elif field in ('size', 'count', 'matrix_cell_count'):
         return DistinctAccumulator(SumAccumulator())
     else:
         return super()._get_accumulator(field)
Ejemplo n.º 6
0
 def _get_accumulator(self, field) -> Optional[Accumulator]:
     if field == 'organism_age_range':
         return SetOfDictAccumulator(
             max_size=100,
             key=compose_keys(none_safe_tuple_key(none_last=True),
                              itemgetter('lte', 'gte')))
     elif field == 'organism_age':
         return SetOfDictAccumulator(
             max_size=100,
             key=compose_keys(none_safe_tuple_key(none_last=True),
                              none_safe_itemgetter('value', 'unit')))
     elif field == 'donor_count':
         return UniqueValueCountAccumulator()
     else:
         return SetAccumulator(max_size=100)
Ejemplo n.º 7
0
 def _get_accumulator(self, field) -> Optional[Accumulator]:
     return SetAccumulator(max_size=100)
Ejemplo n.º 8
0
 def _get_accumulator(self, field) -> Optional[Accumulator]:
     if field == 'total_estimated_cells':
         return DistinctAccumulator(SumAccumulator(0))
     else:
         return SetAccumulator(max_size=100)
Ejemplo n.º 9
0
 def _get_default_accumulator(self) -> Optional[Accumulator]:
     return SetAccumulator(max_size=10)