M3Drop 0.4.58__tar.gz → 0.4.59__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: M3Drop
3
- Version: 0.4.58
3
+ Version: 0.4.59
4
4
  Summary: A Python implementation of the M3Drop single-cell RNA-seq analysis tool.
5
5
  Home-page: https://github.com/PragalvhaSharma/m3DropNew
6
6
  Author: Tallulah Andrews
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: M3Drop
3
- Version: 0.4.58
3
+ Version: 0.4.59
4
4
  Summary: A Python implementation of the M3Drop single-cell RNA-seq analysis tool.
5
5
  Home-page: https://github.com/PragalvhaSharma/m3DropNew
6
6
  Author: Tallulah Andrews
@@ -22,10 +22,19 @@ from scipy.stats import norm
22
22
  from scipy import sparse
23
23
  from statsmodels.stats.multitest import multipletests
24
24
 
25
- # [FIX] Strict Relative Import
26
- # This ensures that if ControlDeviceCPU fails to load (e.g. missing dependency),
27
- # the real error is shown instead of being masked.
28
- from .ControlDeviceCPU import ControlDevice
25
+ # ==========================================
26
+ # HYBRID IMPORT (PACKAGE VS LOCAL)
27
+ # ==========================================
28
+ try:
29
+ # Case 1: Running as an installed package
30
+ from .ControlDeviceCPU import ControlDevice
31
+ except ImportError:
32
+ # Case 2: Running locally
33
+ try:
34
+ from ControlDeviceCPU import ControlDevice
35
+ except ImportError:
36
+ print("CRITICAL ERROR: 'ControlDeviceCPU.py' not found.")
37
+ sys.exit(1)
29
38
 
30
39
  # ==========================================
31
40
  # NUMBA KERNELS (CPU OPTIMIZED)
@@ -22,8 +22,19 @@ import matplotlib.pyplot as plt
22
22
  from scipy.stats import norm
23
23
  from statsmodels.stats.multitest import multipletests
24
24
 
25
- # Package-compatible import
26
- from .ControlDeviceGPU import ControlDevice
25
+ # ==========================================
26
+ # HYBRID IMPORT (PACKAGE VS LOCAL)
27
+ # ==========================================
28
+ try:
29
+ # Case 1: Running as an installed package (e.g. import m3drop.CoreGPU)
30
+ from .ControlDeviceGPU import ControlDevice
31
+ except ImportError:
32
+ # Case 2: Running locally (e.g. python CoreGPU.py)
33
+ try:
34
+ from ControlDeviceGPU import ControlDevice
35
+ except ImportError:
36
+ print("CRITICAL ERROR: 'ControlDeviceGPU.py' not found.")
37
+ sys.exit(1)
27
38
 
28
39
  # ==========================================
29
40
  # FUSED KERNELS
@@ -14,9 +14,29 @@ import statsmodels.api as sm
14
14
  from scipy.stats import norm
15
15
  from statsmodels.stats.multitest import multipletests
16
16
 
17
- # [FIX] Strict Relative Imports
18
- from .ControlDeviceCPU import ControlDevice
19
- from .CoreCPU import hidden_calc_valsCPU, NBumiFitModelCPU, NBumiFitDispVsMeanCPU, dropout_prob_kernel_cpu
17
+ # ==========================================
18
+ # HYBRID IMPORT (PACKAGE VS LOCAL)
19
+ # ==========================================
20
+
21
+ # [FIX] Hybrid Import: ControlDeviceCPU
22
+ try:
23
+ from .ControlDeviceCPU import ControlDevice
24
+ except ImportError:
25
+ try:
26
+ from ControlDeviceCPU import ControlDevice
27
+ except ImportError:
28
+ print("CRITICAL ERROR: 'ControlDeviceCPU.py' not found.")
29
+ sys.exit(1)
30
+
31
+ # [FIX] Hybrid Import: CoreCPU
32
+ try:
33
+ from .CoreCPU import hidden_calc_valsCPU, NBumiFitModelCPU, NBumiFitDispVsMeanCPU, dropout_prob_kernel_cpu
34
+ except ImportError:
35
+ try:
36
+ from CoreCPU import hidden_calc_valsCPU, NBumiFitModelCPU, NBumiFitDispVsMeanCPU, dropout_prob_kernel_cpu
37
+ except ImportError:
38
+ print("CRITICAL ERROR: 'CoreCPU.py' not found.")
39
+ sys.exit(1)
20
40
 
