Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #133 from jhlegarreta/DefineInstanceAttributesInInit
Browse files Browse the repository at this point in the history
ENH: Define instance attributes in ``__init__`` method
  • Loading branch information
oesteban authored Mar 28, 2024
2 parents 284aad8 + ae4a650 commit dbe8719
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/eddymotion/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ def __init__(self, gtab, S0=None, mask=None, b_max=None, **kwargs):
module_name, class_name = model_str.rsplit(".", 1)
self._model = getattr(import_module(module_name), class_name)(_rasb2dipy(gtab), **kwargs)

self._datashape = None
self._models = None

def fit(self, data, n_jobs=None, **kwargs):
"""Fit the model chunk-by-chunk asynchronously"""
n_jobs = n_jobs or 1
Expand Down Expand Up @@ -257,6 +260,7 @@ def __init__(self, **kwargs):
self._th_high = kwargs.get("th_high", 10000)
self._bias = kwargs.get("bias", True)
self._stat = kwargs.get("stat", "median")
self._data = None

def fit(self, data, **kwargs):
"""Calculate the average."""
Expand Down Expand Up @@ -329,6 +333,9 @@ def __init__(self, timepoints=None, xlim=None, n_ctrl=None, mask=None, order=3,
# B-Spline knots
self._t = np.arange(-3, float(self._n_ctrl) + 4, dtype="float32")

self._shape = None
self._coeff = None

def fit(self, data, *args, **kwargs):
"""Fit the model."""
from scipy.interpolate import BSpline
Expand Down

0 comments on commit dbe8719

Please sign in to comment.