SourceForge logo
SourceForge logo
Menu

matplotlib-devel — matplotlib developers

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
(1)
Nov
(33)
Dec
(20)
2004 Jan
(7)
Feb
(44)
Mar
(51)
Apr
(43)
May
(43)
Jun
(36)
Jul
(61)
Aug
(44)
Sep
(25)
Oct
(82)
Nov
(97)
Dec
(47)
2005 Jan
(77)
Feb
(143)
Mar
(42)
Apr
(31)
May
(93)
Jun
(93)
Jul
(35)
Aug
(78)
Sep
(56)
Oct
(44)
Nov
(72)
Dec
(75)
2006 Jan
(116)
Feb
(99)
Mar
(181)
Apr
(171)
May
(112)
Jun
(86)
Jul
(91)
Aug
(111)
Sep
(77)
Oct
(72)
Nov
(57)
Dec
(51)
2007 Jan
(64)
Feb
(116)
Mar
(70)
Apr
(74)
May
(53)
Jun
(40)
Jul
(519)
Aug
(151)
Sep
(132)
Oct
(74)
Nov
(282)
Dec
(190)
2008 Jan
(141)
Feb
(67)
Mar
(69)
Apr
(96)
May
(227)
Jun
(404)
Jul
(399)
Aug
(96)
Sep
(120)
Oct
(205)
Nov
(126)
Dec
(261)
2009 Jan
(136)
Feb
(136)
Mar
(119)
Apr
(124)
May
(155)
Jun
(98)
Jul
(136)
Aug
(292)
Sep
(174)
Oct
(126)
Nov
(126)
Dec
(79)
2010 Jan
(109)
Feb
(83)
Mar
(139)
Apr
(91)
May
(79)
Jun
(164)
Jul
(184)
Aug
(146)
Sep
(163)
Oct
(128)
Nov
(70)
Dec
(73)
2011 Jan
(235)
Feb
(165)
Mar
(147)
Apr
(86)
May
(74)
Jun
(118)
Jul
(65)
Aug
(75)
Sep
(162)
Oct
(94)
Nov
(48)
Dec
(44)
2012 Jan
(49)
Feb
(40)
Mar
(88)
Apr
(35)
May
(52)
Jun
(69)
Jul
(90)
Aug
(123)
Sep
(112)
Oct
(120)
Nov
(105)
Dec
(116)
2013 Jan
(76)
Feb
(26)
Mar
(78)
Apr
(43)
May
(61)
Jun
(53)
Jul
(147)
Aug
(85)
Sep
(83)
Oct
(122)
Nov
(18)
Dec
(27)
2014 Jan
(58)
Feb
(25)
Mar
(49)
Apr
(17)
May
(29)
Jun
(39)
Jul
(53)
Aug
(52)
Sep
(35)
Oct
(47)
Nov
(110)
Dec
(27)
2015 Jan
(50)
Feb
(93)
Mar
(96)
Apr
(30)
May
(55)
Jun
(83)
Jul
(44)
Aug
(8)
Sep
(5)
Oct
Nov
(1)
Dec
(1)
2016 Jan
Feb
Mar
(1)
Apr
May
Jun
(2)
Jul
Aug
(3)
Sep
(1)
Oct
(3)
Nov
Dec
2017 Jan
Feb
(5)
Mar
Apr
May
Jun
Jul
(3)
Aug
Sep
(7)
Oct
Nov
Dec
2018 Jan
Feb
Mar
Apr
May
Jun
Jul
(2)
Aug
Sep
Oct
Nov
Dec
S M T W T F S






1
2
(9)
3
(16)
4
(8)
5
(41)
6
(13)
7
(1)
8
(2)
9
(1)
10
(3)
11
(4)
12
(6)
13
(9)
14
(3)
15
(1)
16
17
(8)
18
(11)
19
(3)
20
(9)
21
(6)
22
(13)
23
(9)
24
(10)
25
(6)
26
(9)
27
(9)
28
(11)
29
(4)
30
(3)
31
(7)





Showing 13 results of 13