21
41
  # ==========================================
22
42
  # DIAGNOSTICS & COMPARISON (CPU)
@@ -244,7 +264,7 @@ def NBumiCompareModelsCPU(
244
264
  stats: dict,
245
265
  fit_adjust: dict,
246
266
  mask_filename: str = None,
247
- mode: str = "auto",
267
+ mode: str = "auto",
248
268
  manual_target: int = 3000,
249
269
  suppress_plot=False,
250
270
  plot_filename=None
@@ -13,13 +13,31 @@ from scipy import sparse
13
13
  from scipy import stats
14
14
  import anndata
15
15
 
16
- from .ControlDeviceGPU import ControlDevice
17
- from .CoreGPU import (
18
- hidden_calc_valsGPU,
19
- NBumiFitModelGPU,
20
- NBumiFitDispVsMeanGPU,
21
- dropout_prob_kernel
22
- )
16
+ # ==========================================
17
+ # HYBRID IMPORT (PACKAGE VS LOCAL)
18
+ # ==========================================
19
+ try:
20
+ # Case 1: Package
21
+ from .ControlDeviceGPU import ControlDevice
22
+ from .CoreGPU import (
23
+ hidden_calc_valsGPU,
24
+ NBumiFitModelGPU,
25
+ NBumiFitDispVsMeanGPU,
26
+ dropout_prob_kernel
27
+ )
28
+ except ImportError:
29
+ # Case 2: Local
30
+ try:
31
+ from ControlDeviceGPU import ControlDevice
32
+ from CoreGPU import (
33
+ hidden_calc_valsGPU,
34
+ NBumiFitModelGPU,
35
+ NBumiFitDispVsMeanGPU,
36
+ dropout_prob_kernel
37
+ )
38
+ except ImportError:
39
+ print("CRITICAL ERROR: Dependencies (ControlDeviceGPU, CoreGPU) not found.")
40
+ sys.exit(1)
23
41
 
24
42
  from cupy.sparse import csr_matrix as cp_csr_matrix
25
43
  import scipy.sparse as sp
@@ -16,8 +16,19 @@ except ImportError:
16
16
  print("CRITICAL ERROR: 'numba' not found. Please install it (pip install numba).")
17
17
  sys.exit(1)
18
18
 
19
- # Strict Relative Import
20
- from .ControlDeviceCPU import ControlDevice
19
+ # ==========================================
20
+ # HYBRID IMPORT (PACKAGE VS LOCAL)
21
+ # ==========================================
22
+ try:
23
+ # Case 1: Running as an installed package
24
+ from .ControlDeviceCPU import ControlDevice
25
+ except ImportError:
26
+ # Case 2: Running locally
27
+ try:
28
+ from ControlDeviceCPU import ControlDevice
29
+ except ImportError:
30
+ print("CRITICAL ERROR: 'ControlDeviceCPU.py' not found.")
31
+ sys.exit(1)
21
32
 
22
33
  # ==========================================
23
34
  # NUMBA KERNELS (CPU)
@@ -18,10 +18,14 @@ except ImportError:
18
18
  cupy = None
19
19
  HAS_GPU = False
20
20
 
21
- # Package-compatible import
21
+ # ==========================================
22
+ # HYBRID IMPORT (PACKAGE VS LOCAL)
23
+ # ==========================================
22
24
  try:
25
+ # Case 1: Package
23
26
  from .ControlDeviceGPU import ControlDevice
24
27
  except ImportError:
28
+ # Case 2: Local
25
29
  try:
26
30
  from ControlDeviceGPU import ControlDevice
27
31
  except ImportError:
@@ -367,6 +371,3 @@ def NBumiPearsonResidualsCombinedGPU(
367
371
 
368
372
  if hasattr(adata_in, "file") and adata_in.file is not None: adata_in.file.close()
369
373
  print(f"Total time: {time.perf_counter() - start_time:.2f} seconds.\n")
370
-
371
-
372
-
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="M3Drop", # Name for pip (pip install M3Drop)
8
- version="0.4.58",
8
+ version="0.4.59",
9
9
  author="Tallulah Andrews",
10
10
  author_email="tandrew6@uwo.ca",
11
11
  description="A Python implementation of the M3Drop single-cell RNA-seq analysis tool.",
File without changes
File without changes
File without changes
File without changes
File without changes