kalbio 0.2.2__py3-none-any.whl → 0.2.3__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.
- kalbio/activities.py +4 -4
- kalbio/client.py +6 -2
- kalbio/dashboards.py +2 -2
- kalbio/entity_fields.py +2 -2
- kalbio/exports.py +1 -1
- kalbio/records.py +3 -2
- {kalbio-0.2.2.dist-info → kalbio-0.2.3.dist-info}/METADATA +1 -1
- {kalbio-0.2.2.dist-info → kalbio-0.2.3.dist-info}/RECORD +9 -9
- {kalbio-0.2.2.dist-info → kalbio-0.2.3.dist-info}/WHEEL +0 -0
kalbio/activities.py
CHANGED
|
@@ -65,7 +65,7 @@ from kalbio.entity_fields import DataFieldTypeEnum
|
|
|
65
65
|
from kalbio.programs import Program
|
|
66
66
|
from kalbio.labels import Label
|
|
67
67
|
from kalbio.workspace import WorkspaceUser, WorkspaceGroup
|
|
68
|
-
from typing import Any, BinaryIO, List, Literal, Optional, Union
|
|
68
|
+
from typing import Any, BinaryIO, List, Literal, Optional, TypeAlias, Union
|
|
69
69
|
from typing import TYPE_CHECKING
|
|
70
70
|
|
|
71
71
|
if TYPE_CHECKING:
|
|
@@ -153,7 +153,7 @@ class ActivityStatusEnum(str, Enum):
|
|
|
153
153
|
DONE = "done"
|
|
154
154
|
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
ActivityType: TypeAlias = Union[
|
|
157
157
|
Literal["task"],
|
|
158
158
|
Literal["experiment"],
|
|
159
159
|
Literal["project"],
|
|
@@ -671,7 +671,7 @@ class Activity(_KaleidoscopeBaseModel):
|
|
|
671
671
|
setattr(self, k, v)
|
|
672
672
|
|
|
673
673
|
|
|
674
|
-
|
|
674
|
+
ActivityIdentifier: TypeAlias = Union[Activity, str]
|
|
675
675
|
"""Identifier class for Activity
|
|
676
676
|
|
|
677
677
|
Activities are able to be identified by:
|
|
@@ -681,7 +681,7 @@ Activities are able to be identified by:
|
|
|
681
681
|
* UUID
|
|
682
682
|
"""
|
|
683
683
|
|
|
684
|
-
|
|
684
|
+
DefinitionIdentifier: TypeAlias = Union[ActivityDefinition, str]
|
|
685
685
|
"""Identifier class for ActivityDefinition
|
|
686
686
|
|
|
687
687
|
ActivityDefinitions are able to be identified by:
|
kalbio/client.py
CHANGED
|
@@ -119,6 +119,7 @@ class KaleidoscopeClient:
|
|
|
119
119
|
|
|
120
120
|
_client_id: str
|
|
121
121
|
_client_secret: str
|
|
122
|
+
_additional_headers: dict
|
|
122
123
|
_iap_client_id: Optional[str]
|
|
123
124
|
|
|
124
125
|
_refresh_token: str = None
|
|
@@ -133,6 +134,7 @@ class KaleidoscopeClient:
|
|
|
133
134
|
client_id: Optional[str] = _env_client_id,
|
|
134
135
|
client_secret: Optional[str] = _env_client_secret,
|
|
135
136
|
url: str = PROD_API_URL,
|
|
137
|
+
additional_headers: dict = {},
|
|
136
138
|
iap_client_id: Optional[str] = None,
|
|
137
139
|
verify_ssl: bool = True,
|
|
138
140
|
):
|
|
@@ -206,6 +208,7 @@ class KaleidoscopeClient:
|
|
|
206
208
|
|
|
207
209
|
self._client_id = client_id
|
|
208
210
|
self._client_secret = client_secret
|
|
211
|
+
self.additional_headers = additional_headers
|
|
209
212
|
self._iap_client_id = iap_client_id
|
|
210
213
|
self._verify_ssl = verify_ssl
|
|
211
214
|
|
|
@@ -258,7 +261,7 @@ class KaleidoscopeClient:
|
|
|
258
261
|
"client_id": self._client_id,
|
|
259
262
|
"client_secret": self._client_secret,
|
|
260
263
|
},
|
|
261
|
-
headers=self._get_iap_headers(),
|
|
264
|
+
headers={**self._get_iap_headers(), **self.additional_headers},
|
|
262
265
|
timeout=TIMEOUT_MAXIMUM,
|
|
263
266
|
verify=self._verify_ssl,
|
|
264
267
|
)
|
|
@@ -284,7 +287,7 @@ class KaleidoscopeClient:
|
|
|
284
287
|
"grant_type": "refresh_token",
|
|
285
288
|
"refresh_token": self._refresh_token,
|
|
286
289
|
},
|
|
287
|
-
headers=self._get_iap_headers(),
|
|
290
|
+
headers={**self._get_iap_headers(), **self.additional_headers},
|
|
288
291
|
timeout=TIMEOUT_MAXIMUM,
|
|
289
292
|
verify=self._verify_ssl,
|
|
290
293
|
)
|
|
@@ -327,6 +330,7 @@ class KaleidoscopeClient:
|
|
|
327
330
|
"Content-Type": "application/json",
|
|
328
331
|
"X-Kal-Authorization": f"Bearer {self._access_token}",
|
|
329
332
|
**self._get_iap_headers(),
|
|
333
|
+
**self.additional_headers,
|
|
330
334
|
}
|
|
331
335
|
|
|
332
336
|
return headers
|
kalbio/dashboards.py
CHANGED
|
@@ -21,11 +21,11 @@ from functools import lru_cache
|
|
|
21
21
|
from kalbio._kaleidoscope_model import _KaleidoscopeBaseModel
|
|
22
22
|
from kalbio.client import KaleidoscopeClient
|
|
23
23
|
from pydantic import TypeAdapter
|
|
24
|
-
from typing import List, Literal, Union
|
|
24
|
+
from typing import List, Literal, TypeAlias, Union
|
|
25
25
|
|
|
26
26
|
_logger = logging.getLogger(__name__)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
DashboardType: TypeAlias = Union[
|
|
29
29
|
Literal["decision"],
|
|
30
30
|
Literal["data"],
|
|
31
31
|
Literal["chart"],
|
kalbio/entity_fields.py
CHANGED
|
@@ -41,7 +41,7 @@ from functools import lru_cache
|
|
|
41
41
|
from kalbio._kaleidoscope_model import _KaleidoscopeBaseModel
|
|
42
42
|
from kalbio.client import KaleidoscopeClient
|
|
43
43
|
from pydantic import TypeAdapter
|
|
44
|
-
from typing import List, Optional, Union
|
|
44
|
+
from typing import List, Optional, TypeAlias, Union
|
|
45
45
|
|
|
46
46
|
_logger = logging.getLogger(__name__)
|
|
47
47
|
|
|
@@ -151,7 +151,7 @@ class EntityField(_KaleidoscopeBaseModel):
|
|
|
151
151
|
return f"{self.field_name}"
|
|
152
152
|
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
EntityFieldIdentifier: TypeAlias = Union[EntityField, str]
|
|
155
155
|
"""An Identifier Type for Entity Fields.
|
|
156
156
|
|
|
157
157
|
An EntityField should be able to be identified by:
|
kalbio/exports.py
CHANGED
kalbio/records.py
CHANGED
|
@@ -62,6 +62,7 @@ from typing import (
|
|
|
62
62
|
Dict,
|
|
63
63
|
List,
|
|
64
64
|
Optional,
|
|
65
|
+
TypeAlias,
|
|
65
66
|
TypedDict,
|
|
66
67
|
Union,
|
|
67
68
|
Unpack,
|
|
@@ -631,7 +632,7 @@ class Record(_KaleidoscopeBaseModel):
|
|
|
631
632
|
setattr(self, k, v)
|
|
632
633
|
|
|
633
634
|
|
|
634
|
-
|
|
635
|
+
RecordIdentifier: TypeAlias = Union[Record, str, dict[EntityFieldIdentifier, str]]
|
|
635
636
|
"""Identifier type for Record
|
|
636
637
|
|
|
637
638
|
Record can be identified by:
|
|
@@ -1154,7 +1155,7 @@ class RecordsService:
|
|
|
1154
1155
|
]
|
|
1155
1156
|
# fmt: on
|
|
1156
1157
|
|
|
1157
|
-
resp = self._client._get(f"/records?record_ids={
|
|
1158
|
+
resp = self._client._get(f"/records?record_ids={','.join(to_fetch)}") or []
|
|
1158
1159
|
self._create_record_list(resp)
|
|
1159
1160
|
|
|
1160
1161
|
ordered = [
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
kalbio/__init__.py,sha256=6Po_T4MM5m2qNTYgLe4E89C57OVwDaRQ9pXTJTuJsM4,240
|
|
2
2
|
kalbio/_kaleidoscope_model.py,sha256=UnSpiubaEkoyOLjAmKzQGZdXOUMthuP0HiYU1Lo2sFM,4465
|
|
3
|
-
kalbio/activities.py,sha256
|
|
4
|
-
kalbio/client.py,sha256=
|
|
5
|
-
kalbio/dashboards.py,sha256=
|
|
6
|
-
kalbio/entity_fields.py,sha256=
|
|
3
|
+
kalbio/activities.py,sha256=UBvQGvQpuOirkWNX_3MNxNAstfo500PgJ6oVBf7HTCA,40654
|
|
4
|
+
kalbio/client.py,sha256=C6r-yuHqlk-dAq55Ur9y7FrowhLvGSR2qzb5YPvf09k,20486
|
|
5
|
+
kalbio/dashboards.py,sha256=Hj3mFjIBIualk5FXC1CLyLFbfvqGdYYLfdpFeigk1jw,9351
|
|
6
|
+
kalbio/entity_fields.py,sha256=mqE4VP2g1-XR2vLUt1TIvX9Drv71NCCYPKBh03f0zO0,15201
|
|
7
7
|
kalbio/entity_types.py,sha256=THXGbIV9dFU2DvIuDd7Q29onmEs9KdeqsB_tq6ZXmR4,6527
|
|
8
|
-
kalbio/exports.py,sha256=
|
|
8
|
+
kalbio/exports.py,sha256=IiAk4ZnjU59N4lrKeDRD60ZViOigR0QDd3XcNaWq5O0,5236
|
|
9
9
|
kalbio/helpers.py,sha256=TBPVls1GzfUygDAwCldI5sXYTgBC2pEUSEU0OtrQi3I,1955
|
|
10
10
|
kalbio/imports.py,sha256=s7LIETRQtT6MXEmsbIT2FwFJdE3eh25ujbs4ZFbWYns,3523
|
|
11
11
|
kalbio/labels.py,sha256=Vy7PiZ8vFXIBbrCmdHyz7ANooO0-giTvTLH7WwU_Mo8,2704
|
|
12
12
|
kalbio/programs.py,sha256=svYmZLhN2pwT9cAB8IfvyIbUmFnMVxcoUeeUxs_uESs,2951
|
|
13
13
|
kalbio/property_fields.py,sha256=eCYzSnG-HQB6ECHFNpaGkpm3azHe-lDYVNJUpq5TOtc,2763
|
|
14
14
|
kalbio/record_views.py,sha256=M3NEOhnN4JHA8ZO0I91L9pAVdVY0kmqSent3HehzFTI,7208
|
|
15
|
-
kalbio/records.py,sha256=
|
|
15
|
+
kalbio/records.py,sha256=sQiGnXQaiS6VNj0n2mn8tw7u8kquHLhcAI5fpHjYL8U,40501
|
|
16
16
|
kalbio/workspace.py,sha256=YpeLtzo3o8um_CQLyTT8GnvkF6I195y43JhNN2GmM0M,11670
|
|
17
|
-
kalbio-0.2.
|
|
18
|
-
kalbio-0.2.
|
|
19
|
-
kalbio-0.2.
|
|
17
|
+
kalbio-0.2.3.dist-info/METADATA,sha256=VK7xMMAwxXl-v6kOdNMRisHf2hv3t1rrt74XmSCJb6o,7993
|
|
18
|
+
kalbio-0.2.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
19
|
+
kalbio-0.2.3.dist-info/RECORD,,
|
|
File without changes
|