Skip to content

Commit 0942ac9

Browse files
committed
simplify init for CovModel
1 parent 8b5d8b0 commit 0942ac9

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

src/mrtool/core/cov_model.py

+10-15
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,11 @@ def create_z_mat(self, data):
567567

568568
def create_constraint_mat(self) -> tuple[NDArray, NDArray]:
569569
"""Create constraint matrix.
570-
Returns:
571-
tuple{numpy.ndarray, numpy.ndarray}:
572-
Return linear constraints matrix and its uniform prior.
570+
Returns
571+
-------
572+
tuple[NDArray, NDArray]
573+
Return linear constraints matrix and its uniform prior.
574+
573575
"""
574576
# initialize the matrix and the value
575577
c_mat = np.array([]).reshape(0, self.num_x_vars)
@@ -682,9 +684,11 @@ def create_constraint_mat(self) -> tuple[NDArray, NDArray]:
682684

683685
def create_regularization_mat(self) -> tuple[NDArray, NDArray]:
684686
"""Create constraint matrix.
685-
Returns:
686-
tuple{numpy.ndarray, numpy.ndarray}:
687-
Return linear regularization matrix and its Gaussian prior.
687+
Returns
688+
-------
689+
tuple[NDArray, NDArray]
690+
Return linear regularization matrix and its Gaussian prior.
691+
688692
"""
689693
r_mat = np.array([]).reshape(0, self.num_x_vars)
690694
r_val = np.array([]).reshape(2, 0)
@@ -813,9 +817,6 @@ def num_regularizations(self):
813817
class LinearCovModel(CovModel):
814818
"""Linear Covariates Model."""
815819

816-
def __init__(self, *args, **kwargs):
817-
super().__init__(*args, **kwargs)
818-
819820
def create_x_fun(self, data: MRData):
820821
"""Create design function for the fixed effects."""
821822
alt_mat, ref_mat = self.create_design_mat(data)
@@ -855,12 +856,6 @@ def create_z_mat(self, data):
855856
class LogCovModel(CovModel):
856857
"""Log Covariates Model."""
857858

858-
def __init__(self, *args, **kwargs):
859-
super().__init__(*args, **kwargs)
860-
# if self.use_spline_intercept:
861-
# raise ValueError("LogCovModel does not support use_spline_intercept."
862-
# "Please set it to False, or leave it as default.")
863-
864859
def create_x_fun(self, data):
865860
"""Create design functions for the fixed effects.
866861

0 commit comments

Comments
 (0)