Skip to content

Commit

Permalink
close #4
Browse files Browse the repository at this point in the history
add data class
  • Loading branch information
moriaki3193 committed Jan 26, 2019
1 parent e7a25da commit e1c2a58
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cdfm/consts.py
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# -*- coding: utf-8 -*-
"""Constants
"""
LABEL = 'label'
QID = 'qid'
EID = 'eid'
CIDS = 'cids'
FEATURES = 'features'
PROXIMITIES = 'proximities'
8 changes: 8 additions & 0 deletions cdfm/data.py
Original file line number Diff line number Diff line change
@@ -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))
4 changes: 3 additions & 1 deletion cdfm/types.py
Original file line number Diff line number Diff line change
@@ -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]

0 comments on commit e1c2a58

Please sign in to comment.