Skip to content

Commit 94695b1

Browse files
ruiqwygithub-actions[bot]
authored andcommitted
🎨 Format Python code with Black
1 parent c7e4c1d commit 94695b1

40 files changed

+5183
-2070
lines changed

BiFuncLib/AuxFunc.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,27 @@
66

77

88
class AuxFunc:
9-
def __init__(self, n, m = None, x = None, V = None):
9+
def __init__(self, n, m=None, x=None, V=None):
1010
self.n = n
1111
self.m = m if m is not None else None
1212
self.x = np.array(x) if x is not None else None
1313
self.V = np.array(V) if V is not None else None
1414

1515
# Generate break sequence in spline expansion
1616
def knots_eq(self):
17-
return np.r_[self.x.min(), np.linspace(self.x.min(), self.x.max(), self.m+2)[1:-1], self.x.max()]
17+
return np.r_[
18+
self.x.min(),
19+
np.linspace(self.x.min(), self.x.max(), self.m + 2)[1:-1],
20+
self.x.max(),
21+
]
1822

1923
# Construct the adjacency matrix
20-
def create_adjacency(self, plot = True):
24+
def create_adjacency(self, plot=True):
2125
differences = np.linalg.norm(self.V, axis=0)
2226
connected_ix = np.where(differences == 0)[0]
2327
index = pd.DataFrame(itertools.combinations(range(self.n), 2))
24-
i = index.iloc[list(connected_ix),0]
25-
j = index.iloc[list(connected_ix),1]
28+
i = index.iloc[list(connected_ix), 0]
29+
j = index.iloc[list(connected_ix), 1]
2630
A = lil_matrix((self.n, self.n))
2731
A[i, j] = 1
2832
if plot == True:
@@ -31,4 +35,3 @@ def create_adjacency(self, plot = True):
3135
plt.show()
3236
A_array = A.toarray()
3337
return A_array
34-

BiFuncLib/BiclustResult.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ def __init__(self, params, RowxNumber, NumberxCol, Number, info):
99
self.Number = Number
1010
self.info = info
1111
self.cluster_row_sizes = np.sum(RowxNumber, axis=0)
12-
self.cluster_col_sizes = np.sum(NumberxCol, axis=0)
12+
self.cluster_col_sizes = np.sum(NumberxCol, axis=0)

BiFuncLib/BsplineFunc.py

Lines changed: 247 additions & 151 deletions
Large diffs are not rendered by default.

BiFuncLib/FDPlot.py

Lines changed: 560 additions & 233 deletions
Large diffs are not rendered by default.

BiFuncLib/__init__.py

Lines changed: 75 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
1-
from .simulation_data import pf_sim_data,local_sim_data,cc_sim_data,lbm_sim_data
2-
from .simulation_data import sas_sim_data,sparse_sim_data,cvx_sim_data,ssvd_sim_data
1+
from .simulation_data import (
2+
pf_sim_data,
3+
local_sim_data,
4+
cc_sim_data,
5+
lbm_sim_data,
6+
)
7+
from .simulation_data import (
8+
sas_sim_data,
9+
sparse_sim_data,
10+
cvx_sim_data,
11+
ssvd_sim_data,
12+
)
313
from .BsplineFunc import BsplineFunc
414
from .BiclustResult import BiclustResult
515
from .bcheatmap import bcheatmap
616
from .fem_bifunc import fem_bifunc
7-
from .sparse_main_func import FKMSparseClustering_permute, FKMSparseClustering, cer
17+
from .sparse_main_func import (
18+
FKMSparseClustering_permute,
19+
FKMSparseClustering,
20+
cer,
21+
)
822
from .fem_main_func import fem_main_func
923
from .AuxFunc import AuxFunc
1024
from .pf_main_func import inv_uty_cal, beta_ini_cal, biclustr_admm
11-
from .cvx_main_func import gkn_weights, cobra_validate, cobra_pod, biclust_smooth
25+
from .cvx_main_func import (
26+
gkn_weights,
27+
cobra_validate,
28+
cobra_pod,
29+
biclust_smooth,
30+
)
1231
from .ssvd_main_func import ssvd_bc, s4vd, jaccardmat
13-
from .cc_main_func import template_evaluation, medoid_evaluation, warping_function_plot
32+
from .cc_main_func import (
33+
template_evaluation,
34+
medoid_evaluation,
35+
warping_function_plot,
36+
)
1437
from .bimax_biclus import bimax_biclus
1538
from .cc_main_func import bigcc_fun, evaluate_mat_dist, ccscore_fun
1639
from .sas_main_func import sasfclust_init, loglik, get_msdrule, get_zero
@@ -19,12 +42,50 @@
1942
from .lbm_main_func import lbm_main_func
2043

2144

22-
__all__ = ['pf_sim_data', 'local_sim_data', 'cc_sim_data', 'lbm_sim_data', 'sas_sim_data',
23-
'sparse_sim_data', 'cvx_sim_data', 'ssvd_sim_data', 'BsplineFunc', 'fem_bifunc',
24-
'FKMSparseClustering_permute', 'FKMSparseClustering', 'cer', 'fem_main_func',
25-
'AuxFunc', 'inv_uty_cal', 'beta_ini_cal', 'biclustr_admm', 'gkn_weights',
26-
'cobra_validate', 'cobra_pod', 'biclust_smooth', 'ssvd_bc', 's4vd', 'bcheatmap',
27-
'jaccardmat', 'template_evaluation', 'medoid_evaluation', 'warping_function_plot',
28-
'bimax_biclus', 'bigcc_fun', 'evaluate_mat_dist', 'ccscore_fun', 'sasfclust_init',
29-
'loglik', 'get_msdrule', 'get_zero', 'sasfclust_Mstep', 'sasfclust_Estep', 'classify',
30-
'calculate_gcv', 'calculate_bic', 'local_admm', 'lbm_main_func', 'BiclustResult']
45+
__all__ = [
46+
"pf_sim_data",
47+
"local_sim_data",
48+
"cc_sim_data",
49+
"lbm_sim_data",
50+
"sas_sim_data",
51+
"sparse_sim_data",
52+
"cvx_sim_data",
53+
"ssvd_sim_data",
54+
"BsplineFunc",
55+
"fem_bifunc",
56+
"FKMSparseClustering_permute",
57+
"FKMSparseClustering",
58+
"cer",
59+
"fem_main_func",
60+
"AuxFunc",
61+
"inv_uty_cal",
62+
"beta_ini_cal",
63+
"biclustr_admm",
64+
"gkn_weights",
65+
"cobra_validate",
66+
"cobra_pod",
67+
"biclust_smooth",
68+
"ssvd_bc",
69+
"s4vd",
70+
"bcheatmap",
71+
"jaccardmat",
72+
"template_evaluation",
73+
"medoid_evaluation",
74+
"warping_function_plot",
75+
"bimax_biclus",
76+
"bigcc_fun",
77+
"evaluate_mat_dist",
78+
"ccscore_fun",
79+
"sasfclust_init",
80+
"loglik",
81+
"get_msdrule",
82+
"get_zero",
83+
"sasfclust_Mstep",
84+
"sasfclust_Estep",
85+
"classify",
86+
"calculate_gcv",
87+
"calculate_bic",
88+
"local_admm",
89+
"lbm_main_func",
90+
"BiclustResult",
91+
]

0 commit comments

Comments
 (0)