Skip to content

ARROW-3834: [Doc] Merge C++ and Python documentation - #2856

Closed
xhochy wants to merge 17 commits into
apache:masterfrom
xhochy:doc-merge
Closed

ARROW-3834: [Doc] Merge C++ and Python documentation#2856
xhochy wants to merge 17 commits into
apache:masterfrom
xhochy:doc-merge

Conversation

@xhochy

Copy link
Copy Markdown
Member

No description provided.

@xhochy

xhochy commented Oct 28, 2018

Copy link
Copy Markdown
MemberAuthor

@wesm@pitrou Would love to get your feedback on this early as it involves some work. The C++ part works nice with the XML generated by doxygen but one needs to explicitly list the parts that should show up in Sphinx. There is also an autoindex variant for C++ but that produces a wall of errors. I'm quite happy with the manual clustering approach. While it will lead to some classes not being automatically included in the documentation, it already gives the user a categorisation of the classes.

@kou As you mentioned in the mail thread, GLib needs the XML for GObject introspection to work, so I'm not going to touch that. I would still add top-level sections for the languages based on it and link to the generated API docs. Would that be ok for you as a first shot?

@kou

kou commented Oct 29, 2018

Copy link
Copy Markdown
Member

Would that be ok for you as a first shot?

Yes!

@pitrou

Copy link
Copy Markdown
Member

I almost never read the C++ docs (reading the .h files instead), so I'm not sure how people like to use it currently. I like this PR on the principle.

@wesm

wesm commented Oct 29, 2018

Copy link
Copy Markdown
Member

I will take a look when I can. We might go ahead and promote this to the top level of the repository to start having more documentation across languages

@kszucs

kszucs commented Nov 1, 2018

Copy link
Copy Markdown
Member

I'm not sure about this. IMHO We should either move everything (including go, rust, java, ruby, etc.) to sphinx and make doc a top level directory or use the standard documentation tool for that particular language.

@wesm

wesm commented Nov 1, 2018

Copy link
Copy Markdown
Member

I think there's two kinds of documentation:

  • Prose explanations of things
  • Generated / browsable API documentation

In Python we are using Sphinx for both. Other projects only are doing the latter.

I would be in favor of having a top level doc/ directory where we develop prose documentation for the entire Arrow project including some of its programming language implementations. How we deal with generated API documentation may be on a case by case basis, but the doc index page should have links to every API listing that exists (Java, GLib, Python, Ruby, JavaScript, etc.). Getting every project's API docs into a single Sphinx project is probably too much to ask

@pitrou

Copy link
Copy Markdown
Member

I wanted to give this a try but it seems doc building currently fails. The Python API docs are not generated anymore.

@xhochy

Copy link
Copy Markdown
MemberAuthor

@pitrou I will have a look later but one thing I noticed is that it always helped to have the Python package build and installed using both:

python setup.py build_ext --build-type=$ARROW_BUILD_TYPE --with-parquet --with-plasma --inplace
python setup.py build_ext --build-type=$ARROW_BUILD_TYPE --with-parquet --with-plasma install

@xhochy

Copy link
Copy Markdown
MemberAuthor

@pitrou rebased and also seeing a problem with the API docs.

@xhochy

Copy link
Copy Markdown
MemberAuthor

These were issues with sphinx>=1.8. I'll push a fix soon.

@pitrou

Copy link
Copy Markdown
Member

The nice thing with this PR is that it would allow easy API cross-links from prose documentation, e.g.:

.. cpp:namespace:: arrow
Call :cpp:func:`Array::IsNull` to query a :cpp:class:`Array`'s validity bitmap.

One downside is that building docs becomes a bit more complicated (it also seems to make Sphinx building slower).

@xhochy
xhochyforce-pushed the doc-merge branch 2 times, most recently from f20e6d2 to ea08befCompareNovember 17, 2018 18:05
@xhochyxhochy changed the title RFC: Merge C++ and Python documentationARROW-3834: [Doc] Merge C++ and Python documentationNov 18, 2018
@xhochy

Copy link
Copy Markdown
MemberAuthor

@kszucs This now also contains a docker setup for building the Sphinx documentation.

@wesm@pitrou This is ready for review / merge. It contains a very basic set of C++ documentation. I would like to work on that in a separate PR and get the things here merged to prevent further merge conflicts.

@pitrou

Copy link
Copy Markdown
Member

Apparently there's a failed Travis-CI entry.

Comment thread.gitignore Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a wildcard for the version number here?

Comment threadci/conda_env_python.yml Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is recommonmark?

@kszucskszucsNov 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conda_env_cpp.yml and conda_env_python.yml files contain arrow-cpp's and pyarrow's dependencies and eventually will be used to spin up the development environment, see #2836

I suggest to create a ci/conda_env_sphinx.yml or conda_env_doc.yml with the sphinx dependencies, including doxygen and rsync too.

Of course this requires a minimal arrow/doc/Dockerfile too:

FROM arrow:python-3.6
# install python specific packagesADD ci/conda_env_sphinx.yml /arrow/ci/
RUN conda install -c conda-forge \
--file arrow/ci/conda_env_sphinx.yml && \
conda clean --all
# build and testCMD arrow/ci/docker_build_cpp.sh && \
arrow/ci/docker_build_python.sh && \
arrow/ci/docker_build_sphinx.sh

Comment threaddoc/source/conf.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm -1 on including MarkDown docs in the Sphinx source tree. We should convert those documents to reST format. It's a bit of work, but it will be much nicer afterwards.

@xhochyxhochyNov 21, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wesm@jacques-n I cannot exactly recall but I think there were some strong voices that wanted the format docs to be in Markdown? I'm happy with converting them to reST format but only when people are fine with this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think anyone has ever proposed converting the format docs to another markup language. In principle I don't see an issue with using reST because people will mostly be consuming the documents via the generated webpage. These aren't documents that are going to be frequently edited, anyway

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then I'll proceed and convert them to reST.

Comment threadcpp/Dockerfile Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to ci/conda_env_sphinx.yml?

Comment threaddev/docs/run_doc.sh Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename this file according to the Dockerfile example above: arrow/ci/docker_build_sphinx.sh and call these scripts from the docker CMD instead.

Comment threaddoc/source/conf.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an unused version variable in the conf.py which We should set to pyarrow.__version__ (suppose pyarrow is installed) and use here as html_title = u'Apache Arrow {}'.format(version)

Comment threaddocker-compose.yml Outdated

@kszucskszucsNov 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Usage:# docker-compose build cpp# docker-compose build python# docker-compose build docs# docker-compose run docsimage: arrow:docsbuild:
context: .dockerfile: doc/Dockerfile

@kszucskszucs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xhochy I can reorganize the docker related stuff too if You don't have time for it.

Really minor: I'd use the plural docs instead of doc especially after merging multiple documentations under the same roof.

@xhochy
xhochyforce-pushed the doc-merge branch 2 times, most recently from 147b354 to 5b6238bCompareNovember 27, 2018 21:45
@xhochy

Copy link
Copy Markdown
MemberAuthor

@kszucs@pitrou Can you take a look at this again? I hope I have incorporated all comments.

@pitrou

Copy link
Copy Markdown
Member

I'll take a look Monday.

Comment threadpython/README.md Outdated
Comment threaddocs/source/python/pandas.rst Outdated
@wesm
wesm deleted the doc-merge branch December 4, 2018 03:25
@wesm
wesm restored the doc-merge branch December 4, 2018 03:27
@wesmwesm reopened this Dec 4, 2018
@wesm

wesm commented Dec 4, 2018

Copy link
Copy Markdown
Member

I'm sorry to equivocate -- I rolled back this commit. I think that moving the protocol definitions from format/ to docs/source/format/ is incorrect. The protocol files (.fbs and .proto) should remain in format/ in the root of the repository, while the documentation about the format can be part of docs/. Does that sound reasonable?

@xhochy

Copy link
Copy Markdown
MemberAuthor

@wesm sounds reasonable. I'll move them

@xhochyxhochy mentioned this pull request Dec 5, 2018
@xhochy

Copy link
Copy Markdown
MemberAuthor

@wesm Fixed, so this is ready for re-review.

@wesm

wesm commented Dec 6, 2018

Copy link
Copy Markdown
Member

Looks good. I will add a simple README to format/ and then merge this

Change-Id: I0be8ff87c6ffd352e9c26e01154dcf2da5743873
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@xhochy@kou@pitrou@wesm@kszucs@fsaintjacques