mpastell / Pweave

Pweave is a scientific report generator and a literate programming tool for Python. It can capture the results and plots from data analysis and works well with numpy, scipy and matplotlib.
http://mpastell.com/pweave
Other
435 stars 64 forks source link

Absolute paths with figures cause error #10

Closed aaren closed 9 years ago

aaren commented 11 years ago

Reproduce (where example.mdw has a code block that would cause a matplotlib call):

# ok
Pweave example.mdw
# not ok
Pweave /path/to/example.mdw

IOError: [Errno 2] No such file or directory: 'figures//tmp/simple_figure2_1.png'

aaren commented 11 years ago

this is caused by not using os.path.join in plt.savefig

aaren commented 11 years ago

problem: specifying figdir doesn't do anything with absolute paths

this is due to the way figure names are created, which uses _basename:

def _basename(self):                                                        
    return(re.split("\.+[^\.]+$", self.source)[0])

where source is the input filename.

mpastell commented 9 years ago

Closed c5ffe663a4eafd159519f97107d08422e22fe0eb