Skip to content

Commit

Permalink
Go back to turning all physical outputs on when calling turn_physical…
Browse files Browse the repository at this point in the history
…_on, except of a parameter is explicitly set to False
  • Loading branch information
jobovy committed Apr 22, 2020
1 parent 7c60fe4 commit 8b23dd6
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 34 deletions.
10 changes: 5 additions & 5 deletions galpy/actionAngle/actionAngle.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,19 @@ def turn_physical_on(self,ro=None,vo=None):
2016-06-05 - Written - Bovy (UofT)
2020-04-22 - Only turn on the parameter (ro,vo) given - Bovy (UofT)
2020-04-22 - Don't turn on a parameter when it is False - Bovy (UofT)
"""
if not ro is None:
if not ro is False: self._roSet= True
if not vo is False: self._voSet= True
if not ro is None and ro:
if _APY_LOADED and isinstance(ro,units.Quantity):
ro= ro.to(units.kpc).value
self._ro= ro
self._roSet= True
if not vo is None:
if not vo is None and vo:
if _APY_LOADED and isinstance(vo,units.Quantity):
vo= vo.to(units.km/units.s).value
self._vo= vo
self._voSet= True
return None

def _parse_eval_args(self,*args,**kwargs):
Expand Down
10 changes: 5 additions & 5 deletions galpy/df/df.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ def turn_physical_on(self,ro=None,vo=None):
2016-06-05 - Written - Bovy (UofT)
2020-04-22 - Only turn on the parameter (ro,vo) given - Bovy (UofT)
2020-04-22 - Don't turn on a parameter when it is False - Bovy (UofT)
"""
if not ro is None:
if not ro is False: self._roSet= True
if not vo is False: self._voSet= True
if not ro is None and ro:
if _APY_LOADED and isinstance(ro,units.Quantity):
ro= ro.to(units.kpc).value
self._ro= ro
self._roSet= True
if not vo is None:
if not vo is None and vo:
if _APY_LOADED and isinstance(vo,units.Quantity):
vo= vo.to(units.km/units.s).value
self._vo= vo
self._voSet= True
return None
10 changes: 5 additions & 5 deletions galpy/orbit/Orbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,19 +1022,19 @@ def turn_physical_on(self,ro=None,vo=None):
2019-02-28 - Written - Bovy (UofT)
2020-04-22 - Only turn on the parameter (ro,vo) given - Bovy (UofT)
2020-04-22 - Don't turn on a parameter when it is False - Bovy (UofT)
"""
if not ro is None:
if not ro is False: self._roSet= True
if not vo is False: self._voSet= True
if not ro is None and ro:
if _APY_LOADED and isinstance(ro,units.Quantity):
ro= ro.to(units.kpc).value
self._ro= ro
self._roSet= True
if not vo is None:
if not vo is None and vo:
if _APY_LOADED and isinstance(vo,units.Quantity):
vo= vo.to(units.km/units.s).value
self._vo= vo
self._voSet= True
return None

def integrate(self,t,pot,method='symplec4_c',dt=None,numcores=_NUMCORES,
Expand Down
10 changes: 5 additions & 5 deletions galpy/potential/Force.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,19 +282,19 @@ def turn_physical_on(self,ro=None,vo=None):
2016-01-30 - Written - Bovy (UofT)
2020-04-22 - Only turn on the parameter (ro,vo) given - Bovy (UofT)
2020-04-22 - Don't turn on a parameter when it is False - Bovy (UofT)
"""
if not ro is None:
if not ro is False: self._roSet= True
if not vo is False: self._voSet= True
if not ro is None and ro:
if _APY_LOADED and isinstance(ro,units.Quantity):
ro= ro.to(units.kpc).value
self._ro= ro
self._roSet= True
if not vo is None:
if not vo is None and vo:
if _APY_LOADED and isinstance(vo,units.Quantity):
vo= vo.to(units.km/units.s).value
self._vo= vo
self._voSet= True
return None

@potential_physical_input
Expand Down
8 changes: 4 additions & 4 deletions galpy/potential/WrapperPotential.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def __init__(self,amp=1.,pot=None,ro=None,vo=None,_init=None,**kwargs):
# Transfer unit system if set for wrapped potential, but not here
phys_wrapped= get_physical(self._pot,include_set=True)
if not self._roSet and phys_wrapped['roSet']:
self.turn_physical_on(ro=phys_wrapped['ro'])
self.turn_physical_on(ro=phys_wrapped['ro'],vo=False)
if not self._voSet and phys_wrapped['voSet']:
self.turn_physical_on(vo=phys_wrapped['vo'])
self.turn_physical_on(vo=phys_wrapped['vo'],ro=False)

def __repr__(self):
wrapped_repr= repr(self._pot)
Expand Down Expand Up @@ -166,9 +166,9 @@ def __init__(self,amp=1.,pot=None,ro=None,vo=None,_init=None,**kwargs):
# Transfer unit system if set for wrapped potential, but not here
phys_wrapped= get_physical(self._pot,include_set=True)
if not self._roSet and phys_wrapped['roSet']:
self.turn_physical_on(ro=phys_wrapped['ro'])
self.turn_physical_on(ro=phys_wrapped['ro'],vo=False)
if not self._voSet and phys_wrapped['voSet']:
self.turn_physical_on(vo=phys_wrapped['vo'])
self.turn_physical_on(vo=phys_wrapped['vo'],ro=False)

def __repr__(self):
wrapped_repr= repr(self._pot)
Expand Down
10 changes: 5 additions & 5 deletions galpy/potential/linearPotential.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,19 @@ def turn_physical_on(self,ro=None,vo=None):
2016-01-30 - Written - Bovy (UofT)
2020-04-22 - Only turn on the parameter (ro,vo) given - Bovy (UofT)
2020-04-22 - Don't turn on a parameter when it is False - Bovy (UofT)
"""
if not ro is None:
if not ro is False: self._roSet= True
if not vo is False: self._voSet= True
if not ro is None and ro:
if _APY_LOADED and isinstance(ro,units.Quantity):
ro= ro.to(units.kpc).value
self._ro= ro
self._roSet= True
if not vo is None:
if not vo is None and vo:
if _APY_LOADED and isinstance(vo,units.Quantity):
vo= vo.to(units.km/units.s).value
self._vo= vo
self._voSet= True
return None

@potential_physical_input
Expand Down
10 changes: 5 additions & 5 deletions galpy/potential/planarPotential.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,19 @@ def turn_physical_on(self,ro=None,vo=None):
2016-01-30 - Written - Bovy (UofT)
2020-04-22 - Only turn on the parameter (ro,vo) given - Bovy (UofT)
2020-04-22 - Don't turn on a parameter when it is False - Bovy (UofT)
"""
if not ro is None:
if not ro is False: self._roSet= True
if not vo is False: self._voSet= True
if not ro is None and ro:
if _APY_LOADED and isinstance(ro,units.Quantity):
ro= ro.to(units.kpc).value
self._ro= ro
self._roSet= True
if not vo is None:
if not vo is None and vo:
if _APY_LOADED and isinstance(vo,units.Quantity):
vo= vo.to(units.km/units.s).value
self._vo= vo
self._voSet= True
return None

@potential_physical_input
Expand Down

0 comments on commit 8b23dd6

Please sign in to comment.