From c15fb019ef0acb5af7963c8441b10f456307c278 Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Tue, 24 Oct 2023 09:16:32 -0400 Subject: [PATCH] Hopefully final tweaks to numpy-style docstrings --- galpy/potential/DissipativeForce.py | 2 +- galpy/potential/Potential.py | 60 ++++++++++++++--------------- galpy/potential/plotEscapecurve.py | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/galpy/potential/DissipativeForce.py b/galpy/potential/DissipativeForce.py index 2288ed1e3..4f5f833e3 100644 --- a/galpy/potential/DissipativeForce.py +++ b/galpy/potential/DissipativeForce.py @@ -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. diff --git a/galpy/potential/Potential.py b/galpy/potential/Potential.py index c5f0a17ce..9f4244bef 100644 --- a/galpy/potential/Potential.py +++ b/galpy/potential/Potential.py @@ -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( @@ -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) @@ -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) @@ -1101,7 +1101,7 @@ def plotDensity( Notes ----- - - 2014-01-05: Written - Bovy (IAS) + - 2014-01-05 - Written - Bovy (IAS) """ return plotDensities( @@ -1178,7 +1178,7 @@ def plotSurfaceDensity( Notes ----- - - 2020-08-19: Written - Bovy (UofT) + - 2020-08-19 - Written - Bovy (UofT) """ return plotSurfaceDensities( @@ -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)) @@ -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 ( @@ -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) @@ -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( @@ -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)) @@ -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) @@ -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( @@ -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 @@ -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 @@ -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) @@ -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( @@ -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): @@ -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) @@ -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) @@ -1638,7 +1638,7 @@ def conc( Notes ----- - - 2014-04-03: Written - Bovy (IAS) + - 2014-04-03 - Written - Bovy (IAS) """ if ro is None: @@ -1675,7 +1675,7 @@ def nemo_accname(self): Notes ----- - - 2014-12-18: Written - Bovy (IAS) + - 2014-12-18 - Written - Bovy (IAS) """ try: @@ -1703,7 +1703,7 @@ def nemo_accpars(self, vo, ro): Notes ----- - - 2014-12-18: Written - Bovy (IAS) + - 2014-12-18 - Written - Bovy (IAS) """ try: @@ -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:: @@ -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: @@ -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) @@ -2819,7 +2819,7 @@ def plotPotentials( Notes ----- - - 2010-07-09: Written by Bovy (NYU). + - 2010-07-09 - Written by Bovy (NYU). See Also -------- @@ -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): diff --git a/galpy/potential/plotEscapecurve.py b/galpy/potential/plotEscapecurve.py index 53897bd32..5b5770d7b 100644 --- a/galpy/potential/plotEscapecurve.py +++ b/galpy/potential/plotEscapecurve.py @@ -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?