-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategorization_attributes.py
97 lines (72 loc) · 1.84 KB
/
categorization_attributes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
"""
Defines the attributes that are used for categorizing activity
profiles.
"""
from enum import StrEnum
class Country(str):
"""
Specifies the home country of a person
"""
@staticmethod
def title() -> str:
return "country"
class WorkStatus(StrEnum):
"""
Specifies the working status of a person
"""
full_time = "full time"
part_time = "part time"
unemployed = "unemployed"
retired = "retired"
student = "student"
undetermined = "undetermined"
work_full_or_part = "full or part time"
unemployed_or_retired = "unemployed or retired"
@staticmethod
def title() -> str:
return "work status"
def is_determined(self) -> bool:
return not (
self == WorkStatus.undetermined
or self == WorkStatus.work_full_or_part
or self == WorkStatus.unemployed_or_retired
)
class Sex(StrEnum):
"""
Specifies the sex of a person
"""
male = "male"
female = "female"
@staticmethod
def title() -> str:
return "sex"
class DayType(StrEnum):
"""
Specifies the day type of a diary entry
"""
work = "working day"
no_work = "rest day"
undetermined = "undetermined"
@staticmethod
def title() -> str:
return "day type"
class Person(str):
"""
Specifies the name or other identifier of a person
"""
@staticmethod
def title() -> str:
return "person"
def get_default_categorization_attributes() -> list[str]:
"""
Returns the categorization attributes for a full
categorization (country, sex, work status, day type)
:return: the categorization attributes
"""
categorization_attributes = [
Country.title(),
Sex.title(),
WorkStatus.title(),
DayType.title(),
]
return categorization_attributes