trismik 0.9.0__py3-none-any.whl → 0.9.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
trismik/types.py CHANGED
@@ -1,133 +1,163 @@
1
- from dataclasses import dataclass
2
- from datetime import datetime
3
- from typing import List, Any
4
-
5
-
6
- @dataclass
7
- class TrismikAuth:
8
- """
9
- Authentication token.
10
-
11
- Attributes:
12
- token (str): Authentication token value.
13
- expires (datetime): Expiration date.
14
- """
15
- token: str
16
- expires: datetime
17
-
18
-
19
- @dataclass
20
- class TrismikTest:
21
- """
22
- Available test.
23
-
24
- Attributes:
25
- id (str): Test ID.
26
- name (str): Test name.
27
- """
28
- id: str
29
- name: str
30
-
31
-
32
- @dataclass
33
- class TrismikSession:
34
- """
35
- Test session.
36
-
37
- Attributes:
38
- id (str): Session ID.
39
- url (str): Session URL.
40
- status (str): Session status
41
- """
42
- id: str
43
- url: str
44
- status: str
45
-
46
-
47
- @dataclass
48
- class TrismikItem:
49
- """
50
- Base class for test items.
51
-
52
- Attributes:
53
- id (str): Item ID.
54
- """
55
- id: str
56
-
57
-
58
- @dataclass
59
- class TrismikChoice:
60
- """
61
- Base class for choices in items that use them.
62
-
63
- Attributes:
64
- id (str): Choice ID.
65
- """
66
- id: str
67
-
68
-
69
- @dataclass
70
- class TrismikTextChoice(TrismikChoice):
71
- """
72
- Text choice.
73
-
74
- Attributes:
75
- text (str): Choice text.
76
- """
77
- text: str
78
-
79
-
80
- @dataclass
81
- class TrismikMultipleChoiceTextItem(TrismikItem):
82
- """
83
- Multiple choice text item.
84
-
85
- Attributes:
86
- question (str): Question text.
87
- choices (List[TrismikTextChoice]): List of choices.
88
- """
89
- question: str
90
- choices: List[TrismikTextChoice]
91
-
92
-
93
- @dataclass
94
- class TrismikResult:
95
- """
96
- Test result.
97
-
98
- Attributes:
99
- trait (str): Trait name.
100
- name (str): Result name/type.
101
- value (Any): Result value.
102
- """
103
- trait: str
104
- name: str
105
- value: Any
106
-
107
-
108
- @dataclass
109
- class TrismikResponse:
110
- """
111
- Test result.
112
-
113
- Attributes:
114
- item_id (str): Item ID.
115
- value (Any): Result value.
116
- score (float): Score.
117
- """
118
- item_id: str
119
- value: Any
120
- score: float
121
-
122
-
123
- @dataclass
124
- class TrismikResultsAndResponses:
125
- """
126
- Test results and responses.
127
-
128
- Attributes:
129
- results (List[TrismikResult]): Results.
130
- responses (List[TrismikResponse]): Responses.
131
- """
132
- results: List[TrismikResult]
133
- responses: List[TrismikResponse]
1
+ from dataclasses import dataclass
2
+ from datetime import datetime
3
+ from typing import Dict, List, Any, Optional
4
+
5
+
6
+ @dataclass
7
+ class TrismikAuth:
8
+ """
9
+ Authentication token.
10
+
11
+ Attributes:
12
+ token (str): Authentication token value.
13
+ expires (datetime): Expiration date.
14
+ """
15
+ token: str
16
+ expires: datetime
17
+
18
+
19
+ @dataclass
20
+ class TrismikTest:
21
+ """
22
+ Available test.
23
+
24
+ Attributes:
25
+ id (str): Test ID.
26
+ name (str): Test name.
27
+ """
28
+ id: str
29
+ name: str
30
+
31
+
32
+ @dataclass
33
+ class TrismikSession:
34
+ """
35
+ Test session.
36
+
37
+ Attributes:
38
+ id (str): Session ID.
39
+ url (str): Session URL.
40
+ status (str): Session status
41
+ """
42
+ id: str
43
+ url: str
44
+ status: str
45
+
46
+
47
+ @dataclass
48
+ class TrismikItem:
49
+ """
50
+ Base class for test items.
51
+
52
+ Attributes:
53
+ id (str): Item ID.
54
+ """
55
+ id: str
56
+
57
+
58
+ @dataclass
59
+ class TrismikChoice:
60
+ """
61
+ Base class for choices in items that use them.
62
+
63
+ Attributes:
64
+ id (str): Choice ID.
65
+ """
66
+ id: str
67
+
68
+
69
+ @dataclass
70
+ class TrismikTextChoice(TrismikChoice):
71
+ """
72
+ Text choice.
73
+
74
+ Attributes:
75
+ text (str): Choice text.
76
+ """
77
+ text: str
78
+
79
+
80
+ @dataclass
81
+ class TrismikMultipleChoiceTextItem(TrismikItem):
82
+ """
83
+ Multiple choice text item.
84
+
85
+ Attributes:
86
+ question (str): Question text.
87
+ choices (List[TrismikTextChoice]): List of choices.
88
+ """
89
+ question: str
90
+ choices: List[TrismikTextChoice]
91
+
92
+
93
+ @dataclass
94
+ class TrismikResult:
95
+ """
96
+ Test result.
97
+
98
+ Attributes:
99
+ trait (str): Trait name.
100
+ name (str): Result name/type.
101
+ value (Any): Result value.
102
+ """
103
+ trait: str
104
+ name: str
105
+ value: Any
106
+
107
+
108
+ @dataclass
109
+ class TrismikResponse:
110
+ """
111
+ Test result.
112
+
113
+ Attributes:
114
+ item_id (str): Item ID.
115
+ value (Any): Result value.
116
+ score (float): Score.
117
+ """
118
+ item_id: str
119
+ value: Any
120
+ score: float
121
+
122
+
123
+ @dataclass
124
+ class TrismikRunResults:
125
+ """
126
+ Test results and responses.
127
+
128
+ Attributes:
129
+ results (List[TrismikResult]): Results.
130
+ responses (List[TrismikResponse]): Responses.
131
+ """
132
+ session_id: str
133
+ results: List[TrismikResult]
134
+ responses: Optional[List[TrismikResponse]] = None
135
+
136
+ @dataclass
137
+ class TrismikSessionMetadata:
138
+ """
139
+ Metadata associated to a session
140
+
141
+ Attributes:
142
+ model_metadata (dict[str, Any]): Metadata about the model.
143
+ test_configuration (dict[str, Any]): Metadata about the test.
144
+ inference_setup (dict[str, Any]): Metadata about the inference setup.
145
+ """
146
+
147
+ class ModelMetadata:
148
+ def __init__(self, name: str, **kwargs: Any):
149
+ self.name = name
150
+ for key, value in kwargs.items():
151
+ setattr(self, key, value)
152
+
153
+ model_metadata: ModelMetadata
154
+ test_configuration: dict[str, Any]
155
+ inference_setup: dict[str, Any]
156
+
157
+ def toDict(self) -> Dict[str, Any]:
158
+ return {
159
+ "model_metadata": vars(self.model_metadata),
160
+ "test_configuration": self.test_configuration,
161
+ "inference_setup": self.inference_setup,
162
+ }
163
+
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Cambridge Enterprise
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Cambridge Enterprise
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: trismik
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary:
5
5
  Author: Bartosz Kielczewski
