Re: [matplotlib-devel] [PATCH] experimental numscons support in matplotlib
Andrew Straw wrote: > I looked a little further, and it depends on the directory that the > tests are run from -- if I manually log into the build slave, I can > get the tests to run (in fact, one segfaults) if I try from a > different working directory. Anyhow, now that I have a handle on it, I > think I can probably get it working... Give me a couple days. great. > As far as I'm concerned, that would be fine. > > Is PyMODINIT_FUNC pulled in from Python.h? Yes - the init func should always be 'tagged' by this macro. On Unix, any function is exported in a shared library by default, but the behavior is the opposite on windows, where a function without it will not be visible from external code. David -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] [Matplotlib-users] encoding of files included in sphinx
Hi, just wanted to raise this problem on the devel list, where it probably belongs. Also, if nobody has time to look at it now and you prefer me to file a bug, please don't hesitate to tell it. the original post is there: http://thread.gmane.org/gmane.comp.python.matplotlib.general/20411 Cheers Le 21 novembre 2009 17:50, Sébastien Barthélemy a écrit : > Le 18 novembre 2009 17:24, Michael Droettboom a écrit : > > This is a bug -- but it has a fairly straightforward fix: to use Sphinx's >> "include" directive rather than roll our own as we currently do. This has >> been fixed in SVN r7972. plot-directive now takes an "encoding" option, >> exactly like the Sphinx include directive. It does not do automatic >> encoding detection (meaning it ignores the "# coding: latin1" comments), >> just as the Sphinx include directive does. >> > > Hello Michael, > > thank you for your fast reply and action. I just tried with the version > from trunk (r7978) and I still have an encoding problem on the same test > case. It seems to happen when the file is ran (to produce the figure) rather > than when it is included. I had a look at the code, but cannot understand > what is happenning, I would have expected imp to proprely guess the > encoding. > > Could you tell me if you have the same problem ? Do you have any idea of > what is going on ? > > Thanks ! > > $ git clone git://github.com/sbarthelemy/SphinxEncoding.git > $ cd SphinxEncoding/ > $ make html > sphinx-build -b html -d _build/doctrees . _build/html > Making output directory... > Running Sphinx v0.6.2 > loading pickled environment... not found > building [html]: targets for 1 source files that are out of date > updating environment: 1 added, 0 changed, 0 removed > /home/barthelemy/.local/lib/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: > UserWarning: Exception running plot ./fileutf8.py > Traceback (most recent call last): > File > "/home/barthelemy/.local/lib/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 270, in render_figures > run_code(plot_path, function_name, plot_code) > File > "/home/barthelemy/.local/lib/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 182, in run_code > "__plot__", fd, fname, ('py', 'r', imp.PY_SOURCE)) > File "fileutf8.py", line 2, in > print(u"accent aigus é") > UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in > position 13: ordinal not in range(128) > -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] [PATCH] experimental numscons support in matplotlib
On Wed, Nov 25, 2009 at 10:57 AM, John Hunter wrote: > On Wed, Nov 25, 2009 at 10:52 AM, Andrew Straw wrote: > >> Also, would you like svn commit access? That may just make things easier >> -- John, what do you think? I think we can trust David. :) > > Absolutely -- send me an svn login and I can add him to the list of > committers if he wants to, else we can manage his patches. "svn login" means "sourceforge id" JDH -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] [PATCH] experimental numscons support in matplotlib
On Wed, Nov 25, 2009 at 10:52 AM, Andrew Straw wrote: > Also, would you like svn commit access? That may just make things easier > -- John, what do you think? I think we can trust David. :) Absolutely -- send me an svn login and I can add him to the list of committers if he wants to, else we can manage his patches. JDH -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] [PATCH] experimental numscons support in matplotlib
David Cournapeau wrote: > Andrew Straw wrote: > >> Michael Droettboom wrote: >> >>> I know it's been a while since you announced this, but I'm just >>> looking into this now. >>> >> Also, I got some ways in making the buildbot build with numscons, but >> I stopped at a bug where it looked like the matplotlib.tests.* modules >> were not getting installed: >> >> http://mpl-buildbot.code.astraw.com/builders/Ubuntu%208.04%2C%20Python%202.5%2C%20amd64%2C%20scons/builds/13/steps/test/logs/stdio >> >> >> > > I will look at it. I would like to get some kind of automated testing > for matplotlib on windows 64 (which is built using the numscons build), > so I have the incentive :) > I looked a little further, and it depends on the directory that the tests are run from -- if I manually log into the build slave, I can get the tests to run (in fact, one segfaults) if I try from a different working directory. Anyhow, now that I have a handle on it, I think I can probably get it working... Give me a couple days. win64 builds wold be great. > >> I haven't had a chance to debug this further, but I'm open to ideas. >> Also, this branch is building from a git repository (a mirror of >> David's which I can't clone normally, for some reason), for what it's >> worth. >> > > I don't know why I have those problems either. Do you think it would be > possible to just apply the patch suite to trunk in svn once we fix the > test issue ? Since the patches do not touch the existing source tree > (except for a few bugs on windows I can split up if required), it would > be more practical to have all this in svn. > As far as I'm concerned, that would be fine. Is PyMODINIT_FUNC pulled in from Python.h? Also, would you like svn commit access? That may just make things easier -- John, what do you think? I think we can trust David. :) -Andrew -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] Engineering prefixed units in tick labels
Hi, 2009/11/18 Jason Heeris : > In gnuplot, I can do the following: > > set format x "%.0s %cHz" > > ...and this will set the x-axis labels (on a semilogx style plot) to > be "10 Hz", "100 Hz", "1 kHz", "10 kHz", etc. I ended up implementing this myself, it wasn't too hard. I've attached the code if anyone else is interested. I don't know matplotlib that well, so I don't know if there's much duplication of code in there. I thought I'd CC the dev list in case others think it might be useful. If not, sorry for the noise. Cheers, Jason import math, decimal from matplotlib.ticker import LogFormatter # The SI engineering prefixes ENG_PREFIXES = { -24: "y", -21: "z", -18: "a", -15: "f", -12: "p", -9: "n", -6: u"\u03BC", # Greek letter mu -3: "m", 0: "", 3: "k", 6: "M", 9: "G", 12: "T", 15: "P", 18: "E", 21: "Z", 24: "Y" } def format_eng(num, places=0): """ Formats a number in engineering notation, appending a letter representing the power of 1000 of the original number. Some examples: >>> format_eng(0, 0) '0' >>> format_eng(100, 1) '1.0 M' >>> format_eng("-1e-6", 2) u'-1.00 \u03bc' @param num: the value to represent @type num: either a numeric value or a string that can be converted to a numeric value (as per decimal.Decimal constructor) @param prec: the number of decimal places to include (default 0) @type prec: integer > 0 @return: engineering formatted string """ dnum = decimal.Decimal(str(num)) sign = 1 if dnum < 0: sign = -1 dnum = -dnum if dnum != 0: pow10 = decimal.Decimal(int(math.floor(dnum.log10()/3)*3)) else: pow10 = decimal.Decimal(0) pow10 = pow10.min(max(ENG_PREFIXES.keys())) pow10 = pow10.max(min(ENG_PREFIXES.keys())) prefix = ENG_PREFIXES[int(pow10)] mant = sign*dnum/(10**pow10) format_str = "%f %s" if places > 0: format_str = ("%%.%if %%s" % places) else: format_str = "%i %s" formatted = format_str % (mant, prefix) return formatted.strip() class EngFormatter(LogFormatter): """ Formats axis values using engineering prefixes to represent powers of 1000, plus a specified unit, eg. 10 MHz instead of 1e7. """ def __init__(self, unit=""): LogFormatter.__init__(self, base=10) self.unit = unit def __call__(self, x, pos=None): # only label the decades b=self._base fx = math.log(abs(x))/math.log(b) isDecade = self.is_decade(fx) if not isDecade and self.labelOnlyBase: s = '' else: s = "%s%s" % (format_eng(x, 0), self.units) return self.fix_minus(s) -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] [PATCH] experimental numscons support in matplotlib
Andrew Straw wrote: > Michael Droettboom wrote: >> I know it's been a while since you announced this, but I'm just >> looking into this now. > > Also, I got some ways in making the buildbot build with numscons, but > I stopped at a bug where it looked like the matplotlib.tests.* modules > were not getting installed: > > http://mpl-buildbot.code.astraw.com/builders/Ubuntu%208.04%2C%20Python%202.5%2C%20amd64%2C%20scons/builds/13/steps/test/logs/stdio > > I will look at it. I would like to get some kind of automated testing for matplotlib on windows 64 (which is built using the numscons build), so I have the incentive :) > I haven't had a chance to debug this further, but I'm open to ideas. > Also, this branch is building from a git repository (a mirror of > David's which I can't clone normally, for some reason), for what it's > worth. I don't know why I have those problems either. Do you think it would be possible to just apply the patch suite to trunk in svn once we fix the test issue ? Since the patches do not touch the existing source tree (except for a few bugs on windows I can split up if required), it would be more practical to have all this in svn. cheers, David -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel