Safemotion Lib
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
formatting.CollectKeys Class Reference
Inheritance diagram for formatting.CollectKeys:

Public Member Functions

 __init__ (self, collect_keys)
 
 __call__ (self, sample)
 

Public Attributes

 collect_keys
 

Detailed Description

데이터에서 원하는 데이터만 수집하기위한 클래스
args:
    collect_keys (list[str]): 수집을 원하는 데이터의 키

Definition at line 84 of file formatting.py.

Constructor & Destructor Documentation

◆ __init__()

formatting.CollectKeys.__init__ ( self,
collect_keys )

Definition at line 90 of file formatting.py.

90 def __init__(self, collect_keys):
91 self.collect_keys = collect_keys
92

Member Function Documentation

◆ __call__()

formatting.CollectKeys.__call__ ( self,
sample )

Definition at line 93 of file formatting.py.

93 def __call__(self, sample):
94
95 #예외처리, 입력데이터에 설정된 키가 없으면 종료
96 for key in collect_keys:
97 assert key in sample, \
98 f'CollectKeys : not found key in sample : {key}'
99
100 #데이터 수집
101 pack_data = {}
102 for key in collect_keys:
103 pack_data[key] = sample[key]
104
105 return pack_data
106
107

Member Data Documentation

◆ collect_keys

formatting.CollectKeys.collect_keys

Definition at line 91 of file formatting.py.


The documentation for this class was generated from the following file: