Your opinion

From: fred <fred_at_nyahnyahspammersnyahnyah>
Date: Thu, 23 Sep 2004 15:24:15 -0600 (MDT)

Dear PyNGLers -
A couple of our alpha testers have suggested that it would
be preferable to use the form:
  import Ngl
rather than
  from Ngl import *
Whereas most of the functions in Ngl have an "ngl_" prefix
(in parallel with the "gsn_" prefix in GSUN), potential for
name clashes exists for names like "Resources". So, we are
inclined to agree that the "import Ngl" form is preferable.
As a consequence, we are considering a significant change.
Since using an "import Ngl" now would produce redundant syntax
  plot = Ngl.ngl_contour(wks,var)
in moving toward favoring the "import Ngl" form, we would remove
all of the "ngl_" prefixes.
For example, the current code,
  from Scientific.IO.NetCDF import NetCDFFile
  from Ngl import *
  dirc = ncargpath("data")
  nfile = NetCDFFile(dirc + "/cdf/meccatemp.cdf","r")
  T = nfile.variables["t"][0,:,:]
  wks = ngl_open_wks("pdf","code")
  contour = ngl_contour(wks,T)
would become:
  from Scientific.IO.NetCDF import NetCDFFile
  import Ngl
  dirc = Ngl.ncargpath("data")
  nfile = NetCDFFile(dirc + "/cdf/meccatemp.cdf","r")
  T = nfile.variables["t"][0,:,:]
  wks = Ngl.open_wks("pdf","code")
  contour = Ngl.contour(wks,T)
Implementing this change would pretty much preclude ever using
the "from Ngl import *" form, since there would now be lots of
possible name clashes, like "end", "contour", etc.
We would like to do this, but would making this change at this time
be too disruptive?
   -- Your friendly PyNGL developers
pyngl-talk mailing list
Received on Thu Sep 23 2004 - 15:54:17 MDT

This archive was generated by hypermail 2.2.0 : Thu Jan 19 2006 - 21:30:16 MST