Ticket #25 (closed defect: fixed)

Opened 3 years ago

Last modified 7 months ago

changing interface to clDms function

Reported by: perry Assigned to: somebody
Priority: normal Milestone: PyRAF 1.6
Component: none Version: 1.1.2
Severity: trivial Keywords:
Cc:

Description

On Thu, 22 Apr 2004, Phil Hodge wrote:

I have a nit-picking comment.

def clDms(x,digits=1,deg=1):

"""Convert float to d:m:s.s

Number of decimal places on seconds is set by digits. If deg is false, prints just m:s.s (omits degrees). """

If deg=0, clDms actually prints degrees, minutes, decimals of minutes. Saying that it prints "just m:s.s" implies that the degrees portion of the value is discarded. If x = 89.308333333, for example, the distinction is between 89:18.5 and 18:30.0, and clDms prints the former. Thus the 'deg' keyword is not a very good choice of name; maybe dms or dms_format would be better.

You're right, this is a pretty dumb way to describe what it does. I think this is a case of the interface reflecting far too much detail about the algorithm actually used inside the routine. (If you read through the code you'll see that it actually *does* omit the degrees as far as the logic of the program is concerned.)

I'm just a little nervous about changing it. I suppose there is some faint chance that someone used the old interface. What do you think, Perry? Can I just change it, or do we need to preserve the deg keyword for backward compatibility?

Rick

Change History

03/07/08 13:04:48 changed by sontag

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to PyRAF 1.6.

Having been deprecated for some time now (Rick did so in r638, in April 2004), the 'deg' arg was finally removed in r832.