[AstroPy] Draft specification for PyFITS functional interface

laidler at stsci.edu laidler at stsci.edu
Wed Mar 30 14:08:43 CST 2005

---- Original message ----
>Date: Wed, 30 Mar 2005 20:56:15 +0100
>From: Peter Erwin <erwin at iac.es>  
>Subject: Re: [AstroPy] Draft specification for PyFITS
functional interface  
>To: astropy at scipy.net
>At 2:42 PM -0500 3/30/05, Paul Barrett wrote:
>>I'm wondering if these convenience functions aren't better
off in a 
>>separate python module that imports pyfits.  This approach
>>keep the pyfits interface simple and objected-oriented, and
>>signal that the procedural interface is being used.  Command
>>versions of these convenience functions could also exist, so
>>users could easily extract information from a FITS file.
>Wouldn't that make things more confusing for users, with two
modules to worry
>about instead of one?  I like the idea that if I want to do
>with FITS files,
>all I need to do is import pyfits; then I can worry about
whether I want to use
>a simple functional approach, or something object-oriented,
as the need

I agree with Peter - to my mind, one of the strengths of
Python is that it supports both functional and object-oriented
programming, so that it's easy and painless to switch back and
forth or mix them as the need arises. In an interactive
session, I might be very likely to use the functional routines
as long as things are going as I expect, and then want to
switch to the OO ones for cases where things are going wrong
and I need more direct control of the file's innards.

More information about the AstroPy mailing list