6
6
  Author-email: bk352@cam.ac.uk
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3.9
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
14
15
  Requires-Dist: httpx (>=0.27.2,<0.28.0)
15
16
  Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
16
17
  Description-Content-Type: text/markdown
@@ -51,10 +52,3 @@ Contributing
51
52
  4. ```poetry install```
52
53
  5. ```poetry run pytest```
53
54
 
54
- Publishing to TestPyPi
55
- ----------------------
56
-
57
- 1. ```poetry config repositories.testpypi https://test.pypi.org/legacy/```
58
- 2. ```poetry config pypi-token.testpypi <token>```
59
- 3. ```poetry publish --build --repository testpypi```
60
-
@@ -0,0 +1,13 @@
1
+ trismik/__init__.py,sha256=QO0sVXOB10dK8bHsWYnlZifwoTtvD6qf2H_F4Afpiuw,486
2
+ trismik/_mapper.py,sha256=ZbU1y0B1E3T-mSGcU9eCIHpFYbaH59KmDOmNrKRO8Jw,2280
3
+ trismik/_utils.py,sha256=uzfAU5uU383hmqSiSKNhsmBTSnpzR1wtjZq6qO0Vgd8,1151
4
+ trismik/client.py,sha256=1hPLr4jNsWloBdYJewBI1GYvxBf1RFf3rRYc_3NhPIY,11644
5
+ trismik/client_async.py,sha256=ysLYvzyn-4ET-wL-9HX62Nc5SAv2XwvjMQ7j82XQf4w,11693
6
+ trismik/exceptions.py,sha256=QcAH95FeZNXl4eDTCvqq3OhHrK976de1wd7bNEIfa88,322
7
+ trismik/runner.py,sha256=sO0oOuA49diShLz_v80Un1nE_v_lnbJAMCAP8QNwoR0,4036
8
+ trismik/runner_async.py,sha256=MR8_S-dT86olSUH2NffY3139W8H4SixY3T2yixBS524,4367
9
+ trismik/types.py,sha256=ZPO7STit-mZBSJ1jlMJa2QIPxBXrT_TT9cJfsYOPZWE,3120
10
+ trismik-0.9.1.dist-info/LICENSE,sha256=tgetRhapGLh7ZxfknW6Mm-WobfziPd64nAK52X5XKaw,1077
11
+ trismik-0.9.1.dist-info/METADATA,sha256=2XkPjBqdZw65AyGdrctsO0r4DtRG-4D7R9Hyu9g5m7A,1793
12
+ trismik-0.9.1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
13
+ trismik-0.9.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,13 +0,0 @@
1
- trismik/__init__.py,sha256=DoKoJyAtB8C8La-Jjn8PS7uqIpGutWxeI48dIjhywPY,487
2
- trismik/_mapper.py,sha256=HX4pQw3pZKsiOwuIebLbDP9_aTO8E9tlsSjUhU9dQTQ,2359
3
- trismik/_utils.py,sha256=5_zRwgfF7flfU0shQm2BzT5A-coIV7MWeq_MoRmsoQc,1195
4
- trismik/client.py,sha256=nsYdMHtELlBiwzfh-ameSwlPd-4-vQPg9eP-gYxu5gA,9318
5
- trismik/client_async.py,sha256=vAByw1ZvxtrzQx-IQ9K-k71RimvceH6POiSJpSPZKB4,9564
6
- trismik/exceptions.py,sha256=QcAH95FeZNXl4eDTCvqq3OhHrK976de1wd7bNEIfa88,322
7
- trismik/runner.py,sha256=VwkNKVA9On8zqEclALR_ffkSSiyNfYHCmtgGm1ASMl4,2906
8
- trismik/runner_async.py,sha256=sXHyMrUHmJ5bsDUz3KpTIPEFQpWSTj0YpqRv8Qs9FuE,3181
9
- trismik/types.py,sha256=1oDZ5pIoDr8WvY0LquChiPbcdqMvFt4CfS5rZAR66EM,2318
10
- trismik-0.9.0.dist-info/LICENSE,sha256=EbaNeGU9EYIF6mQ0iI3nnJ9UwEMghRj8sRNdjNTq96g,1098
11
- trismik-0.9.0.dist-info/METADATA,sha256=32QHAFdQx8L3IG3PNjoojYtwJpINrlITkBKguhZDVFE,1970
12
- trismik-0.9.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
13
- trismik-0.9.0.dist-info/RECORD,,