agi-med-common 3.6.1__py3-none-any.whl → 3.6.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.
- agi_med_common/__init__.py +1 -1
- agi_med_common/models/chat_item/replica_item.py +4 -1
- agi_med_common/parallel_map.py +6 -4
- {agi_med_common-3.6.1.dist-info → agi_med_common-3.6.3.dist-info}/METADATA +3 -2
- {agi_med_common-3.6.1.dist-info → agi_med_common-3.6.3.dist-info}/RECORD +7 -7
- {agi_med_common-3.6.1.dist-info → agi_med_common-3.6.3.dist-info}/WHEEL +0 -0
- {agi_med_common-3.6.1.dist-info → agi_med_common-3.6.3.dist-info}/top_level.txt +0 -0
agi_med_common/__init__.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
from datetime import datetime
|
2
2
|
from typing import Any, Optional
|
3
3
|
|
4
|
-
from pydantic import Field
|
4
|
+
from pydantic import Field, ConfigDict
|
5
5
|
|
6
6
|
from .. import _Base
|
7
7
|
from ..enums import StateEnum, ActionEnum, ModerationLabelEnum
|
@@ -42,5 +42,8 @@ class ReplicaItem(_Base):
|
|
42
42
|
|
43
43
|
|
44
44
|
class ReplicaItemPair(_Base):
|
45
|
+
# remove annoying warning for protected `model_` namespace
|
46
|
+
model_config = ConfigDict(protected_namespaces=())
|
47
|
+
|
45
48
|
user_replica: ReplicaItem = Field(alias="UserReplica")
|
46
49
|
model_replica: ReplicaItem = Field(alias="ModelReplica")
|
agi_med_common/parallel_map.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any, Callable, TypeVar
|
1
|
+
from typing import Any, Callable, TypeVar, Iterable
|
2
2
|
import concurrent.futures
|
3
3
|
from tqdm import tqdm
|
4
4
|
|
@@ -8,12 +8,12 @@ X = TypeVar("X")
|
|
8
8
|
|
9
9
|
def parallel_map(
|
10
10
|
func: Callable[..., X],
|
11
|
-
items:
|
11
|
+
items: Iterable[Any],
|
12
12
|
process: bool = False,
|
13
13
|
multiple_args: bool = False,
|
14
14
|
max_workers: int = 2,
|
15
15
|
show_tqdm: bool = False,
|
16
|
-
desc: str = ""
|
16
|
+
desc: str = ""
|
17
17
|
) -> list[X]:
|
18
18
|
pool = (
|
19
19
|
concurrent.futures.ProcessPoolExecutor(max_workers=max_workers)
|
@@ -27,5 +27,7 @@ def parallel_map(
|
|
27
27
|
futures.append(executor.submit(func, *item))
|
28
28
|
else:
|
29
29
|
futures.append(executor.submit(func, item))
|
30
|
-
results: list[X] = [
|
30
|
+
results: list[X] = [
|
31
|
+
future.result() for future in tqdm(futures, disable=(not show_tqdm), desc=desc)
|
32
|
+
]
|
31
33
|
return results
|
@@ -1,12 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: agi_med_common
|
3
|
-
Version: 3.6.
|
3
|
+
Version: 3.6.3
|
4
4
|
Summary: Сommon for agi-med team
|
5
5
|
Author: AGI-MED-TEAM
|
6
6
|
Requires-Python: >=3.11
|
7
7
|
Description-Content-Type: text/markdown
|
8
8
|
Requires-Dist: pydantic<=3.0.0,>=2.9.2
|
9
9
|
Requires-Dist: loguru~=0.7.2
|
10
|
+
Requires-Dist: tqdm==4.67.*
|
10
11
|
|
11
12
|
# agi-med-common
|
12
13
|
|
@@ -14,7 +15,7 @@ Common компонент
|
|
14
15
|
|
15
16
|
## Ответственный разработчик
|
16
17
|
|
17
|
-
@
|
18
|
+
@bakulin
|
18
19
|
|
19
20
|
## Общая информация
|
20
21
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
agi_med_common/__init__.py,sha256=
|
1
|
+
agi_med_common/__init__.py,sha256=IcL_L6jchfpfZUcCCWj3enH4rXPkeRuSa3MroRr7I7c,575
|
2
2
|
agi_med_common/file_storage.py,sha256=GR6_jKZ0o9uwUkOKZd1XaCVOSw0YmFlCOlC6EX8zz0I,1247
|
3
|
-
agi_med_common/parallel_map.py,sha256=
|
3
|
+
agi_med_common/parallel_map.py,sha256=Qx6xe7DqlEUDpSucp5Hm8r9y9Iquwh9JvX7lOqHhnOw,921
|
4
4
|
agi_med_common/utils.py,sha256=5iurKl5d1zZ_cN4yqtc0_FhrwuNBcDurbWilu28_saE,325
|
5
5
|
agi_med_common/validators.py,sha256=R678gjPp-5XbnocRuEtdOQgJyCCOurxwaOe2nT04kSg,705
|
6
6
|
agi_med_common/xml_parser.py,sha256=VvLIX_XCZao9i0qqpTVx8nx0vbFXSe8pEbdJdXnj97g,568
|
@@ -15,7 +15,7 @@ agi_med_common/models/chat_item/__init__.py,sha256=NG1optUYwjnxfpTXntUfTDOA0eKTg
|
|
15
15
|
agi_med_common/models/chat_item/chat_item.py,sha256=Ym-afB9-7NI6QquhMPqd2ZBkbcx-Txr-ZiXwn0PTO-0,1182
|
16
16
|
agi_med_common/models/chat_item/inner_context_item.py,sha256=YXmlNLabKN3O84UWJENsjfdtPq2XRH1VqKiyIxS-p64,255
|
17
17
|
agi_med_common/models/chat_item/outer_context_item.py,sha256=IzrwhqbLKR8ZF8-Sd2CyNSa0eqb21NQH7LUqkg9se2Y,1046
|
18
|
-
agi_med_common/models/chat_item/replica_item.py,sha256=
|
18
|
+
agi_med_common/models/chat_item/replica_item.py,sha256=OC3LCT3clGDFJ9pIr7FL8HXvldrplnuaLXEbkK6Hu9o,1737
|
19
19
|
agi_med_common/models/enums/__init__.py,sha256=wnI9ub2F1L-TTB2jIpVF3OTLFr0QzcQjW3pX4P45HXo,377
|
20
20
|
agi_med_common/models/enums/action_enum.py,sha256=J0S_CkCTDoebbdGbzfrnNTOXla-yMXsPsQI_dyXH2iE,348
|
21
21
|
agi_med_common/models/enums/diagnostics_xml_tag_enum.py,sha256=aiUJpe5joh5EOcJ5sk1Xs003XkRry2CBL6H-bIEiapA,278
|
@@ -25,7 +25,7 @@ agi_med_common/models/enums/mtrs_label_enum.py,sha256=6emBndt3SCsQVZZFKQYCV2_iyj
|
|
25
25
|
agi_med_common/models/enums/mtrs_xml_tag_enum.py,sha256=6OxuRsrx4b2uBjfrBgm4Y789Ly337_mQXL9VPRCpLyg,273
|
26
26
|
agi_med_common/models/enums/state_enum.py,sha256=p7XhDxBxPeeSgbLWitq6JpJLKntS3XMHon_EevbnhEs,163
|
27
27
|
agi_med_common/models/enums/track_id_enum.py,sha256=N3KUd97a4xDet_NKZ5URm0qWAAv3ts1l_foOjdlGY4c,532
|
28
|
-
agi_med_common-3.6.
|
29
|
-
agi_med_common-3.6.
|
30
|
-
agi_med_common-3.6.
|
31
|
-
agi_med_common-3.6.
|
28
|
+
agi_med_common-3.6.3.dist-info/METADATA,sha256=pN-Es5jecHbHSuWfYZTfJ3PshSnfyowErVAUl3STs9E,546
|
29
|
+
agi_med_common-3.6.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
30
|
+
agi_med_common-3.6.3.dist-info/top_level.txt,sha256=26o565jF_7wYQj7-YJfTedtT9yDxDcf8RNikOYuPq78,15
|
31
|
+
agi_med_common-3.6.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|