diff --git a/cdfm/consts.py b/cdfm/consts.py index 40a96af..cb81d2d 100644 --- a/cdfm/consts.py +++ b/cdfm/consts.py @@ -1 +1,9 @@ # -*- coding: utf-8 -*- +"""Constants +""" +LABEL = 'label' +QID = 'qid' +EID = 'eid' +CIDS = 'cids' +FEATURES = 'features' +PROXIMITIES = 'proximities' diff --git a/cdfm/data.py b/cdfm/data.py new file mode 100644 index 0000000..ad52cc1 --- /dev/null +++ b/cdfm/data.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +"""Definition of records in dataset. +""" +from collections import namedtuple +from .consts import LABEL, QID, EID, CIDS, FEATURES, PROXIMITIES + + +Row = namedtuple('Row', (LABEL, QID, EID, CIDS, FEATURES, PROXIMITIES)) diff --git a/cdfm/types.py b/cdfm/types.py index a04f0d2..1c52538 100644 --- a/cdfm/types.py +++ b/cdfm/types.py @@ -1,8 +1,10 @@ # -*- coding: utf-8 -*- """Type annotations. """ -from typing import Dict, Union +from typing import Dict, List, Union +from .data import Row +Dataset = List[Row] EntityID = Union[int, str] EntIndMap = Dict[EntityID, int]