Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/schema/components/hdf5.py: 100%

30 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-11-14 02:13 +0000

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3from marshmallow import Schema, fields 

4 

5import logging 

6 

7logger = logging.getLogger(__name__) 

8 

9 

10class Hdf5GroupSchema(Schema): 

11 children = fields.Dict(values=fields.Nested(lambda: Hdf5Schema())) 

12 name = fields.Str() 

13 uri = fields.Str() 

14 attrs = fields.Dict() 

15 

16 

17class Hdf5DatasetSchema(Hdf5GroupSchema): 

18 type = fields.Str() 

19 data = fields.Dict() 

20 shape = fields.List(fields.Int()) 

21 size = fields.Int() 

22 ndim = fields.Int() 

23 dtype = fields.Str() 

24 

25 

26class Hdf5Schema(Schema): 

27 children = fields.Dict(values=fields.Nested(lambda: Hdf5Schema())) 

28 name = fields.Str() 

29 uri = fields.Str() 

30 attrs = fields.Dict() 

31 type = fields.Str() 

32 data = fields.Dict() 

33 shape = fields.List(fields.Int()) 

34 size = fields.Int() 

35 ndim = fields.Int() 

36 dtype = fields.Str() 

37 

38 

39class RootHdf5Schema(Hdf5Schema): 

40 file = fields.Str() 

41 

42 class Meta: 

43 exclude = ("name", "uri", "type")