matplotlib / matplotlib/sampledoc

`sphinxext/ipython_directive.py` no longer in matplotlib

Đang mở
#1 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
CSS
Star
43
Fork
89
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

First of all: thanks for making this great tutorial!

It doesn't work with matplotlib HEAD though, because matplotlib/sphinxext/ipython_directive.py no longer exists.
This worked for me:
cp ipython/docs/sphinxext/ipython_directive.py sampledoc/sphinxext

After that a missing import numpy as np in combination with @doctest on line 120 in sampledoc/ipython_directive.rst makes sphinx abort.
For me simply adding the missing import numpy as np doesn't work, the doctest still fails.
Is it possible to make the following error message point to the .rst file name and line number that contains np.random.rand(10,2) (instead of suggesting a bug in sphinx)?

$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.0.7
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/__init__.py:908: 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.

  if warn: warnings.warn(_use_error_msg)
loading pickled environment... not yet created
building [html]: targets for 7 source files that are out of date
updating environment: 7 added, 0 changed, 0 removed
reading sources... [100%] ipython_directive                                                                                       
Exception occurred:
  File "/Users/deil/github/sampledoc/sphinxext/ipython_directive.py", line 376, in process_output
    raise RuntimeError(e)
RuntimeError: output prompt="Out[13]:" does not match out line=---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/Users/deil/github/sampledoc/<ipython-input-13-f032a6173cb5> in <module>()
----> 1 np.random.rand(10,2)

NameError: name 'np' is not defined
The full traceback has been saved in /var/folders/9v/3cf9p8mx0n1gzcsq3mw9799m0000gn/T/sphinx-err-rTVMpU.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
make: *** [html] Error 1

There's a few more small issues:

  • Line 101 in sampledoc/ipython_directive.rst needs to be indented
    Users/deil/github/sampledoc/custom_look.rst:6: (WARNING/2) Duplicate explicit target name: "sphinx".
    /Users/deil/github/sampledoc/cheatsheet.rst:7: WARNING: undefined label: cheatsheet -literal (if the link has no caption the label must precede a section header)
    /Users/deil/github/sampledoc/extensions.rst:53: WARNING: undefined label: extensions-literal (if the link has no caption the label must precede a section header)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách chạy make html và kiểm tra sampledoc/sphinxext/ipython_directive.py cùng sampledoc/ipython_directive.rst, sau đó xem xét các tệp khác được nêu trong các cảnh báo: custom_look.rst, cheatsheet.rstextensions.rst. Công việc được xem là hoàn tất khi directive hoạt động với matplotlib hiện tại, vị trí mã nguồn được báo cáo là hữu ích, các vấn đề về thụt lề và tham chiếu được sửa, và quá trình build tài liệu hoàn tất mà không có các lỗi hoặc cảnh báo này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
numpy, python
Lĩnh vực
build-system, documentation
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.