Opened 7 years ago

Closed 7 years ago

#956 closed defect (fixed)

Possible problem with new doc build process

Reported by: smk78 Owned by: ajj
Priority: blocker Milestone: SasView 4.2.0
Component: SasView Keywords:
Cc: Work Package: SasView Documentation

Description

Having returned from Code Camp and set about updating his office build environment, Richard noticed the docs weren't building properly using the new python setup.py docs command. So I pull-ed and tried on my office desktop and found the same thing. Traceback attached. Seems to be an issue with the API rst files.

Oddly, everything is working on our Code Camp laptops.

I tried deleting my sasview and sasmodels doc build directories on my desktop and trying the doc build again but got the same thing.

Looking at the datetime stamps on some rst files I am harbouring suspicions that the new procedure is not properly slurping files around and what we see on our laptops is because it is finding 'legacy' files from earlier doc builds.

Attachments (1)

doc-build-err.txt (108.0 KB) - added by smk78 7 years ago.
smk78 new doc build traceback

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by smk78

smk78 new doc build traceback

comment:1 Changed 7 years ago by richardh

I cloned saview etc to completely new directories.

python setup/py docs first gives errors such as the one below, thpugh seems to stop at a different place each time I run it, on some previous times it complained after barbell. The docs in sasview are OK but the models section is missing.

Do we stil need to "make clean html" in sasmodels/doc, though that falls over also with same error as below?

Richard


$ python setup.py docs
('Removing existing build directory', 'C:\\sasview4\\sasview\\build', 'for a clean build')
running docs
('========= check for sasmodels at', 'C:\\sasview4\\sasmodels\\doc', '============')
============= Building sasmodels model documentation ===============
make: Entering directory `C:/sasview4/sasmodels/doc'
python genmodel.py ../sasmodels/models/be_polyelectrolyte.py model/be_polyelectrolyte.rst
python genmodel.py ../sasmodels/models/binary_hard_sphere.py model/binary_hard_sphere.rst
python genmodel.py ../sasmodels/models/broad_peak.py model/broad_peak.rst
python genmodel.py ../sasmodels/models/capped_cylinder.py model/capped_cylinder.rst
Traceback (most recent call last):

File "genmodel.py", line 193, in <module>

process_model(sys.argv[1])

File "genmodel.py", line 190, in process_model

make_figure(model_info, opts)

File "genmodel.py", line 124, in make_figure

plt.savefig(path, bbox_inches='tight')

File "C:\Anaconda2\lib\site-packages\matplotlib\pyplot.py", line 471, in savefig

return fig.savefig(*args, kwargs)

File "C:\Anaconda2\lib\site-packages\matplotlib\figure.py", line 1185, in savefig

self.canvas.print_figure(*args, kwargs)

File "C:\Anaconda2\lib\site-packages\matplotlib\backend_bases.py", line 1983, in print_figure

kwargs)

File "C:\Anaconda2\lib\site-packages\matplotlib\backends\backend_agg.py", line 469, in print_png

FigureCanvasAgg?.draw(self)

File "C:\Anaconda2\lib\site-packages\matplotlib\backends\backend_agg.py", line 421, in draw

self.figure.draw(self.renderer)

File "C:\Anaconda2\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper

draw(artist, renderer, *args, kwargs)

File "C:\Anaconda2\lib\site-packages\matplotlib\figure.py", line 898, in draw

func(*args)

File "C:\Anaconda2\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper

draw(artist, renderer, *args, kwargs)

File "C:\Anaconda2\lib\site-packages\matplotlib\axes.py", line 1997, in draw

a.draw(renderer)

File "C:\Anaconda2\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper

draw(artist, renderer, *args, kwargs)

File "C:\Anaconda2\lib\site-packages\matplotlib\image.py", line 350, in draw

im = self.make_image(renderer.get_image_magnification())

File "C:\Anaconda2\lib\site-packages\matplotlib\image.py", line 569, in make_image

transformed_viewLim)

File "C:\Anaconda2\lib\site-packages\matplotlib\image.py", line 201, in _get_unsampled_image

x = self.to_rgba(self._A, bytes=True)

File "C:\Anaconda2\lib\site-packages\matplotlib\cm.py", line 214, in to_rgba

x = self.cmap(x, alpha=alpha, bytes=bytes)

TypeError?: 'NoneType?' object is not callable
make: * [model/capped_cylinder.rst] Error 1
make: Leaving directory `C:/sasview4/sasmodels/doc'
running build

comment:2 Changed 7 years ago by richardh

Above seems to be a matplotlib issue with the auto-generated images in the docs.

When I build & run sasview itself, then sasview.log has message below, is this related?

2017-05-02 11:53:06,487 : WARNING : py.warnings (init__.py:921) :: C:\Anaconda2\lib\site-packages\matplotlib\init__.py:921: UserWarning?: This call to matplotlib.use() has no effect
because the the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

comment:3 Changed 7 years ago by butler

  • Milestone changed from SasView 4.1.1 to SasView 4.2.0

This should only apply to 4.2 and beyond since 4.1.1 is a patch release off of 4.1 release tag and not off of master. Thus moving this ticket to 4.2 as discussed at fortnightly meeting.

comment:4 Changed 7 years ago by richardh

I have fixed sasmodels docs build on my Win7 PC, having noted that my Win7 laptop had matplotlib 1.4.2 but my pc only 1.1.1 Which check_packages did not complain about, and is supposed to be OK according to here:
http://trac.sasview.org/wiki/WinBuildDependencies

As usual I followed the notes here:
http://trac.sasview.org/wiki/AnacondaSetup

did the "conda install ….", twice, which still kept matplotlib 1.1.1, so then
pip uninstall matplotlib
pip install matplotlib==1.4.2

Now my docs for sasmodels build properly. However all this reinstallation of packages may have simply unlocked some other issue.

Richard

comment:5 Changed 7 years ago by smk78

I have now also got the docs to build on my office desktop (in addition to my Code Camp laptop), however both my machines already had matplotlib 1.4.3 installed (ie, newer than Richard's), so I think Richard's comment above may be a red herring.

What I did notice was that my office versions of reportlab, lxml, h5py, setuptools, and comtypes were all some versions behind my laptop. Having installed the same (or almost the same in the case of comtypes; my laptop is a point release ahead) versions as my laptop the docs build.

So I now have:

Checking Required Package Versions….

Common Packages
reportlab Version Installed: 3.2.0
lxml Version Installed: 3.4.4.0
PIL Version Installed: 1.1.7
xhtml2pdf Version Installed: 0.2b1
pyopencl Version Installed: 2015.1
unittest-xml-reporting Version Installed: 1.10.0
pylint Installed (Unknown version)
matplotlib Version Installed: 1.4.3
bumps Version Installed: 0.7.5.9
scipy Version Installed: 0.18.0
periodictable Version Installed: 1.4.1
setuptools Version Installed: 26.1.1
h5py Version Installed: 2.4.0
sphinx Version Installed: 1.3.6
pyparsing Version Installed: 2.0.3
numpy Version Installed: 1.11.1
html5lib Version Installed: 1.0b10
wx Version Installed: 3.0.0.0

Windows Specific Packages:
pywin Version Installed: 219
py2exe Version Installed: 0.6.9
comtypes Version Installed: 1.1.1

Deprecated Packages
You can remove these unless you need them for other reasons!
pyPDF Installed (Version unknown)

Am closing this ticket.

comment:6 Changed 7 years ago by smk78

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.