88import numpy as np
99
1010from como .data_types import LogLevel
11- from como .utils import _log_and_raise_error , stringlist_to_list
11+ from como .utils import log_and_raise_error , stringlist_to_list
1212
1313
1414@dataclass
@@ -35,35 +35,35 @@ def __post_init__(self): # noqa: C901, ignore too complex
3535 self .seed = np .random .randint (0 , 100_000 )
3636
3737 if (isdigit (self .min_active_count ) and int (self .min_active_count ) < 0 ) or self .min_active_count != "default" :
38- _log_and_raise_error (
38+ log_and_raise_error (
3939 "min_active_count must be either 'default' or an integer > 0" ,
4040 error = ValueError ,
4141 level = LogLevel .ERROR ,
4242 )
4343
4444 if (isdigit (self .quantile ) and 0 > int (self .quantile ) > 100 ) or self .quantile != "default" :
45- _log_and_raise_error (
45+ log_and_raise_error (
4646 "quantile must be either 'default' or an integer between 0 and 100" ,
4747 error = ValueError ,
4848 level = LogLevel .ERROR ,
4949 )
5050
5151 if (isdigit (self .replicate_ratio ) and 0 > self .replicate_ratio > 1.0 ) or self .replicate_ratio != "default" :
52- _log_and_raise_error (
52+ log_and_raise_error (
5353 "--rep-ratio must be either 'default' or a float between 0 and 1" ,
5454 error = ValueError ,
5555 level = LogLevel .ERROR ,
5656 )
5757
5858 if (isdigit (self .batch_ratio ) and 0 > self .batch_ratio > 1.0 ) or self .batch_ratio != "default" :
59- _log_and_raise_error (
59+ log_and_raise_error (
6060 "--batch-ratio must be either 'default' or a float between 0 and 1" ,
6161 error = ValueError ,
6262 level = LogLevel .ERROR ,
6363 )
6464
6565 if self .filtering_technique .lower () not in {"quantile" , "tpm" , "cpm" , "zfpkm" }:
66- _log_and_raise_error (
66+ log_and_raise_error (
6767 "--technique must be either 'quantile', 'tpm', 'cpm', 'zfpkm'" ,
6868 error = ValueError ,
6969 level = LogLevel .ERROR ,
@@ -73,35 +73,35 @@ def __post_init__(self): # noqa: C901, ignore too complex
7373 self .filtering_technique = "quantile"
7474
7575 if self .cluster_algorithm .lower () not in {"mca" , "umap" }:
76- _log_and_raise_error (
76+ log_and_raise_error (
7777 "--clust_algo must be either 'mca', 'umap'" ,
7878 error = ValueError ,
7979 level = LogLevel .ERROR ,
8080 )
8181
8282 if 0 > self .min_distance > 1.0 :
83- _log_and_raise_error (
83+ log_and_raise_error (
8484 "--min_dist must be a float between 0 and 1" ,
8585 error = ValueError ,
8686 level = LogLevel .ERROR ,
8787 )
8888
8989 if (isdigit (self .num_replicate_neighbors ) and self .num_replicate_neighbors < 1 ) or self .num_replicate_neighbors != "default" :
90- _log_and_raise_error (
90+ log_and_raise_error (
9191 "--n-neighbors-rep must be either 'default' or an integer > 1" ,
9292 error = ValueError ,
9393 level = LogLevel .ERROR ,
9494 )
9595
9696 if (isdigit (self .num_batch_neighbors ) and self .num_batch_neighbors < 1 ) or self .num_batch_neighbors != "default" :
97- _log_and_raise_error (
97+ log_and_raise_error (
9898 "--n-neighbors-batch must be either 'default' or an integer > 1" ,
9999 error = ValueError ,
100100 level = LogLevel .ERROR ,
101101 )
102102
103103 if (isdigit (self .num_context_neighbors ) and self .num_context_neighbors < 1 ) or self .num_context_neighbors != "default" :
104- _log_and_raise_error (
104+ log_and_raise_error (
105105 "--n-neighbors-context must be either 'default' or an integer > 1" ,
106106 error = ValueError ,
107107 level = LogLevel .ERROR ,
0 commit comments