0.98.5 - Doc building question on matplotlibrc

Hello,
while preparing the debian package update for 0.98.5 I went thru a
problem: we remove doc/mpl_data/matplotlibrc because it will be
modified (to change backend (that now is set to MacOSX in the tarball
distributed..?)) and up to now it wasn't used.

Now, doc/make.py fails because of

  shutil.copy('mpl_data/matplotlibrc', '_static/matplotlibrc')

So, can we use another 'matplotlibrc' file or the one in doc/mpl_data
has something specific to doc and needs to maintained?

Thanks,

···

--
Sandro Tosi (aka morph, Morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

The default matplotlibrc file in mpl-data/ is created by setup.py during the build process. The default backend is selected according to which gui toolkits are available, and defaults to Agg if no supported toolkit is available. setup.py only selects the macosx backend if the build is being performed on a macosx system. The source tarball is apparently prepared on a Mac, but I dont think it matters that the source dist contains this platform-specific backend, since the file will be overwritten with more appropriate settings anyway when you run setup.py build.

It would really be best to not remove the file that is created as a result of running setup.py build. The mpl documentation suggests users to copy this file into their ~/.matplotlib/ or wherever if they want to modify the default properties, and it contains some documentation for each of the settings.

On the other hand, if you are running setup.py build and the resulting matplotlibrc file still says the default backend is macosx, and you are not running macosx, and you have configured setup.cfg to set some other default backend, then it is a bug that needs to be fixed.

Darren

···

On Sun, Dec 14, 2008 at 8:12 AM, Sandro Tosi <morph@…12…> wrote:

Hello,

while preparing the debian package update for 0.98.5 I went thru a

problem: we remove doc/mpl_data/matplotlibrc because it will be

modified (to change backend (that now is set to MacOSX in the tarball

distributed…?)) and up to now it wasn’t used.

Now, doc/make.py fails because of

shutil.copy(‘mpl_data/matplotlibrc’, ‘_static/matplotlibrc’)

So, can we use another ‘matplotlibrc’ file or the one in doc/mpl_data

has something specific to doc and needs to maintained?

Hello,

Hello,
while preparing the debian package update for 0.98.5 I went thru a
problem: we remove doc/mpl_data/matplotlibrc because it will be
modified (to change backend (that now is set to MacOSX in the tarball
distributed..?)) and up to now it wasn't used.

Now, doc/make.py fails because of

shutil.copy('mpl_data/matplotlibrc', '_static/matplotlibrc')

So, can we use another 'matplotlibrc' file or the one in doc/mpl_data
has something specific to doc and needs to maintained?

The default matplotlibrc file in mpl-data/ is created by setup.py during the
build process. The default backend is selected according to which gui
toolkits are available, and defaults to Agg if no supported toolkit is
available. setup.py only selects the macosx backend if the build is being
performed on a macosx system. The source tarball is apparently prepared on a
Mac, but I dont think it matters that the source dist contains this
platform-specific backend, since the file will be overwritten with more
appropriate settings anyway when you run setup.py build.

It would really be best to not remove the file that is created as a result
of running setup.py build. The mpl documentation suggests users to copy this
file into their ~/.matplotlib/ or wherever if they want to modify the
default properties, and it contains some documentation for each of the
settings.

On the other hand, if you are running setup.py build and the resulting
matplotlibrc file still says the default backend is macosx, and you are not
running macosx, and you have configured setup.cfg to set some other default
backend, then it is a bug that needs to be fixed.

Well, what I'm actually asking is: can I use any matplotlibrc file (be
it from any location in the tarball or forged during build process) or
the one in doc/mpl_data has something specific to documentation that
needs to be preserved.

Don't worry, we ship matplotlibrc file (the one built), but I need to
know if that particular one has something ad-hoc for doc.

Thanks,

···

On Sun, Dec 14, 2008 at 17:07, Darren Dale <dsdale24@...149...> wrote:

On Sun, Dec 14, 2008 at 8:12 AM, Sandro Tosi <morph@...12...> wrote:

