pythonflex 0.2__tar.gz → 0.2.1__tar.gz

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.
Files changed (25) hide show
  1. {pythonflex-0.2 → pythonflex-0.2.1}/.gitignore +1 -0
  2. {pythonflex-0.2 → pythonflex-0.2.1}/PKG-INFO +1 -1
  3. {pythonflex-0.2 → pythonflex-0.2.1}/pyproject.toml +1 -1
  4. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/utils.py +22 -5
  5. pythonflex-0.2/.vscode/settings.json +0 -5
  6. {pythonflex-0.2 → pythonflex-0.2.1}/.python-version +0 -0
  7. {pythonflex-0.2 → pythonflex-0.2.1}/README.md +0 -0
  8. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/__init__.py +0 -0
  9. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/analysis.py +0 -0
  10. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/data/dataset/liver_cell_lines_500_genes.csv +0 -0
  11. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/data/dataset/melanoma_cell_lines_500_genes.csv +0 -0
  12. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/data/dataset/neuroblastoma_cell_lines_500_genes.csv +0 -0
  13. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/data/gold_standard/CORUM.parquet +0 -0
  14. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/data/gold_standard/GOBP.parquet +0 -0
  15. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/data/gold_standard/PATHWAY.parquet +0 -0
  16. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/data/gold_standard/corum.csv +0 -0
  17. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/data/gold_standard/gobp.csv +0 -0
  18. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/data/gold_standard/pathway.csv +0 -0
  19. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/examples/basic_usage.py +0 -0
  20. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/examples/dataset_filtering.py +0 -0
  21. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/examples/test.py +0 -0
  22. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/logging_config.py +0 -0
  23. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/plotting.py +0 -0
  24. {pythonflex-0.2 → pythonflex-0.2.1}/src/pythonflex/preprocessing.py +0 -0
  25. {pythonflex-0.2 → pythonflex-0.2.1}/uv.lock +0 -0
@@ -15,3 +15,4 @@ bfg-*.jar
15
15
  examples/output/
16
16
  src/benchmarkcr/examples/output/
17
17
  .aider*
18
+ .vscode
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythonflex
3
- Version: 0.2
3
+ Version: 0.2.1
4
4
  Summary: pythonFLEX is a benchmarking toolkit for evaluating CRISPR screen results against biological gold standards. The toolkit computes gene-level and complex-level performance metrics, helping researchers systematically assess the biological relevance and resolution of their CRISPR screening data.
5
5
  Author-email: Yasir Demirtaş <tyasird@hotmail.com>
6
6
  Requires-Python: >=3.9
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pythonflex"
3
- version = "0.2"
3
+ version = "0.2.1"
4
4
  description = "pythonFLEX is a benchmarking toolkit for evaluating CRISPR screen results against biological gold standards. The toolkit computes gene-level and complex-level performance metrics, helping researchers systematically assess the biological relevance and resolution of their CRISPR screening data."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -5,9 +5,23 @@ import joblib
5
5
  import numpy as np
6
6
  import pandas as pd
7
7
 
8
- # Constants
8
+ # Constants - ADD .parquet to valid extensions
9
9
  TMP_ROOT = ".tmp"
10
- VALID_EXTS = {".feather", ".npy", ".pkl"}
10
+ VALID_EXTS = {".feather", ".parquet", ".npy", ".pkl"}
11
+
12
+ # Minimal fix - just patch the problematic save
13
+ original_to_feather = pd.DataFrame.to_feather
14
+ def safe_to_feather(self, path, **kwargs):
15
+ try:
16
+ return original_to_feather(self, path, **kwargs)
17
+ except ValueError as e:
18
+ if "feather does not support serializing" in str(e):
19
+ # FIXED: Better path handling
20
+ parquet_path = os.path.splitext(path)[0] + '.parquet'
21
+ self.to_parquet(parquet_path, **kwargs)
22
+ else:
23
+ raise
24
+ pd.DataFrame.to_feather = safe_to_feather
11
25
 
12
26
  # Helper to sanitize names (make filesystem-safe)
13
27
  def _sanitize(name):
@@ -54,7 +68,7 @@ def dsave(data, category, name=None, path=None): # 'path' ignored for compatibi
54
68
  save_func(tmp_path)
55
69
  os.replace(tmp_path, target) # Atomic move
56
70
 
57
- # Load function
71
+ # Load function - FIXED: Added parquet support
58
72
  def dload(category, name=None, path=None): # 'path' ignored for compatibility
59
73
  dir_path = os.path.join(TMP_ROOT, _sanitize(category))
60
74
 
@@ -72,6 +86,8 @@ def dload(category, name=None, path=None): # 'path' ignored for compatibility
72
86
  try:
73
87
  if filename.endswith(".feather"):
74
88
  out[k] = pd.read_feather(full_path)
89
+ elif filename.endswith(".parquet"): # ADDED
90
+ out[k] = pd.read_parquet(full_path)
75
91
  elif filename.endswith(".npy"):
76
92
  out[k] = np.load(full_path, mmap_mode="r") # MMap for perf
77
93
  elif filename.endswith(".pkl"):
@@ -88,6 +104,8 @@ def dload(category, name=None, path=None): # 'path' ignored for compatibility
88
104
  try:
89
105
  if ext == ".feather":
90
106
  return pd.read_feather(target)
107
+ elif ext == ".parquet": # ADDED
108
+ return pd.read_parquet(target)
91
109
  elif ext == ".npy":
92
110
  return np.load(target, mmap_mode="r") # MMap for perf
93
111
  elif ext == ".pkl":
@@ -96,5 +114,4 @@ def dload(category, name=None, path=None): # 'path' ignored for compatibility
96
114
  print(f"Warning: '{target}' is corrupted. Deleting and returning {{}}...")
97
115
  os.remove(target)
98
116
  return {}
99
- return {}
100
-
117
+ return {}
@@ -1,5 +0,0 @@
1
- {
2
- "python-envs.defaultEnvManager": "ms-python.python:conda",
3
- "python-envs.defaultPackageManager": "ms-python.python:conda",
4
- "python-envs.pythonProjects": []
5
- }
File without changes
File without changes
File without changes