From: John H. <jd...@gm...> - 2011年01月06日 19:58:17
On Thu, Jan 6, 2011 at 1:24 PM, Benjamin Root <ben...@ou...> wrote:
> Ah, all the more reason to apply abspath() or realpath(). To decide which
> to use, let's consider the case of someone (like a developer) having
> multiple builds of matplotlib in separate directories, and uses a symlink to
> point to whichever he wants to use at the moment.
>
> The question is, in this use-case, would we want the symbolic link pathname,
> or the absolute pathname? I don't mess around with docs enough to know
> which I would want.
>
> I have attached a modified patch (which uses realpath(), but could easily be
> changed to abspath()). I also included some comments to more fully document
> what is going on and the rational for the logic being taken.
OK, I incorporated your changes and committed. Thanks.
> P.S. - Just to make sure, I noticed that rcParamsOrig is only in the
> maintenance branch. It was intended to leave the development branch
> "broken" for now until we get this working properly?
That's correct, but I just did a big merge of all the branch changes
so the trunk is fixed as well now.
JDH
From: Benjamin R. <ben...@ou...> - 2011年01月06日 19:25:22
Attachments: exampledirpath.patch
On Thu, Jan 6, 2011 at 12:32 PM, John Hunter <jd...@gm...> wrote:
> On Thu, Jan 6, 2011 at 12:22 PM, John Hunter <jd...@gm...> wrote:
>
> > matplotlib_fname() always returns absolute path. I have not used
> > realpath, but if you think there is a use for it here, feel free to
> > post an amended patch.
>
> There is an exception to this -- if MATPLOTLIBRC or MPLCONFIGDIR are
> relative paths, then matplotlib_fname will return a relative path too.
>
Ah, all the more reason to apply abspath() or realpath(). To decide which
to use, let's consider the case of someone (like a developer) having
multiple builds of matplotlib in separate directories, and uses a symlink to
point to whichever he wants to use at the moment.
The question is, in this use-case, would we want the symbolic link pathname,
or the absolute pathname? I don't mess around with docs enough to know
which I would want.
I have attached a modified patch (which uses realpath(), but could easily be
changed to abspath()). I also included some comments to more fully document
what is going on and the rational for the logic being taken.
Ben Root
P.S. - Just to make sure, I noticed that rcParamsOrig is only in the
maintenance branch. It was intended to leave the development branch
"broken" for now until we get this working properly?
From: John H. <jd...@gm...> - 2011年01月06日 18:33:03
On Thu, Jan 6, 2011 at 12:22 PM, John Hunter <jd...@gm...> wrote:
> matplotlib_fname() always returns absolute path. I have not used
> realpath, but if you think there is a use for it here, feel free to
> post an amended patch.
There is an exception to this -- if MATPLOTLIBRC or MPLCONFIGDIR are
relative paths, then matplotlib_fname will return a relative path too.
From: John H. <jd...@gm...> - 2011年01月06日 18:22:29
On Thu, Jan 6, 2011 at 12:15 PM, Benjamin Root <ben...@ou...> wrote:
> A comment on the patch. Unless matplotlib_fname() is guaranteed to return
> an absolute filename, then we need to use realpath() on _basedir so that the
> final joined filename will also be absolute. The reason for using
> realpath() instead of abspath() is that in case there are any symbolic links
> in the name from matplotlib_fname(), these will be qualified so that the
> filepath matplotlib sees is the same filepath that spinx sees.
>
> Also, a little oddity that I discovered in reading the docs for
> os.path.join(), turns out that if any element is already an absolute path,
> then it ignores all elements prior to that. In this patch, everything is ok
> because we already check for isabs(). Just thought I ought to point that
> out because I never knew that and that would certainly be a nasty bug to try
> and track down..
matplotlib_fname() always returns absolute path. I have not used
realpath, but if you think there is a use for it here, feel free to
post an amended patch.
JDH
From: Benjamin R. <ben...@ou...> - 2011年01月06日 18:16:17
On Thu, Jan 6, 2011 at 11:50 AM, John Hunter <jd...@gm...> wrote:
> On Thu, Jan 6, 2011 at 11:36 AM, Benjamin Root <ben...@ou...> wrote:
> > On Thu, Jan 6, 2011 at 11:15 AM, John Hunter <jd...@gm...> wrote:
> >>
> >> On Thu, Jan 6, 2011 at 10:58 AM, Benjamin Root <ben...@ou...> wrote:
> >>
> >> > I thought that problem was already addressed in a previous patch?
> John,
> >> > could this be another "gremlin"? Or did I mis-understand the whole
> >> > issue
> >> > absolute path problem?
> >>
> >> My understanding is that because sphinx switches the current working
> >> directory during execution, this path must be absolute. We could get
> >> around this by processing a relative path internally in mpl at rc load
> >> time, and converting it into an absolute path assuming the path is
> >> relative to the directory containing the rc file.
> >>
> >> JDH
> >
> >
> > I actually think that would be a better solution. Python's os.path
> module
> > is very powerful with functions like isabs(), abspath(), expanduser(),
> > expandvars() and realpath(). Of course, one could easily go overboard
> with
> > this, but I am sure we could probably allow for something real simple
> like
> > expandvars() so that packagers could utilize environment variables for
> the
> > build process?
>
> Here is a candidate patch...this will be processed once on module load
> time. I considered doing it in the validate method of the rc params
> in rcsetup, but I am not sure this is better because if users are
> overriding the variable at runtime, we should probably just let them
> do what they want.
>
> I am not sure if this qualifies as a "one time hack" that makes mpl so
> difficult to maintain -- Sandro and Ben can weigh in -- but at least
> we are doing it to make their lives easier :-)
>
> Index: lib/matplotlib/__init__.py
> ===================================================================
> --- lib/matplotlib/__init__.py (revision 8898)
> +++ lib/matplotlib/__init__.py (working copy)
> @@ -762,6 +762,13 @@
>
> # this is the instance used by the matplotlib classes
> rcParams = rc_params()
> +
> +if rcParams['examples.directory']:
> + if not os.path.isabs(rcParams['examples.directory']):
> + _basedir, _fname = os.path.split(matplotlib_fname())
> + _fullpath = os.path.join(_basedir, rcParams['examples.directory'])
> + rcParams['examples.directory'] = _fullpath
> +
> rcParamsOrig = rcParams.copy()
>
> rcParamsDefault = RcParams([ (key, default) for key, (default, converter)
> in \
> @@ -770,6 +777,8 @@
> rcParams['ps.usedistiller'] =
> checkdep_ps_distiller(rcParams['ps.usedistiller'])
> rcParams['text.usetex'] = checkdep_usetex(rcParams['text.usetex'])
>
> +
> +
> def rc(group, **kwargs):
> """
> Set the current rc params. Group is the grouping for the rc, eg.
>
I like the idea. Obviously we would need to make it very clear exactly what
relative filepaths are going to be relative to.
A comment on the patch. Unless matplotlib_fname() is guaranteed to return
an absolute filename, then we need to use realpath() on _basedir so that the
final joined filename will also be absolute. The reason for using
realpath() instead of abspath() is that in case there are any symbolic links
in the name from matplotlib_fname(), these will be qualified so that the
filepath matplotlib sees is the same filepath that spinx sees.
Also, a little oddity that I discovered in reading the docs for
os.path.join(), turns out that if any element is already an absolute path,
then it ignores all elements prior to that. In this patch, everything is ok
because we already check for isabs(). Just thought I ought to point that
out because I never knew that and that would certainly be a nasty bug to try
and track down...
From: John H. <jd...@gm...> - 2011年01月06日 17:51:04
On Thu, Jan 6, 2011 at 11:36 AM, Benjamin Root <ben...@ou...> wrote:
> On Thu, Jan 6, 2011 at 11:15 AM, John Hunter <jd...@gm...> wrote:
>>
>> On Thu, Jan 6, 2011 at 10:58 AM, Benjamin Root <ben...@ou...> wrote:
>>
>> > I thought that problem was already addressed in a previous patch? John,
>> > could this be another "gremlin"? Or did I mis-understand the whole
>> > issue
>> > absolute path problem?
>>
>> My understanding is that because sphinx switches the current working
>> directory during execution, this path must be absolute. We could get
>> around this by processing a relative path internally in mpl at rc load
>> time, and converting it into an absolute path assuming the path is
>> relative to the directory containing the rc file.
>>
>> JDH
>
>
> I actually think that would be a better solution. Python's os.path module
> is very powerful with functions like isabs(), abspath(), expanduser(),
> expandvars() and realpath(). Of course, one could easily go overboard with
> this, but I am sure we could probably allow for something real simple like
> expandvars() so that packagers could utilize environment variables for the
> build process?
Here is a candidate patch...this will be processed once on module load
time. I considered doing it in the validate method of the rc params
in rcsetup, but I am not sure this is better because if users are
overriding the variable at runtime, we should probably just let them
do what they want.
I am not sure if this qualifies as a "one time hack" that makes mpl so
difficult to maintain -- Sandro and Ben can weigh in -- but at least
we are doing it to make their lives easier :-)
Index: lib/matplotlib/__init__.py
===================================================================
--- lib/matplotlib/__init__.py (revision 8898)
+++ lib/matplotlib/__init__.py (working copy)
@@ -762,6 +762,13 @@
 # this is the instance used by the matplotlib classes
 rcParams = rc_params()
+
+if rcParams['examples.directory']:
+ if not os.path.isabs(rcParams['examples.directory']):
+ _basedir, _fname = os.path.split(matplotlib_fname())
+ _fullpath = os.path.join(_basedir, rcParams['examples.directory'])
+ rcParams['examples.directory'] = _fullpath
+
 rcParamsOrig = rcParams.copy()
 rcParamsDefault = RcParams([ (key, default) for key, (default, converter) in \
@@ -770,6 +777,8 @@
 rcParams['ps.usedistiller'] =
checkdep_ps_distiller(rcParams['ps.usedistiller'])
 rcParams['text.usetex'] = checkdep_usetex(rcParams['text.usetex'])
+
+
 def rc(group, **kwargs):
 """
 Set the current rc params. Group is the grouping for the rc, eg.
From: Benjamin R. <ben...@ou...> - 2011年01月06日 17:37:01
On Thu, Jan 6, 2011 at 11:15 AM, John Hunter <jd...@gm...> wrote:
> On Thu, Jan 6, 2011 at 10:58 AM, Benjamin Root <ben...@ou...> wrote:
>
> > I thought that problem was already addressed in a previous patch? John,
> > could this be another "gremlin"? Or did I mis-understand the whole issue
> > absolute path problem?
>
> My understanding is that because sphinx switches the current working
> directory during execution, this path must be absolute. We could get
> around this by processing a relative path internally in mpl at rc load
> time, and converting it into an absolute path assuming the path is
> relative to the directory containing the rc file.
>
> JDH
>
I actually think that would be a better solution. Python's os.path module
is very powerful with functions like isabs(), abspath(), expanduser(),
expandvars() and realpath(). Of course, one could easily go overboard with
this, but I am sure we could probably allow for something real simple like
expandvars() so that packagers could utilize environment variables for the
build process?
Ben Root
From: John H. <jd...@gm...> - 2011年01月06日 17:16:10
On Thu, Jan 6, 2011 at 10:58 AM, Benjamin Root <ben...@ou...> wrote:
> I thought that problem was already addressed in a previous patch? John,
> could this be another "gremlin"? Or did I mis-understand the whole issue
> absolute path problem?
My understanding is that because sphinx switches the current working
directory during execution, this path must be absolute. We could get
around this by processing a relative path internally in mpl at rc load
time, and converting it into an absolute path assuming the path is
relative to the directory containing the rc file.
JDH
From: Benjamin R. <ben...@ou...> - 2011年01月06日 16:59:19
On Wed, Jan 5, 2011 at 10:42 PM, Sandro Tosi <mo...@de...> wrote:
> On Thu, Jan 6, 2011 at 02:31, John Hunter <jd...@gm...> wrote:
> > mpl1> grep rc_file lib/matplotlib/sphinxext/plot_directive.py
> >
> > Surely I have it right now!
>
> Indeed, and it works fine!!! the only thing to notice is that
> examples.directory must be an absolute path, but that set, the doc
> build process gets files from the location specified.
>
>
I thought that problem was already addressed in a previous patch? John,
could this be another "gremlin"? Or did I mis-understand the whole issue
absolute path problem?
Ben Root
From: Friedrich R. <fri...@gm...> - 2011年01月06日 16:38:53
2011年1月4日 Russell E. Owen <ro...@uw...>:
> I'm not sure what to do about 64-bit Python 2.7. It does not even
> support Mac OS X 10.5 due to tcl/tk issues that I think were resolved
> too late for python 2.7.1. In my opinion a matplotlib built against
> ActiveState's Python 2.7 (which is 64-bit and supports 10.5 and 10.6)
> might be of more use. Opinions?
Here's the state of the art for numpy:
http://article.gmane.org/gmane.comp.python.numeric.general/41799.
So from my point of view mpl Mac OS X py2.7 32+64bit should be built
on Mac OS X 10.6 and should not support < 10.6.
Friedrich
From: Sandro T. <mo...@de...> - 2011年01月06日 04:43:25
On Thu, Jan 6, 2011 at 02:31, John Hunter <jd...@gm...> wrote:
> mpl1> grep rc_file lib/matplotlib/sphinxext/plot_directive.py
>
> Surely I have it right now!
Indeed, and it works fine!!! the only thing to notice is that
examples.directory must be an absolute path, but that set, the doc
build process gets files from the location specified.
Thanks a lot!!
Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: John H. <jd...@gm...> - 2011年01月06日 01:31:40
On Wed, Jan 5, 2011 at 5:53 PM, Sandro Tosi <mo...@de...> wrote:
> On Wed, Jan 5, 2011 at 23:22, John Hunter <jd...@gm...> wrote:
>> OK, I found the problem. Somehow my edit to sphinxext.plot_directive
>> to actually call the new function was not saved and committed. I just
>> fixed this, so the branch *should* work. The branch
>> matlpotlib/sphinxext/plot_directive.py should call rc_file_defaults
>> rather than rcdefaults. After an svn up, confirm that this is so
>> before testing.
>
> $ grep -c rc_file_defaults lib/matplotlib/sphinxext/plot_directive.py
> 0
>
> so it's not there :(
>
> and the only file containing rc_file_defaults is lib/matplotlib/__init__.py
>
> of course, examples are stil stuck if no network to SF is available
>
> Oh i think I got it, lib/matplotlib/sphinxext/plot_directive.py was
> updated on trunk instead of the v1.0 branch.
I swear there is a gremlin in my computer. I checked and rechecked
this on my box because of all the confusion we were having, but
apparently managed to commit on the trunk (which doesn't even have the
function defined because I haven't merged) and not on the branch. We
need to get the buildbot going again, because the doc buildbot would
have caught this. I have fixed both the trunk and the branch: the
branch calls the new function and has the desired "no internet"
behavior. The trunk calls the old function which restores rc internal
defaults rather than file defaults and so is broken in the way it has
always been broken, but will be fixed when we merge.
In the command below, mpl1 is my branch (1.0.1 release) directory:
 mpl1> grep rc_file lib/matplotlib/sphinxext/plot_directive.py
Surely I have it right now!
JDH
From: Ben G. <bga...@gm...> - 2011年01月06日 01:24:38
On Wed, 5 Jan 2011 16:00:40 -0600, John Hunter <jd...@gm...> wrote:
> Strange -- I'll try and test tonight with a machine disconnected from
> the internet. Out of curiosity, what command/tool are you using to
> monitor the internet requests? Ben, are you seeing the same problems?
>
It took me a long time to finally figure out how to get matplotlib to
respect the wishes of the packaging. Ultimately I believe I got it
working but unfortunately, it's been a while, so I'm not entirely sure
what was necessary. If it helps, I believe the package in my PPA builds
correctly. Sorry I don't have more time to investigate; things are quite
hectic at the moment.
Cheers,
- Ben

Showing 13 results of 13

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /