Skip to content

Commit

Permalink
Hopefully final tweaks to numpy-style docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed Oct 24, 2023
1 parent 0de0611 commit c15fb01
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion galpy/potential/DissipativeForce.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class DissipativeForce(Force):
"""Top-level class for non-conservative forces (cannot be derived from a potential function)"""

def __init__(self, amp, ro=None, vo=None, amp_units=None):
def __init__(self, amp=1.0, ro=None, vo=None, amp_units=None):
"""
Initialize a DissipativeForce object.
Expand Down
60 changes: 30 additions & 30 deletions galpy/potential/Potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ def _surfdens(self, R, z, phi=0.0, t=0.0):
Notes
-----
- 2018-08-19: Written by Bovy (UofT).
- 2021-04-19: Adjusted for non-z-symmetric densities by Bovy (UofT).
- 2018-08-19 - Written - Bovy (UofT).
- 2021-04-19 - Adjusted for non-z-symmetric densities by Bovy (UofT).
"""
return integrate.quad(
Expand Down Expand Up @@ -742,7 +742,7 @@ def phitorque(self, R, z, phi=0.0, t=0.0):
Notes
-----
- 2010-07-10: Written by Bovy (NYU)
- 2010-07-10 - Written - Bovy (NYU)
"""
return self._phitorque_nodecorator(R, z, phi=phi, t=t)

Expand Down Expand Up @@ -816,7 +816,7 @@ def Rphideriv(self, R, z, phi=0.0, t=0.0):
Notes
-----
- 2014-06-30: Written by Bovy (IAS)
- 2014-06-30 - Written - Bovy (IAS)
"""
try:
return self._amp * self._Rphideriv(R, z, phi=phi, t=t)
Expand Down Expand Up @@ -1101,7 +1101,7 @@ def plotDensity(
Notes
-----
- 2014-01-05: Written - Bovy (IAS)
- 2014-01-05 - Written - Bovy (IAS)
"""
return plotDensities(
Expand Down Expand Up @@ -1178,7 +1178,7 @@ def plotSurfaceDensity(
Notes
-----
- 2020-08-19: Written - Bovy (UofT)
- 2020-08-19 - Written - Bovy (UofT)
"""
return plotSurfaceDensities(
Expand Down Expand Up @@ -1221,8 +1221,8 @@ def vcirc(self, R, phi=None, t=0.0):
Notes
-----
- 2011-10-09: Written - Bovy (IAS)
- 2016-06-15: Added phi= keyword for non-axisymmetric potential - Bovy (UofT)
- 2011-10-09 - Written - Bovy (IAS)
- 2016-06-15 - Added phi= keyword for non-axisymmetric potential - Bovy (UofT)
"""
return numpy.sqrt(R * -self.Rforce(R, 0.0, phi=phi, t=t, use_physical=False))
Expand All @@ -1249,8 +1249,8 @@ def dvcircdR(self, R, phi=None, t=0.0):
Notes
-----
- 2013-01-08: Written - Bovy (IAS)
- 2016-06-28: Added phi= keyword for non-axisymmetric potential - Bovy (UofT)
- 2013-01-08 - Written - Bovy (IAS)
- 2016-06-28 - Added phi= keyword for non-axisymmetric potential - Bovy (UofT)
"""
return (
Expand Down Expand Up @@ -1282,7 +1282,7 @@ def omegac(self, R, t=0.0):
Notes
-----
- 2011-10-09: Written - Bovy (IAS)
- 2011-10-09 - Written - Bovy (IAS)
"""
return numpy.sqrt(-self.Rforce(R, 0.0, t=t, use_physical=False) / R)
Expand All @@ -1307,7 +1307,7 @@ def epifreq(self, R, t=0.0):
Notes
-----
- 2011-10-09: Written - Bovy (IAS)
- 2011-10-09 - Written - Bovy (IAS)
"""
return numpy.sqrt(
Expand Down Expand Up @@ -1335,7 +1335,7 @@ def verticalfreq(self, R, t=0.0):
Notes
-----
- 2012-07-25: Written - Bovy (IAS@MPIA)
- 2012-07-25 - Written - Bovy (IAS@MPIA)
"""
return numpy.sqrt(self.z2deriv(R, 0.0, t=t, use_physical=False))
Expand Down Expand Up @@ -1365,7 +1365,7 @@ def lindbladR(self, OmegaP, m=2, t=0.0, **kwargs):
Notes
-----
- 2011-10-09: Written - Bovy (IAS)
- 2011-10-09 - Written - Bovy (IAS)
"""
OmegaP = conversion.parse_frequency(OmegaP, ro=self._ro, vo=self._vo)
Expand All @@ -1391,7 +1391,7 @@ def vesc(self, R, t=0.0):
Notes
-----
- Written on 2011-10-09 by Bovy (IAS)
- 2011-10-09 - Written - Bovy (IAS)
"""
return numpy.sqrt(
Expand Down Expand Up @@ -1421,7 +1421,7 @@ def rl(self, lz, t=0.0):
Notes
-----
- 2012-07-30: Written - Bovy (IAS@MPIA)
- 2012-07-30 - Written - Bovy (IAS@MPIA)
- An efficient way to call this function on many objects is provided as the Orbit method rguiding.
See Also
Expand Down Expand Up @@ -1450,7 +1450,7 @@ def rE(self, E, t=0.0):
Notes
-----
- 2022-04-06: Written - Bovy (UofT)
- 2022-04-06 - Written - Bovy (UofT)
- An efficient way to call this function on many objects is provided as the Orbit method rE.
See Also
Expand Down Expand Up @@ -1479,7 +1479,7 @@ def LcE(self, E, t=0.0):
Notes
-----
- 2022-04-06: Written by Bovy (UofT).
- 2022-04-06 - Written - Bovy (UofT).
"""
E = conversion.parse_energy(E, ro=self._ro, vo=self._vo)
Expand Down Expand Up @@ -1507,7 +1507,7 @@ def flattening(self, R, z, t=0.0):
Notes
-----
- 2012-09-13: Written - Bovy (IAS)
- 2012-09-13 - Written - Bovy (IAS)
"""
return numpy.sqrt(
Expand Down Expand Up @@ -1540,7 +1540,7 @@ def vterm(self, l, t=0.0, deg=True):
Notes
-----
- 2013-05-31: Written - Bovy (IAS).
- 2013-05-31 - Written - Bovy (IAS).
"""
if _APY_LOADED and isinstance(l, units.Quantity):
Expand Down Expand Up @@ -1577,7 +1577,7 @@ def plotRotcurve(self, *args, **kwargs):
Notes
-----
- 2010-07-10: Written - Bovy (NYU)
- 2010-07-10 - Written - Bovy (NYU)
"""
return plotRotcurve(self, *args, **kwargs)

Expand All @@ -1603,7 +1603,7 @@ def plotEscapecurve(self, *args, **kwargs):
Notes
-----
- 2010-08-08: Written - Bovy (NYU).
- 2010-08-08 - Written - Bovy (NYU).
"""
return plotEscapecurve(self.toPlanar(), *args, **kwargs)
Expand Down Expand Up @@ -1638,7 +1638,7 @@ def conc(
Notes
-----
- 2014-04-03: Written - Bovy (IAS)
- 2014-04-03 - Written - Bovy (IAS)
"""
if ro is None:
Expand Down Expand Up @@ -1675,7 +1675,7 @@ def nemo_accname(self):
Notes
-----
- 2014-12-18: Written - Bovy (IAS)
- 2014-12-18 - Written - Bovy (IAS)
"""
try:
Expand Down Expand Up @@ -1703,7 +1703,7 @@ def nemo_accpars(self, vo, ro):
Notes
-----
- 2014-12-18: Written - Bovy (IAS)
- 2014-12-18 - Written - Bovy (IAS)
"""
try:
Expand Down Expand Up @@ -1740,7 +1740,7 @@ def rtide(self, R, z, phi=0.0, t=0.0, M=None):
Notes
-----
- 2018-03-21: Written - Webb (UofT)
- 2018-03-21 - Written - Webb (UofT)
- The tidal radius is computed as
.. math::
Expand Down Expand Up @@ -1785,7 +1785,7 @@ def ttensor(self, R, z, phi=0.0, t=0.0, eigenval=False):
Notes
-----
- 2018-03-21: Written - Webb (UofT)
- 2018-03-21 - Written - Webb (UofT)
"""
if self.isNonAxi:
Expand Down Expand Up @@ -1867,7 +1867,7 @@ def zvc(self, R, E, Lz, phi=0.0, t=0.0):
Notes
-----
- 2020-08-20: Written - Bovy (UofT)
- 2020-08-20 - Written - Bovy (UofT)
"""
return zvc(self, R, E, Lz, phi=phi, t=t, use_physical=False)
Expand Down Expand Up @@ -2819,7 +2819,7 @@ def plotPotentials(
Notes
-----
- 2010-07-09: Written by Bovy (NYU).
- 2010-07-09 - Written by Bovy (NYU).
See Also
--------
Expand Down Expand Up @@ -3810,7 +3810,7 @@ def flatten(Pot):
Notes
-----
- 2018-03-14: Written by Bovy (UofT).
- 2018-03-14 - Written - Bovy (UofT).
"""
if isinstance(Pot, Potential):
Expand Down
2 changes: 1 addition & 1 deletion galpy/potential/plotEscapecurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def plotEscapecurve(Pot, *args, **kwargs):
Notes
-----
- 2010-08-08: Written by Bovy (NYU).
- 2010-08-08 - Written by Bovy (NYU).
"""
# Using physical units or not?
Expand Down

0 comments on commit c15fb01

Please sign in to comment.