From 2a2e10f1ce2490aa9f30fca15a8da949b0d5425e Mon Sep 17 00:00:00 2001 From: Matthew Pitkin Date: Wed, 6 Feb 2019 11:47:55 +0000 Subject: [PATCH] More fixes --- pint/models/spindown.py | 7 +------ pint/models/timing_model.py | 16 +--------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/pint/models/spindown.py b/pint/models/spindown.py index fa3034fa32..6deb36b8fb 100644 --- a/pint/models/spindown.py +++ b/pint/models/spindown.py @@ -29,8 +29,6 @@ def __init__(self): unit_template=self.F_unit, description_template=self.F_description, type_match='float', long_double=True)) - self.add_param(p.strParameter(name="UNITS", - description="Units", value='TDB')) self.add_param(p.MJDParameter(name="PEPOCH", description="Reference epoch for spin-down", time_scale='tdb')) @@ -42,13 +40,10 @@ def __init__(self): def setup(self): super(Spindown, self).setup() # Check for required params - for p in ("F0", "UNITS"): + for p in ("F0",): if getattr(self, p).value is None: raise MissingParameter("Spindown", p) - if self.UNITS.value not in ['TCB', 'TDB']: - raise ValueError("'UNITS' must be 'TDB' or 'TCB'") - if self.PEPOCH.value is not None: # set the units self.PEPOCH.scale = self.UNITS.value.lower() diff --git a/pint/models/timing_model.py b/pint/models/timing_model.py index b91dc18cc6..fc06d6e31b 100644 --- a/pint/models/timing_model.py +++ b/pint/models/timing_model.py @@ -96,7 +96,7 @@ def __init__(self, name='', components=[]): self.add_param_from_top(strParameter(name="EPHEM", description="Ephemeris to use"), '') self.add_param_from_top(strParameter(name="UNITS", - description="Units (TDB assumed)"), '') + description="Units", value="TDB"), '') # defaults to TDB if not given self.setup_components(components) @@ -1100,15 +1100,6 @@ def __init__(self,): super(DelayComponent, self).__init__() self.delay_funcs_component = [] - # add 'UNITS' parameter for DelayComponents (defaulting to TDB) - self.add_param(strParameter(name="UNITS", - description="Units", value='TDB')) - - def setup(self): - super(DelayComponent, self).setup() - if self.UNITS.value not in ['TDB', 'TCB']: - raise MissingParameter("'UNITS' must be 'TDB' or 'TCB'") - class PhaseComponent(Component): def __init__(self,): @@ -1116,11 +1107,6 @@ def __init__(self,): self.phase_funcs_component = [] self.phase_derivs_wrt_delay = [] - def setup(self): - super(PhaseComponent, self).setup() - if self.UNITS.value not in ['TDB', 'TCB']: - raise MissingParameter("'UNITS' must be 'TDB' or 'TCB'") - class TimingModelError(Exception): """Generic base class for timing model errors."""