Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx breaking on notebook parsing #412

Closed
sbenthall opened this issue Oct 22, 2019 · 6 comments
Closed

Sphinx breaking on notebook parsing #412

sbenthall opened this issue Oct 22, 2019 · 6 comments
Assignees

Comments

@sbenthall
Copy link
Contributor

See #406 (comment)

@sbenthall
Copy link
Contributor Author

Removing the notebooks from the autosummary list in the index.rst documentation fixes this.

https://www.sphinx-doc.org/en/master/usage/extensions/autosummary.html

It doesn't make sense for autosummarize notebooks anyway. The code is not API code.

Fixing this problem reveals another breaking exception to make html:

Exception occurred:
  File "/home/sb/projects/econ-ark/HARK/HARK/cstwMPC/MakeCSTWfigs.py", line 16, in <module>
    f = open(my_file_path  + '/Results/LCbetaPointNetWorthLorenzFig.txt','r')
FileNotFoundError: [Errno 2] No such file or directory: '/home/sb/projects/econ-ark/HARK/HARK/cstwMPC/Results/LCbetaPointNetWorthLorenzFig.txt'

@sbenthall
Copy link
Contributor Author

The breaking file is in the HARK/cstwMPC project directory, which is slated for removal. See PR #334
It also appears to be a standalone script, rather than a library.
So it should not be involved in autogenerated API documentation--it is not specifying anything with an API.

I'll remove this and similarly misplaced files from the autosummary list.

@sbenthall
Copy link
Contributor Author

Sphinx warning:

/home/sb/projects/econ-ark/HARK/Documentation/notebooks/DCT-Copula-Illustration.rst: WARNING: document not readable. Ignored.

The symlink here points to a file that's missing from the repository: ../../DCT-Copula-Illustration.ipynb

That looks like an incorrect path anyway; there is a working symlink to ../../Examples/Gentle-Intro-To-HARK.ipynb, but there is no DCT-Copula-Illustration.ipynb notebook in the Examples directory either.

@sbenthall
Copy link
Contributor Author

Using sphinx html, recommonmark is erroring; it looks like it's erroring in the parsing of the HARKManual.

reading sources... [  4%] HARKmanual                                            
Exception occurred:
  File "/home/sb/anaconda3/lib/python3.6/site-packages/recommonmark/parser.py", line 211, in visit_image
    img_node['alt'] = ''.join(content)
TypeError: sequence item 1: expected str instance, NoneType found

There are also still autosummary errors.

As there seems to be a lot of work here I'll stop updating this issue and report the work in the upcoming PR.

@sbenthall
Copy link
Contributor Author

The solution to the recommonmark error appears to be...removing the recommonmark extension.
Then sphinx executes without error and builds HTML files.

I'm not sure what recommonmark was doing and it may have been there for a good reason.

sbenthall added a commit to sbenthall/HARK that referenced this issue Oct 22, 2019
sbenthall added a commit to sbenthall/HARK that referenced this issue Oct 22, 2019
@sbenthall sbenthall self-assigned this Oct 23, 2019
sbenthall added a commit to sbenthall/HARK that referenced this issue Oct 24, 2019
llorracc added a commit that referenced this issue Oct 24, 2019
fixes to requirements.txt to fix sphinx dependency errors. Fixes #406 #412
@sbenthall
Copy link
Contributor Author

Fixed with #411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant