Skip to content

Commit

Permalink
ftr
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisrkckl committed Jan 21, 2025
1 parent 02bb5c6 commit d78054d
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions src/pint/fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,13 @@ def fit_toas(


class WidebandState(ModelState):
def __init__(self, fitter, model, full_cov=False, threshold=None):
def __init__(
self,
fitter: Fitter,
model: TimingModel,
full_cov: bool = False,
threshold: Optional[float] = None,
):
super().__init__(fitter, model)
self.threshold = threshold
self.full_cov = full_cov
Expand Down Expand Up @@ -1835,7 +1841,14 @@ class WidebandDownhillFitter(DownhillFitter):

# FIXME: do something clever to efficiently compute chi-squared

def __init__(self, toas, model, track_mode=None, residuals=None, add_args=None):
def __init__(
self,
toas,
model,
track_mode: Optional[Literal["use_pulse_numbers", "nearest"]] = None,
residuals=None,
add_args=None,
):
self.method = "downhill_wideband"
self.full_cov = False
self.threshold = 0
Expand Down Expand Up @@ -1927,7 +1940,13 @@ class PowellFitter(Fitter):
may serve as an example of how to write your own fitting procedure.
"""

def __init__(self, toas, model, track_mode=None, residuals=None):
def __init__(
self,
toas,
model,
track_mode: Optional[Literal["use_pulse_numbers", "nearest"]] = None,
residuals=None,
):
super().__init__(toas, model, residuals=residuals, track_mode=track_mode)
self.method = "Powell"

Expand Down Expand Up @@ -1973,7 +1992,13 @@ class WLSFitter(Fitter):
close enough that the derivatives are a good approximation.
"""

def __init__(self, toas, model, track_mode=None, residuals=None):
def __init__(
self,
toas,
model,
track_mode: Optional[Literal["use_pulse_numbers", "nearest"]] = None,
residuals=None,
):
super().__init__(
toas=toas, model=model, residuals=residuals, track_mode=track_mode
)
Expand Down Expand Up @@ -2112,7 +2137,13 @@ class GLSFitter(Fitter):
the data covariance matrix.
"""

def __init__(self, toas=None, model=None, track_mode=None, residuals=None):
def __init__(
self,
toas: TOAs = None,
model: TimingModel = None,
track_mode: Optional[Literal["use_pulse_numbers", "nearest"]] = None,
residuals=None,
):
super().__init__(
toas=toas, model=model, residuals=residuals, track_mode=track_mode
)
Expand Down Expand Up @@ -2333,7 +2364,7 @@ def __init__(
fit_data,
model,
fit_data_names=["toa", "dm"],
track_mode=None,
track_mode: Optional[Literal["use_pulse_numbers", "nearest"]] = None,
additional_args={},
):
self.model_init = model
Expand Down

0 comments on commit d78054d

Please sign in to comment.