debian/0000755000000000000000000000000012262560054007170 5ustar debian/python-gnuplot.examples0000644000000000000000000000004512150576414013741 0ustar demo.py test.py debian/datafile.py debian/control0000644000000000000000000000234312262557170010602 0ustar Source: python-gnuplot Section: python Priority: optional Maintainer: Debian Science Maintainers Build-Depends: debhelper (>= 9), python-all (>= 2.6.6) Uploaders: Josue Ortega Build-Depends-Indep: python-numpy Standards-Version: 3.9.5 XS-Python-Version: all Homepage: http://gnuplot-py.sourceforge.net/ Vcs-Git: git://anonscm.debian.org/debian-science/packages/python-gnuplot.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/python-gnuplot.git Package: python-gnuplot Architecture: all Depends: ${python:Depends}, python-numpy, ${misc:Depends}, gnuplot Description: Python interface to the gnuplot plotting program Gnuplot.py is a Python module that interfaces to gnuplot, the popular plotting program. It allows you to use gnuplot from within Python to plot arrays of data from memory, data files, or mathematical functions. If you use Python to perform computations or as `glue' for numerical programs, you can use this module to plot data on the fly as they are computed. And the combination with Python makes it is easy to automate things, including to create crude `animations' by plotting different datasets one after another. debian/watch0000644000000000000000000000010112150576414010214 0ustar version=3 http://sf.net/gnuplot-py/gnuplot-py-([\d\.]*)\.tar\.gz debian/rules0000755000000000000000000000010112150576414010243 0ustar #! /usr/bin/make -f # -*- makefile -*- %: dh $@ --with python2 debian/doc-base0000644000000000000000000000107412150576414010575 0ustar Document: python-gnuplot Title: python-gnuplot Manual Author: Michael Haggerty, Konrad Hinsen Abstract: A Python interface to the gnuplot plotting program. Based on an object-oriented design that allows the user much flexibility to set per-dataset options such as line styles, as well as to run multiple gnuplot sessions simultaneously. Includes a demonstration and extensive documentation strings. Now supports 3-d plots! Section: Programming/Python Format: HTML Index: /usr/share/doc/python-gnuplot/html/index.html Files: /usr/share/doc/python-gnuplot/html/*.html debian/copyright0000644000000000000000000000204412150576414011126 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Gnuplot.py Upstream-Contact: Michael Haggerty Source: http://gnuplot-py.sourceforge.net/ Comment: This package was debianized by Matthias Klose on Sun, 22 Aug 1999 13:37:35 +0200. Files: * Copyright: 1998-1999 Michael Haggerty License: LGPL-2.1 This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . On Debian GNU/Linux systems, the complete text of the GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-2.1'. debian/README.datafile0000644000000000000000000000134512150576414011626 0ustar datafile.py ----------- [text from http://monsoon.harvard.edu/~mhagger/download/] This is a Python module for reading ASCII data files. The format is like the one gnuplot uses, namely whitespace-separated columns of numbers, one data sample per line. Lines that begin with a pound sign (`#') are comment lines, which are mostly ignored. Exceptions are comment lines starting with `# Columns: ' followed by the names of each column (separated by whitespace), and header lines of the form `# parameter = value', which indicate overall simulation parameters. In fact, the module can also read a binary variation on this basic format, which is much faster. I'll have to document this module before it will be much use to anybody else but me. debian/python-gnuplot.install0000644000000000000000000000006012150576414013566 0ustar doc/Gnuplot/* usr/share/doc/python-gnuplot/html debian/datafile.py0000644000000000000000000002376212150576414011330 0ustar # $Id: datafile.py 200 2007-01-05 00:11:21Z watabe $ # Written by Michael Haggerty # Read text data files (of columnar data) into an array. import string, re import numpy import sys class DataFormat(Exception): pass class datafile: mantissa_re = re.compile(r"[\+\-]?(?:\d+\.\d*|\d+|\.\d+)") float_re = re.compile(mantissa_re.pattern + r"(?:[eE][\+\-]?\d+)?") columns_re = re.compile(r"^Columns\:\s*(.*)$") parmline_re = re.compile(r"^(\w+)\s*=\s*(" + float_re.pattern + r")(\s+(.*))?$") dataline_re = re.compile(r"^" + float_re.pattern + r"(\s+" + float_re.pattern + r")*$") binstart_re = re.compile(r"^binary_start\(" r"\s*(\w)\s*\," r"\s*(\d+)\s*\," r"\s*(\d+)\s*\," r"\s*(\d+)\s*\)$") binend_re = re.compile(r"^binary_end\(\)$") # f can be a filename (string) or a file-like object. def __init__(self, f=None): self.colnames = [] # column names, in order, as strings self.colnums = {} # numbered starting with 0 self.data = None # array to store data self.comments = [] # full-line comment lines, saved literally self.parms = {} # parameters from the header of the file self.gaps = [] # data row numbers that are preceded by blank lines self.filename = None # the filename associated with the data if f is not None: self.read(f) # Add comment c for file (initial '#' and whitespace should # already be deleted). If c is a column line, set up # self.colnames and self.colnums. If c is a parm line, adjust # self.parms. Otherwise, append the comment to self.comments. def add_comment(self, c): m = self.columns_re.match(c) if m: newcolnames = string.split(m.group(1)) if self.colnames: assert newcolnames == self.colnames else: self.colnames = newcolnames for i in range(len(self.colnames)): self.colnums[self.colnames[i]] = i if self.data is not None: assert len(self.colnames) == self.data.shape[1] return m = self.parmline_re.match(c) if m: if self.parms.has_key(m.group(1)): assert self.parms[m.group(1)] == float(m.group(2)) else: self.parms[m.group(1)] = float(m.group(2)) return # If it's not a columns or parm line, just store it: self.comments.append(c) # f can be a filename (string) or a file-like object. def read(self, f): numrows = self.numrows() # numer of rows currently stored if type(f) is type(''): if not self.filename: self.filename = f f = open(f, 'rb') # treat as a filename while 1: l = f.readline() if not l: break # Strip whitespace: l = string.strip(l) # look for full-line comment: if l and l[0] == '#': self.add_comment(string.lstrip(l[1:])) continue # strip end-of-line comments: if string.find(l, '#') != -1: l = string.rstrip(l[:string.find(l, '#')]) # Look for text data lines: m = self.dataline_re.match(l) if m: row = numpy.array(map(string.atof, string.split(l))) if self.data==None: # allocate initial space for data: self.data = numpy.zeros((128, row.shape[0]), numpy.float) if self.colnames: assert len(self.colnames) == row.shape[0] else: # line length agreement is tested implicitly by assignment if self.data.shape[0] == numrows: # allocate some more space (double size): newsize = (self.data.shape[0] + max(128, self.data.shape[0])) self.data = numpy.resize(self.data, (newsize, self.data.shape[1])) self.data[numrows, :] = row numrows = numrows + 1 continue if l == '': if numrows: self.gaps.append(numrows) continue m = self.binstart_re.match(l) if m: # binary data typecode = m.group(1) itemsize = int(m.group(2)) newnumrows = int(m.group(3)) newnumcols = int(m.group(4)) assert typecode == 'd' # Don't worry about other formats yet if self.colnames: assert newnumcols == len(self.colnames) size = itemsize*newnumrows*newnumcols s = f.read(size) if len(s) != size: raise DataFormat, "Binary data of insufficient length" newdata = numpy.fromstring(s, typecode) newdata = numpy.reshape(newdata, (newnumrows, newnumcols)) assert newdata.itemsize() == itemsize # sanity check if self.data: assert typecode == self.data.typecode() assert newdata.shape[1] == self.data.shape[1] self.data = numpy.concatenate((self.data[:numrows], newdata)) else: assert newdata.shape[1] == len(self.colnames) self.data = newdata numrows = self.data.shape[0] assert f.read(1) == '\n' assert self.binend_re.match(f.readline()) continue raise DataFormat, l if self.data.any(): # truncate extra allocated data space: self.data = self.data[:numrows, :] # Allow the special notation d[,"colname"] for a second # argument which is a string. def __getitem__(self, i): if type(i) is type(()) and len(i) == 2 and type(i[1]) is type(""): return self.data[i[0], self.colnums[i[1]]] else: return self.data[i] def __setitem__(self, i, x): if type(i) is type(()) and len(i) == 2 and type(i[1]) is type(""): self.data[i[0], self.colnums[i[1]]] = x else: self.data[i] = x def numrows(self): if self.data is None: return 0 else: return self.data.shape[0] def numcols(self): if self.data is None: return 0 else: return self.data.shape[1] def appendcolumn(self, name): """Append a column of zeros to the right of the existing data. Use the column name specified.""" if self.colnums.has_key(name): raise KeyError(name) newpart = numpy.zeros((self.data.shape[0], 1), numpy.float) self.data = numpy.concatenate((self.data, newpart), 1) self.colnums[name] = self.data.shape[1] self.colnames.append(name) def deletecolumn(self, j): """Delete the specified column from the dataset.""" if type(j) is type(""): name = j j = self.colnums[name] else: name = self.colnames[j] self.data = numpy.concatenate((self.data[:,:j], self.data[:,j+1:]), 1) self.colnames[j:j+1] = [] self.colnums = {} for i in range(len(self.colnames)): self.colnums[self.colnames[i]] = i def write(self, f=None, binary=None): """Write the data to a file or the stored filename. f can be a file-type object or a filename. If it is omitted, then the file is saved to self.filename, from which the data were originally read. Also attempts to copy the comment lines, parm lines, and column lines to output file though their order may be changed.""" if f is None: assert self.filename f = self.filename if type(f) is type(""): # treat as a filename if binary: f = open(f, 'wb') else: f = open(f, 'w') for l in self.comments: f.write("# " + l + "\n") for p in self.parms.keys(): f.write("# %s = %g\n" % (p, self.parms[p])) f.write("# Columns: " + string.join(self.colnames, "\t") + "\n") if binary: if self.gaps: sys.stderr.write("datafile: Warning--" "gaps not preserved in binary files.\n") f.write("binary_start(%s,%d,%d,%d)\n" % (self.data.typecode(), self.data.itemsize(), self.data.shape[0], self.data.shape[1])) f.write(self.data.tostring()) f.write("\nbinary_end()\n") else: fmt = string.join(["%.15g"]*self.data.shape[1], '\t') + '\n' gaps = self.gaps[:] for i in range(self.data.shape[0]): while gaps and gaps[0]==i: f.write('\n') gaps = gaps[1:] f.write(fmt % tuple(self.data[i])) # Demo code if __name__ == '__main__': import getopt try: (opts, args) = getopt.getopt(sys.argv[1:], 'b') except getopt.error: sys.stderr.write("Usage: %s [-b] [filename...]\n" % sys.argv[0]) sys.exit(1) binary = 0 for (opt,val) in opts: if opt == '-b': binary = 1 else: # This should never happen: raise OptionError, opt if args: d = datafile() for f in args: d.read(f) else: d = datafile(sys.stdin) d.write(sys.stdout, binary=binary) debian/README.Debian0000644000000000000000000000146512150576414011242 0ustar python-gnuplot for Debian ------------------------- Included in this package is the datafile.py module from the same author. The modules can be found in /usr/lib/pythonX.Y/site-packages, where X.Y is Debian's default python version (i.e. 2.3). You can import the main part of the package into your python programs using `import Gnuplot'. The function-based interface (i.e., the plot() command) inherited from Konrad Hinsen's original Gnuplot.py has been separated into a separate file, `plot.py'. You can import it using `import Gnuplot.oldplot' or `from Gnuplot.oldplot import plot'. However, it is recommended that you try out the object-oriented interface since it is far more flexible and the old interface will no longer be developed. -- Matthias Klose , Sun, 22 Aug 1999 13:37:35 +0200 debian/patches/0000755000000000000000000000000012150576414010622 5ustar debian/patches/fix-string-exceptions.patch0000644000000000000000000000366312150576414016124 0ustar Description: Fix string exceptions Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585295 Forwarded: not-needed Author: Matthias Klose Patch that avoid string exceptions, Closes: #585295 --- a/gp_java.py +++ b/gp_java.py @@ -120,7 +120,7 @@ command = [GnuplotOpts.gnuplot_command] if persist: if not test_persist(): - raise ('-persist does not seem to be supported ' + raise RuntimeError, ('-persist does not seem to be supported ' 'by your version of gnuplot!') command.append('-persist') --- a/gp_unix.py +++ b/gp_unix.py @@ -184,7 +184,7 @@ persist = GnuplotOpts.prefer_persist if persist: if not test_persist(): - raise ('-persist does not seem to be supported ' + raise RuntimeError, ('-persist does not seem to be supported ' 'by your version of gnuplot!') self.gnuplot = popen('%s -persist' % GnuplotOpts.gnuplot_command, 'w') --- a/_Gnuplot.py +++ b/_Gnuplot.py @@ -449,7 +449,7 @@ try: type = self.optiontypes[k] except KeyError: - raise 'option %s is not supported' % (k,) + raise KeyError, 'option %s is not supported' % (k,) getattr(self, 'set_%s' % type)(k, v) def xlabel(self, s=None, offset=None, font=None): --- a/gp_macosx.py +++ b/gp_macosx.py @@ -118,7 +118,7 @@ persist = GnuplotOpts.prefer_persist if persist: if not test_persist(): - raise ('-persist does not seem to be supported ' + raise RuntimeError, ('-persist does not seem to be supported ' 'by your version of gnuplot!') self.gnuplot = popen('%s -persist' % GnuplotOpts.gnuplot_command, 'w') debian/patches/series0000644000000000000000000000012212150576414012032 0ustar fix-string-exceptions.patch fix-python-name.patch fix-malfuction-mouse-keys.patch debian/patches/fix-python-name.patch0000644000000000000000000000054612150576414014673 0ustar Description: Fix the right name for python instead python2 Author: Matthias Klose Last-Update: 2013-02-02 --- a/FAQ.txt +++ b/FAQ.txt @@ -14,7 +14,7 @@ When running the following script ------------------------------------------------ -#! /usr/bin/python2 +#! /usr/bin/python import Gnuplot, Gnuplot.funcutils from numpy import * debian/patches/fix-malfuction-mouse-keys.patch0000644000000000000000000000106512150576414016671 0ustar Description: Fix malfunction of mouse control and hotkeys Author: Matthias Klose Last-Update: 2013-02-03 --- a/_Gnuplot.py +++ b/_Gnuplot.py @@ -184,7 +184,8 @@ self._clear_queue() self.debug = debug self.plotcmd = 'plot' - self('set terminal %s' % (gp.GnuplotOpts.default_term,)) + #self('set terminal %s' % (gp.GnuplotOpts.default_term,)) + # disabled: causes malfunction of mouse control and hotkeys def close(self): # This may cause a wait for the gnuplot process to finish debian/python-gnuplot.docs0000644000000000000000000000013112150576414013047 0ustar ANNOUNCE.txt CREDITS.txt FAQ.txt NEWS.txt README.txt TODO.txt debian/README.datafile debian/source/0000755000000000000000000000000012150576414010473 5ustar debian/source/format0000644000000000000000000000001312150576414011700 0ustar 3.0 (quilt)debian/compat0000644000000000000000000000000212150576414010371 0ustar 9 debian/changelog0000644000000000000000000001235012262560053011042 0ustar python-gnuplot (1.8-5) unstable; urgency=low * Update Standards-Version to 3.9.5. No changes required. * debian/control: VCS-* fields updated to cannonical URI. -- Josue Ortega Sun, 05 Jan 2014 19:41:47 -0600 python-gnuplot (1.8-4) unstable; urgency=low * Upload to unstable -- Josue Ortega Mon, 27 May 2013 00:29:42 -0600 python-gnuplot (1.8-3) experimental; urgency=low [ Josue Ortega ] * New Maintainer. (Closes: #699039) * Added debian/source/format file * Changed to dpkg-source 3.0 (quilt) format. * debian/copyright updated to format version 1.0 * debian/control: added homepage. [ Anton Gladky ] * Use debhelper 9. * Remove XB-Python-Version. * Remove old postinst and prerm scripts. * Clean completely debian/rules. * Depend on gnuplot. python-gnuplot does not work without it. * Move the package into Debian-Science team. -- Josue Ortega Sat, 16 Feb 2013 15:22:25 -0600 python-gnuplot (1.8-2) unstable; urgency=low * QA upload. * Orphan the package. * Build using dh_python2 instead of dh_pycentral. Closes: #617007. * Recommend gnuplot instead of depending on it. Closes: #600349. * Avoid string exceptions. Closes: #585295. * Fix lintian warnings. -- Matthias Klose Sat, 26 Jan 2013 17:42:40 +0100 python-gnuplot (1.8-1.1) unstable; urgency=low * Non-maintainer upload. * Fix "manipulates site-packages/ directly, failing with Python 2.6" Applied and uploaded Kumar's patch. (Closes: #547842) -- Bastian Venthur Sat, 07 Nov 2009 12:44:48 +0100 python-gnuplot (1.8-1) unstable; urgency=low * New upstream version. - doc file with broken link not shipped anymore. Closes: #336422. - Use `with_' instead of `with', which is a keyword in python2.6. Closes: #424965. * Use python-numpy instead of python-numeric. Closes: #469313, #478468. * Update watch file. Closes: #450271. * Register documention in section `Programming/Python'. * Update datafile.py. -- Matthias Klose Tue, 24 Jun 2008 18:40:22 +0200 python-gnuplot (1.7-7) unstable; urgency=low * Fix unhandled exception (Michael Schieschke). Closes: #353642. -- Matthias Klose Sun, 29 Oct 2006 02:45:58 +0200 python-gnuplot (1.7-6) unstable; urgency=low * Convert to the updated Python policy. Closes: #373542. -- Matthias Klose Fri, 16 Jun 2006 20:56:37 +0000 python-gnuplot (1.7-5) unstable; urgency=low * Fix mouse control in generated plot windows (closes: #291294). -- Matthias Klose Sun, 23 Jan 2005 00:42:37 +0100 python-gnuplot (1.7-4) unstable; urgency=low * Add watch file. -- Matthias Klose Sun, 19 Sep 2004 20:55:54 +0200 python-gnuplot (1.7-3) unstable; urgency=low * Fix typo in README.Debian (closes: #219485). -- Matthias Klose Sun, 16 Nov 2003 12:36:26 +0100 python-gnuplot (1.7-2) unstable; urgency=low * Reflect license change from GPL to LGPL. -- Matthias Klose Thu, 30 Oct 2003 22:38:29 +0100 python-gnuplot (1.7-1) unstable; urgency=low * New upstream version. - Allows pipes to be used for communication with gnuplot (closes: #211875). - Fixes syntax warning with python2.3 (closes: #216129). -- Matthias Klose Mon, 20 Oct 2003 00:17:07 +0200 python-gnuplot (1.6-4) unstable; urgency=low * Upload for python2.3 as the default python version. -- Matthias Klose Fri, 8 Aug 2003 07:53:03 +0200 python-gnuplot (1.6-3) unstable; urgency=low * Fix README (closes: #189508). * Shutup SyntaxWarning in 'oldplot.py' compat module (closes: #159077). -- Matthias Klose Sat, 10 May 2003 15:45:34 +0200 python-gnuplot (1.6-2) unstable; urgency=low * Build using python2.2. -- Matthias Klose Tue, 27 Aug 2002 22:36:50 +0200 python-gnuplot (1.6-1) unstable; urgency=low * New upstream version. -- Matthias Klose Thu, 22 Aug 2002 20:50:06 +0200 python-gnuplot (1.5-3) unstable; urgency=low * Build-depend on python-numeric (closes: #142080). -- Matthias Klose Thu, 11 Apr 2002 08:52:48 +0200 python-gnuplot (1.5-2) unstable; urgency=low * Add debhelper build dependency (closes: #139658). -- Matthias Klose Mon, 1 Apr 2002 14:35:20 +0200 python-gnuplot (1.5-1) unstable; urgency=low * New upstream version. -- Matthias Klose Sun, 30 Dec 2001 22:48:36 +0100 python-gnuplot (1.4-3) unstable; urgency=low * Update for python2.1. -- Matthias Klose Tue, 13 Nov 2001 00:00:48 +0100 python-gnuplot (1.4-2) frozen unstable; urgency=low * Add cascading style sheet pythondoc.css (fixes #63141). -- Matthias Klose Thu, 4 May 2000 01:11:50 +0200 python-gnuplot (1.4-1) unstable; urgency=low * New upstream version. Somewhat incompatible: it's a package now. -- Matthias Klose Mon, 25 Oct 1999 18:14:06 +0200 python-gnuplot (1.2-1) unstable; urgency=low * Initial Release. -- Matthias Klose Sun, 22 Aug 1999 13:37:35 +0200 Local variables: mode: debian-changelog End: