Esempio n. 1
0
class FileTypeSummary(AzulJsonObject):
    format = StringProperty()
    fileSource = ListProperty()  # List could have string(s) and/or None
    count = IntegerProperty()
    totalSize = FloatProperty()
    matrixCellCount = FloatProperty()
    isIntermediate = BooleanProperty()
    contentDescription = ListProperty(
    )  # List could have string(s) and/or None

    @classmethod
    def for_bucket(cls, bucket: JSON) -> 'FileTypeSummary':
        self = cls()
        self.count = bucket['doc_count']
        self.totalSize = bucket['size_by_type']['value']
        self.matrixCellCount = bucket['matrix_cell_count_by_type']['value']
        self.format = bucket['key']
        return self

    @classmethod
    def for_aggregate(cls, aggregate_file: JSON) -> 'FileTypeSummary':
        self = cls()
        self.count = aggregate_file['count']
        self.fileSource = aggregate_file['file_source']
        self.totalSize = aggregate_file['size']
        self.matrixCellCount = aggregate_file['matrix_cell_count']
        self.format = aggregate_file['file_format']
        self.isIntermediate = aggregate_file['is_intermediate']
        self.contentDescription = aggregate_file['content_description']
        assert isinstance(self.format, str), type(str)
        assert self.format
        return self
Esempio n. 2
0
class FileIdAutoCompleteEntry(JsonObject):
    _id = StringProperty(name='id')
    dataType = StringProperty()
    donorId = ListProperty(StringProperty)
    fileBundleId = StringProperty()
    fileName = ListProperty(StringProperty)
    projectCode = ListProperty(StringProperty)
    _type = StringProperty(name='type', default='file')
Esempio n. 3
0
class SummaryRepresentation(JsonObject):
    projectCount = IntegerProperty()
    specimenCount = IntegerProperty()
    speciesCount = IntegerProperty()
    fileCount = IntegerProperty()
    totalFileSize = FloatProperty()
    donorCount = IntegerProperty()
    labCount = IntegerProperty()
    totalCellCount = FloatProperty()
    organTypes = ListProperty(StringProperty(required=False))
    fileTypeSummaries = ListProperty(FileTypeSummary)
    cellCountSummaries = ListProperty(OrganCellCountSummary)
Esempio n. 4
0
class ResumableIteratorState(JsonObject):
    doc_type = "ResumableIteratorState"
    _id = StringProperty()
    name = StringProperty()
    timestamp = DateTimeProperty()
    args = ListProperty()
    kwargs = DictProperty()
    retry = DictProperty()
    progress = DictProperty()
    complete = BooleanProperty(default=False)
Esempio n. 5
0
class ResumableIteratorState(JsonObject):
    doc_type = "ResumableIteratorState"
    _id = StringProperty()
    name = StringProperty()
    timestamp = DateTimeProperty()
    args = ListProperty()
    kwargs = DictProperty()
    progress = DictProperty()

    def is_resume(self):
        return bool(getattr(self, '_rev', None))
Esempio n. 6
0
class OrganCellCountSummary(JsonObject):
    organType = ListProperty(
    )  # List could have strings and/or None (eg. ['Brain', 'Skin', None])
    countOfDocsWithOrganType = IntegerProperty()
    totalCellCountByOrgan = FloatProperty()

    @classmethod
    def for_bucket(cls, bucket: JSON) -> 'OrganCellCountSummary':
        self = cls()
        self.organType = [bucket['key']]
        self.countOfDocsWithOrganType = bucket['doc_count']
        self.totalCellCountByOrgan = bucket['cell_count']['value']
        return self
Esempio n. 7
0
class ConcatenateStrings(JsonObject):
    type = TypeProperty('concatenate_strings')
    expressions = ListProperty(required=True)
    separator = StringProperty(required=True)

    def configure(self, expressions):
        self._expression_fns = expressions

    def __call__(self, item, context=None):
        return self.separator.join([
            six.text_type(expression(item, context))
            for expression in self._expression_fns
            if expression(item, context)
        ])
Esempio n. 8
0
class FacetObj(JsonObject):
    terms = ListProperty(AbstractTermObj)
    total = IntegerProperty()
    _type = StringProperty(name='type')
Esempio n. 9
0
class AutoCompleteRepresentation(JsonObject):
    hits = ListProperty()
    pagination = ObjectProperty(PaginationObj,
                                exclude_if_none=True,
                                default=None)
Esempio n. 10
0
class ApiResponse(JsonObject):
    hits = ListProperty(HitEntry)
    pagination = ObjectProperty(PaginationObj,
                                exclude_if_none=True,
                                default=None)