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

@@ -23,27 +23,32 @@ def scan_directory(run: RunConfig, benchmark_type: BenchmarkOutputType) -> pl.La
23
23
  run (RunConfig): RunConfig object.
24
24
  benchmark_type (BenchmarkOutputTypeEnum): Benchmark output type.
25
25
  Returns:
26
- pl.LazyFrame: LazyFrame object containing all the results in the directory..
26
+ pl.LazyFrame: LazyFrame object containing all the results in the directory.
27
27
  """
28
28
  logger = get_logger()
29
29
  logger.info(f"Analysing results in {run.results_dir.joinpath(benchmark_type.result_directory)}")
30
30
  return (
31
- pl.scan_parquet(
32
- run.results_dir.joinpath(benchmark_type.result_directory),
33
- include_file_paths="file_path",
34
- ).with_columns(
35
- pl.col("rank").cast(pl.Int64),
36
- pl.col("file_path").str.extract(r"([^/\\]+)$").alias("result_file"),
37
- pl.col("true_positive").fill_null(False),
38
- )
39
- ).filter(
40
31
  (
41
- pl.col("score") >= run.threshold
42
- if run.score_order.lower() == "descending"
43
- else pl.col("score") <= run.threshold
32
+ pl.scan_parquet(
33
+ run.results_dir.joinpath(benchmark_type.result_directory),
34
+ include_file_paths="file_path",
35
+ ).with_columns(
36
+ pl.col("rank").cast(pl.Int64),
37
+ pl.col("file_path").str.extract(r"([^/\\]+)$").alias("result_file"),
38
+ pl.col("true_positive").fill_null(False),
39
+ )
40
+ )
41
+ .filter(
42
+ (
43
+ pl.col("score") >= run.threshold
44
+ if run.score_order.lower() == "descending"
45
+ else pl.col("score") <= run.threshold
46
+ )
47
+ if run.threshold is not None
48
+ else True
44
49
  )
45
- if run.threshold is not None
46
- else True
50
+ .sort("rank")
51
+ .unique(subset=["file_path", *benchmark_type.columns], keep="first")
47
52
  )
48
53
 
49
54
 
@@ -68,14 +73,29 @@ def process_stats(
68
73
  )
69
74
  curve_results.append(compute_curves(run.run_identifier, result_scan))
70
75
  true_positive_cases.append(
71
- result_scan.filter(pl.col("true_positive")).select(
76
+ result_scan.filter(pl.col("true_positive"))
77
+ .select(
72
78
  ["result_file", *benchmark_type.columns, pl.col("rank").alias(run.run_identifier)]
73
79
  )
80
+ .sort(["result_file", *benchmark_type.columns])
74
81
  )
75
82
  return (
76
83
  pl.concat(stats, how="vertical").collect(),
77
84
  pl.concat(curve_results, how="vertical").collect(),
78
- pl.concat(true_positive_cases, how="align_inner").collect(),
85
+ pl.concat(
86
+ [true_positive_cases[0]]
87
+ + [
88
+ df.select(
89
+ [
90
+ col
91
+ for col in df.collect_schema().keys()
92
+ if col not in ["result_file", *benchmark_type.columns]
93
+ ]
94
+ )
95
+ for df in true_positive_cases[1:]
96
+ ],
97
+ how="horizontal",
98
+ ).collect(),
79
99
  )
80
100
 
81
101
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pheval
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary:
5
5
  Author: Yasemin Bridges
6
6
  Author-email: y.bridges@qmul.ac.uk
@@ -32,10 +32,10 @@ Description-Content-Type: text/markdown
32
32
 
33
33
  # PhEval - Phenotypic Inference Evaluation Framework
34
34
 
35
- ![PyPI](https://img.shields.io/pypi/v/pheval)
35
+ [![PyPI](https://img.shields.io/pypi/v/pheval)](https://pypi.org/project/pheval/)
36
36
  ![Build Status](https://img.shields.io/github/actions/workflow/status/monarch-initiative/pheval/pypi-publish.yml?branch=main)
37
37
  ![License](https://img.shields.io/github/license/monarch-initiative/pheval)
38
- ![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)
38
+ ![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)
39
39
  ![Issues](https://img.shields.io/github/issues/monarch-initiative/pheval)
40
40
 
41
41
  ## Overview
@@ -53,7 +53,7 @@ For more information please see the full [documentation](https://monarch-initiat
53
53
 
54
54
  ## Download and Installation
55
55
 
56
- 1. Ensure you have Python 3.8 or greater installed.
56
+ 1. Ensure you have Python 3.10 or greater installed.
57
57
  2. Install with `pip`:
58
58
  ```bash
59
59
  pip install pheval
@@ -1,6 +1,6 @@
1
1
  pheval/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  pheval/analyse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- pheval/analyse/benchmark.py,sha256=1ysz1peGb21DhgNpEam9NgUOS5eGv7K0CI3RNjy0crQ,6275
3
+ pheval/analyse/benchmark.py,sha256=sfjReLmodXwCT9ZyZDE6Oli0j1S5ygicJshb7n4-x4U,6916
4
4
  pheval/analyse/benchmark_db_manager.py,sha256=zS1TI76YuV2_YXLipHLSyh-XDR5kTxyOwhRhHRFHfjQ,764
5
5
  pheval/analyse/benchmark_output_type.py,sha256=bh-qQvV4AF7BHQyr_bdY8HTTzYZVe7KvoIoUF0D9k-g,1468
6
6
  pheval/analyse/binary_classification_curves.py,sha256=Crb45rJWc5rxDdx82sgoHRvYHE2D5pus91fgl39FyRw,5007
@@ -46,8 +46,8 @@ pheval/utils/logger.py,sha256=5DZl5uMltUDQorhkvg_B7_ZhFwApAmEkWneFIOKfRGQ,1566
46
46
  pheval/utils/phenopacket_utils.py,sha256=AfV_mWac6n5HCc5zjfH6CGP8T0qI0LR0VBrooaKmgdY,26978
47
47
  pheval/utils/semsim_utils.py,sha256=s7ZCR2VfPYnOh7ApX6rv66eGoVSm9QJaVYOWBEhlXpo,6151
48
48
  pheval/utils/utils.py,sha256=9V6vCT8l1g4O2-ZATYqsVyd7AYZdWGd-Ksy7_oIC3eE,2343
49
- pheval-0.5.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
50
- pheval-0.5.1.dist-info/METADATA,sha256=EsSCTQApiqCwO-40ZZX9sYf3ufyJTV9f2Z8nh0WeZZ4,6456
51
- pheval-0.5.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
52
- pheval-0.5.1.dist-info/entry_points.txt,sha256=o9gSwDkvT4-lqKy4mlsftd1nzP9WUOXQCfnbqycURd0,81
53
- pheval-0.5.1.dist-info/RECORD,,
49
+ pheval-0.5.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
50
+ pheval-0.5.2.dist-info/METADATA,sha256=do8ya_Tw3VD-md2rPf83DBmVTyytUrH7tEhQenjN-6o,6494
51
+ pheval-0.5.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
52
+ pheval-0.5.2.dist-info/entry_points.txt,sha256=o9gSwDkvT4-lqKy4mlsftd1nzP9WUOXQCfnbqycURd0,81
53
+ pheval-0.5.2.dist-info/RECORD,,
File without changes