Skip to content

docs: fix documentation rendering with scikit-package standards. #64

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

Open
wants to merge 2 commits into
base: migration
Choose a base branch
from

Conversation

ycexiao
Copy link

@ycexiao ycexiao commented Jul 30, 2025

What problem does this PR address?

Fix the documentation rendering.

What should the reviewer(s) do?

Please check the rendered documentation.
image
image
image

Copy link
Author

@ycexiao ycexiao left a comment

Choose a reason for hiding this comment

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

@sbillinge, it's ready for review.

@@ -1,3 +1,3 @@
{
"path": "../../../../examples/QPA-Quantitative phase analysis.ipynb"
Copy link
Author

Choose a reason for hiding this comment

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

Examples with .ipynb files are moved from the top-level directory into the docs directory, as other diffpy packages do.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think these should be in the top level tbh. These are examples for users, not source for docs so it doesn't make so much sense to me to put them into docs/source. It kind of depends whether the examples are just going to appear in the rst or whether we expect users to be able to import and run them. They won't get bundled in the release, but at least they are more accessible (in docs/examples in the repo)

Copy link
Contributor

Choose a reason for hiding this comment

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

wait, scratch my comment. As long as it is docs/examples I am happy...

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, actualy, thinking again, this change we may want to run by @vincefn to see his preference. I could also see examples at the top level making them more discoverable. I think if it were my choice I would do docs/examples but let's give @vincefn a chance to puah back before we merge this.

@@ -32,7 +32,7 @@ was developed by V. Favre-Nicolin as part of the development of the
Further developments including the ability to index and refine
powder patterns, solve and display crystal structures, using the
global optimisation and least squares algorithms (see the
:doc:`examples/index`) are provided by Vincent Favre-Nicolin (ESRF).
:doc:`examples/examples`) are provided by Vincent Favre-Nicolin (ESRF).
Copy link
Author

Choose a reason for hiding this comment

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

examples/index.rst is renamed to examples/examples.rst.

@ycexiao ycexiao marked this pull request as ready for review July 30, 2025 18:23
@ycexiao
Copy link
Author

ycexiao commented Jul 30, 2025

The API page is empty
image
I think it is because the error

WARNING: autodoc: failed to import module 'pyobjcryst'; the following exception was raised:
No module named 'pyobjcryst._pyobjcryst' [autodoc.import_object]

I installed pyobjcrst by

pip install -e.

Are there any additional steps to install pyobjcrst?

@ycexiao
Copy link
Author

ycexiao commented Jul 31, 2025

@sbillinge , is it ready for merging?

@vincefn
Copy link
Collaborator

vincefn commented Jul 31, 2025

Who should I add as maintainer on readthedocs, so you can also test the version generated there ?

@Tieqiong
Copy link

Are there any additional steps to install pyobjcrst?

@ycexiao
please run
conda install scons
and
scons -j4 dev

This will produce a _pyobjcryst.* in your src/pyobjcryst. Then generate api and build html again. You should be able to see the modules and C++ signatures

@ycexiao
Copy link
Author

ycexiao commented Aug 1, 2025

@Tieqiong, thank you. After running

conda install scons
scons -j4 dev
cd docs
make html

I get

WARNING: autodoc: failed to import module 'pyobjcryst'; the following exception was raised:
pyobjcryst/src/pyobjcryst/_pyobjcryst.so: undefined symbol: _ZN5boost6python7objects7add_docERKNS0_3api6objectEPKc [autodoc.import_object]

I also tried to install pyobjcrst in development mode as described in README. Following the steps, I ran scons -j4 test, and I got

src/pyobjcryst/atom.py:27: in <module>
    from pyobjcryst._pyobjcryst import Atom
E   ImportError: pyobjcryst/src/pyobjcryst/_pyobjcryst.so: undefined symbol: _ZN5boost6python7objects7add_docERKNS0_3api6objectEPKc

Could you please help me with the installation problem?

@sbillinge
Copy link
Contributor

Who should I add as maintainer on readthedocs, so you can also test the version generated there ?

@vincefn please could you add me (@sbillinge )

@sbillinge
Copy link
Contributor

@vincefn quick question. Do you mind if we move Examples under docs (current standard in diffpy) or do you want to keep them at the top level (e.g., for easier discovery)? Ok to do it either way so just let us know.

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

Successfully merging this pull request may close these issues.

4 participants