matplotlib / matplotlib/sampledoc

`sphinxext/ipython_directive.py` no longer in matplotlib

Abierto
#1 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
CSS
Estrellas
43
Forks
89
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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)?

``` text
$ 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/ in ()
----> 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 ,
or report them in the tracker at . 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)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza ejecutando `make html` e inspecciona `sampledoc/sphinxext/ipython_directive.py` y `sampledoc/ipython_directive.rst`; después revisa los otros archivos mencionados en las advertencias: `custom_look.rst`, `cheatsheet.rst` y `extensions.rst`. Se considera terminado cuando la directiva funciona con la versión actual de matplotlib, la ubicación de origen indicada resulta útil, se han corregido los problemas de indentación y referencias, y la compilación de la documentación termina sin estos errores ni advertencias.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
numpy, python
Área
build-system, documentation
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.