pheval 0.5.7__py3-none-any.whl → 0.5.8__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.

Potentially problematic release.


This version of pheval might be problematic. Click here for more details.

@@ -4,6 +4,7 @@ from functools import cache
4
4
 
5
5
  from class_resolver import ClassResolver
6
6
 
7
+ from pheval.implementations.pheval_class_resolver import PhevalClassResolver
7
8
  from pheval.runners.runner import PhEvalRunner
8
9
 
9
10
 
@@ -14,9 +15,11 @@ def get_implementation_resolver() -> ClassResolver[PhEvalRunner]:
14
15
  Returns:
15
16
  ClassResolver[PhEvalRunner]: _description_
16
17
  """
17
- implementation_resolver: ClassResolver[PhEvalRunner] = ClassResolver.from_subclasses(
18
- PhEvalRunner,
19
- suffix="Implementation",
18
+ implementation_resolver: PhevalClassResolver[PhEvalRunner] = (
19
+ PhevalClassResolver.from_subclasses(
20
+ PhEvalRunner,
21
+ suffix="Implementation",
22
+ )
20
23
  )
21
24
 
22
25
  # implementation_resolver.synonyms.update(
@@ -34,5 +37,6 @@ def get_implementation_resolver() -> ClassResolver[PhEvalRunner]:
34
37
  # See also:
35
38
  # https://packaging.python.org/en/latest/specifications/entry-points/
36
39
  # https://class-resolver.readthedocs.io/en/latest/api/class_resolver.ClassResolver.html#class_resolver.ClassResolver.register_entrypoint
40
+
37
41
  implementation_resolver.register_entrypoint("pheval.plugins")
38
42
  return implementation_resolver
@@ -0,0 +1,40 @@
1
+ # Dependencies taken from class_resolver:
2
+ # https://github.com/cthoyt/class-resolver/blob/5e51b41d08381e1754f3445c5ce4fcea4f6612d6/src/class_resolver/base.py#L276
3
+ from importlib.metadata import entry_points
4
+
5
+ # Dependency from importlib.metadata:
6
+ # https://github.com/cthoyt/class-resolver/blob/5e51b41d08381e1754f3445c5ce4fcea4f6612d6/src/class_resolver/utils.py#L45
7
+ from typing import TypeVar
8
+
9
+ from class_resolver import ClassResolver
10
+
11
+ from pheval.utils.logger import get_logger
12
+
13
+ X = TypeVar("X")
14
+ logger = get_logger()
15
+
16
+
17
+ # Create a custom ClassResolver class to modify the _from_entrypoint method.
18
+ class PhevalClassResolver(ClassResolver):
19
+ def __init__(self, *args, **kwargs) -> None:
20
+ super().__init__(*args, **kwargs)
21
+
22
+ # Modified _from_entrypoint method to raise error instead of warning
23
+ @staticmethod
24
+ def _from_entrypoint_custom(group: str) -> set[X]:
25
+ elements: set[X] = set()
26
+ for entry in entry_points(group=group):
27
+ try:
28
+ element = entry.load()
29
+ logger.info(f"Loaded {entry.name} correctly")
30
+ except (ImportError, AttributeError):
31
+ logger.warn(f"could not load {entry.name}. See error message below.")
32
+ raise
33
+ else:
34
+ elements.add(element)
35
+ return elements
36
+
37
+ def register_entrypoint(self, group: str) -> None:
38
+ """Register additional entries from an entrypoint."""
39
+ for element in self._from_entrypoint_custom(group).difference(self.lookup_dict.values()):
40
+ self.register(element)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pheval
3
- Version: 0.5.7
3
+ Version: 0.5.8
4
4
  Summary:
5
5
  Author: Yasemin Bridges
6
6
  Author-email: y.bridges@qmul.ac.uk
@@ -13,7 +13,8 @@ pheval/cli.py,sha256=rpvTTCKAvH75XkZUh0xaKv7Ftl9zIt2RncsMGIlrq9U,1556
13
13
  pheval/cli_pheval.py,sha256=iVvPby44EvVHkZsOFNQ_DovhYdwIkKir1Kf8uVJ_GCw,2872
14
14
  pheval/cli_pheval_utils.py,sha256=sh6kx36jYfuSIWBMlrdW3g-LPftxBy-xw4b7hg8bdj4,16545
15
15
  pheval/config_parser.py,sha256=eUa1wMRuCy2iq-oRSxTZGltLxaw5NjsISN2GRBpuQWM,1358
16
- pheval/implementations/__init__.py,sha256=BMUTotjTdgy5j5xubWCIQgRXrSQ1ZIcjooer7r299Zo,1228
16
+ pheval/implementations/__init__.py,sha256=L0y_qPxKGcm4zCi-YmPa_YgtYoD9QsL7IHqoB7bfO4Y,1346
17
+ pheval/implementations/pheval_class_resolver.py,sha256=YNNk3PoQbSvbKmbihlt_bsHNxRM95O-VrtUIbQnfBcw,1567
17
18
  pheval/infra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
19
  pheval/infra/exomiserdb.py,sha256=pM9-TfjrgurtH4OtM1Enk5oVhIxGQN3rKRlrxHuObTM,5080
19
20
  pheval/post_processing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -46,8 +47,8 @@ pheval/utils/logger.py,sha256=5DZl5uMltUDQorhkvg_B7_ZhFwApAmEkWneFIOKfRGQ,1566
46
47
  pheval/utils/phenopacket_utils.py,sha256=XGnFLarvXezFR0W5frzyGTwEbhcA3zuGJPg1r5YBscg,27326
47
48
  pheval/utils/semsim_utils.py,sha256=s7ZCR2VfPYnOh7ApX6rv66eGoVSm9QJaVYOWBEhlXpo,6151
48
49
  pheval/utils/utils.py,sha256=9V6vCT8l1g4O2-ZATYqsVyd7AYZdWGd-Ksy7_oIC3eE,2343
49
- pheval-0.5.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
50
- pheval-0.5.7.dist-info/METADATA,sha256=jGVgjj__bZaODcDdjdpugcPUIlAfAiX6rKygGfBVmQ4,6494
51
- pheval-0.5.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
52
- pheval-0.5.7.dist-info/entry_points.txt,sha256=o9gSwDkvT4-lqKy4mlsftd1nzP9WUOXQCfnbqycURd0,81
53
- pheval-0.5.7.dist-info/RECORD,,
50
+ pheval-0.5.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
51
+ pheval-0.5.8.dist-info/METADATA,sha256=q9bYdrUPdf_QAgOxXxXhct0HaEGSme45_0DVAaIXHr4,6494
52
+ pheval-0.5.8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
53
+ pheval-0.5.8.dist-info/entry_points.txt,sha256=o9gSwDkvT4-lqKy4mlsftd1nzP9WUOXQCfnbqycURd0,81
54
+ pheval-0.5.8.dist-info/RECORD,,
File without changes