--
Sandro Tosi (aka morph, Morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

The rc file in mpl_data does get pulled into the the docs, you can see the result at http://matplotlib.sourceforge.net/users/customizing.html. But it does not have to be preserved, like I said, it gets overwritten when you run setup.py build, with new settings depending on what setup.py determines are the most appropriate and what settings you insist on having by editing setup.cfg.

···

On Sun, Dec 14, 2008 at 1:46 PM, Sandro Tosi <matrixhasu@…149…> wrote:

Hello,

On Sun, Dec 14, 2008 at 17:07, Darren Dale <dsdale24@…149…> wrote:

On Sun, Dec 14, 2008 at 8:12 AM, Sandro Tosi <morph@…12…> wrote:

Hello,

while preparing the debian package update for 0.98.5 I went thru a

problem: we remove doc/mpl_data/matplotlibrc because it will be

modified (to change backend (that now is set to MacOSX in the tarball

distributed…?)) and up to now it wasn’t used.

Now, doc/make.py fails because of

shutil.copy(‘mpl_data/matplotlibrc’, ‘_static/matplotlibrc’)

So, can we use another ‘matplotlibrc’ file or the one in doc/mpl_data

has something specific to doc and needs to maintained?

The default matplotlibrc file in mpl-data/ is created by setup.py during the

build process. The default backend is selected according to which gui

toolkits are available, and defaults to Agg if no supported toolkit is

available. setup.py only selects the macosx backend if the build is being

performed on a macosx system. The source tarball is apparently prepared on a

Mac, but I dont think it matters that the source dist contains this

platform-specific backend, since the file will be overwritten with more

appropriate settings anyway when you run setup.py build.

It would really be best to not remove the file that is created as a result

of running setup.py build. The mpl documentation suggests users to copy this

file into their ~/.matplotlib/ or wherever if they want to modify the

default properties, and it contains some documentation for each of the

settings.

On the other hand, if you are running setup.py build and the resulting

matplotlibrc file still says the default backend is macosx, and you are not

running macosx, and you have configured setup.cfg to set some other default

backend, then it is a bug that needs to be fixed.

Well, what I’m actually asking is: can I use any matplotlibrc file (be

it from any location in the tarball or forged during build process) or

the one in doc/mpl_data has something specific to documentation that

needs to be preserved.

Don’t worry, we ship matplotlibrc file (the one built), but I need to

know if that particular one has something ad-hoc for doc.

In svn, doc/mpl_data is just a symlink to lib/matplotlib/mpl-data

  http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/doc/mpl_data?view=markup

Apparently symlinks are lost in building an sdist, and doc/mpl_data
becomes a copy. So in the actual src, the rc files are not just
identical in the two locations, they are the same file. It makes the
most sense for the users to see in the docs the default rc file they
are getting with your actual install.

···

On Sun, Dec 14, 2008 at 7:46 PM, Sandro Tosi <matrixhasu@...149...> wrote:

Well, what I'm actually asking is: can I use any matplotlibrc file (be
it from any location in the tarball or forged during build process) or
the one in doc/mpl_data has something specific to documentation that
needs to be preserved.

Hello John and Darren,

···

On Sun, Dec 14, 2008 at 22:05, John Hunter <jdh2358@...149...> wrote:

On Sun, Dec 14, 2008 at 7:46 PM, Sandro Tosi <matrixhasu@...149...> wrote:

Well, what I'm actually asking is: can I use any matplotlibrc file (be
it from any location in the tarball or forged during build process) or
the one in doc/mpl_data has something specific to documentation that
needs to be preserved.

In svn, doc/mpl_data is just a symlink to lib/matplotlib/mpl-data

http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/doc/mpl_data?view=markup

Apparently symlinks are lost in building an sdist, and doc/mpl_data
becomes a copy. So in the actual src, the rc files are not just
identical in the two locations, they are the same file. It makes the
most sense for the users to see in the docs the default rc file they
are getting with your actual install.

Ah, now it's clear! I added a patch to just:

- shutil.copy('mpl_data/matplotlibrc', '_static/matplotlibrc')
+ shutil.copy('../lib/matplotlib/mpl-data/matplotlibrc',
'_static/matplotlibrc')

And now the doc is built (but another problem, worth another thread, comes out).

Thanks & Cheers,
--
Sandro Tosi (aka morph, Morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

This has already been committed to the 98.5 branch.
JDH

···

On Tue, Dec 16, 2008 at 4:20 AM, Sandro Tosi <morph@...12...> wrote:

- shutil.copy('mpl_data/matplotlibrc', '_static/matplotlibrc')
+ shutil.copy('../lib/matplotlib/mpl-data/matplotlibrc',
'_static/matplotlibrc')