Skip to content

Commit

Permalink
Modernize docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
kfindeisen committed Apr 13, 2017
1 parent bf5f987 commit d13b270
Showing 1 changed file with 39 additions and 17 deletions.
56 changes: 39 additions & 17 deletions tests/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ def makeRawPointData(nAxes, delta=0.123):
def makeEndpoint(name, nAxes):
"""Make an endpoint
@param[in] name one of "Generic", "Point2", "Point3" or "SpherePoint"
@param[in] nAxes number of axes; ignored if the name is not "Generic"
Parameters
----------
name : string
one of "Generic", "Point2", "Point3" or "SpherePoint"
nAxes : integer
number of axes; ignored if the name is not "Generic"
"""
endpointClassName = name + "Endpoint"
endpointClass = getattr(afwGeom, endpointClassName)
Expand All @@ -59,16 +63,23 @@ def makeEndpoint(name, nAxes):
def makeGoodFrame(name, nAxes):
"""Return the appropriate frame for the given name and nAxes
@param[in] name one of "Generic", "Point2", "Point3" or "SpherePoint"
@param[in] nAxes number of axes; ignored if the name is not "Generic"
Parameters
----------
name : string
one of "Generic", "Point2", "Point3" or "SpherePoint"
nAxes : integer
number of axes; ignored if the name is not "Generic"
"""
return makeEndpoint(name, nAxes).makeFrame()


def makeBadFrames(name):
"""Return a list of 0 or more frames that are not a valid match for the named endpoint
@param[in] name one of "Generic", "Point2", "Point3" or "SpherePoint"
Parameters
----------
name : string
one of "Generic", "Point2", "Point3" or "SpherePoint"
"""
if name == "Generic":
return []
Expand Down Expand Up @@ -109,8 +120,12 @@ def makeFrameSet(baseFrame, currFrame):
- nOut = currFrame.getNaxes()
- polyMap = makeTwoWayPolyMap(nIn, nOut)
@param[in] baseFrame base frame
@param[in] currFrame current frame
Parameters
----------
baseFrame : astshim.Frame
base frame
currFrame : astshim.Frame
current frame
"""
nIn = baseFrame.getNaxes()
nOut = currFrame.getNaxes()
Expand Down Expand Up @@ -224,12 +239,17 @@ def setUp(self):
def checkTransformation(self, transform, mapping, msg=""):
"""Check tranForward and tranInverse for a transform
@param[in] transform The transform to check
@param[in] mapping The mapping the transform should use. This mapping
must contain valid forward or inverse transformations,
but they need not match if both present. Hence the
mappings returned by make*PolyMap are acceptable.
@param[in] msg Error message suffix describing test parameters
Parameters
----------
transform : Transform
The transform to check
mapping : astshim.Mapping
The mapping the transform should use. This mapping
must contain valid forward or inverse transformations,
but they need not match if both present. Hence the
mappings returned by make*PolyMap are acceptable.
msg : string
Error message suffix describing test parameters
"""
fromEndpoint = transform.getFromEndpoint()
toEndpoint = transform.getToEndpoint()
Expand Down Expand Up @@ -355,10 +375,12 @@ def checkInverseTransformation(self, forward, inverse, msg=""):
def checkTransformFromMapping(self, fromName, toName):
"""Check a Transform_<fromName>_<toName> using the Mapping constructor
fromName: one of Namelist
toName one of NameList
fromAxes number of axes in fromFrame
toAxes number of axes in toFrame
Parameters
----------
fromName, toName : string
one of NameList
fromAxes, toAxes : integer
number of axes in fromFrame and toFrame, respectively
"""
transformClassName = "Transform{}To{}".format(fromName, toName)
transformClass = getattr(afwGeom, transformClassName)
Expand Down

0 comments on commit d13b270

Please sign in to comment.