Doc: Modernize pure mode tutorial (pure.rst) with dual syntax tabs
Title: Doc: Modernize pure mode tutorial (pure.rst) with dual syntax tabs
Description:
This PR completes the modernization of the documentation structure in docs/src/tutorial/pure.rst by converting all isolated code blocks and single .. literalinclude:: references into the unified, dual-syntax .. tabs:: structure (Pure Python vs. Traditional Cython).
This change significantly improves the clarity and maintainability of the tutorial, allowing users to easily compare the Pure Python method with the traditional Cython equivalent side-by-side.
Key Changes:
- Global Conversion: Most tutorial examples now use the
.. tabs::structure. - New Examples: Created corresponding
.pyxfiles for nearly all Pure Python examples (e.g.,exceptval_syntax.pyx,type_hints.pyx,c_arrays.pyx). - RST Cleanup: Resolved indentation issues and updated surrounding text for consistency with the new structure.
I have verified the build using make html locally, and there are no warnings or errors related to the file structure.
Thank you for your contribution! I had a quick look. It contains generated .cpp file (docs/examples/userguide/wrapping_CPlusPlus/rect_with_attributes.cpp). The file was commited by mistake I suppose.
Thank you for your contribution! I had a quick look. It contains generated .cpp file (docs/examples/userguide/wrapping_CPlusPlus/rect_with_attributes.cpp). The file was commited by mistake I suppose.
@matusvalo
Hello,
I'm also a new contributor and would like to help modernize the pages in issue #4187 ([ENH] Pythonise the documentation! )that haven't been completed yet.
But scoder said "It might be the last of the listed pages that can be presented in both variants at this stage."(" It "refers to the work of Mars-aliens . ) Does this mean that these unfinished pages are no longer able to be completed?
I'm a greenhand and I'm eager to make contribution to cython. Please let me know that if I still want to work on this task, which page would be a good one to start with?
Thanks!
You can run the relevant tests with:
python3 runtests.py -vv --no-file --no-doctest --no-unit
(that's more just disabling most of the other tests, but that should be enough for you to test if your examples work relatively quickly)
The failure in the Benchmarks workflow appears unrelated to this PR. This change only touches documentation, so no benchmark CSV files are produced, and the benchmark_results_*.csv glob resolves to an empty list, causing the script to error.
The documentation looks good.
The benchmark changes definitely shouldn't be part of this PR, and I don't think we need them at all. I didn't see the actual failure they were claiming to fix but I suspect it might have just been a random failure to connect to github (which happens sometimes) and not anything that needs fixing
There is also change in .github/workflows/ci.yml. Is it needed for this PR? I would remove it or move to separate PR...
I think there is good progress with the PR. I added several comments...
You're right — the change in github/workflows/ci.yml isn’t needed for this PR. It was added while testing some benchmark issues but isn’t required anymore. I’ll remove it in the next update.
I think you ended up changing the line endings in some files. Please revert that, or just replace them with standard Unix line endings everywhere.
Hi! Following up on this PR since it’s blocking some of my next steps. Please take a look when you’re available. Thank you!
@scoder Hi! Just following up on this PR since it has been a while. Please let me know if there’s anything I should improve or adjust. Thanks!
@matusvalo Hi, just a friendly reminder on this PR since it's been a while. Let me know if there’s anything I should update or revise. Appreciate your review!
There's definitely still a bunch of files which are identical except for line ending whitespace changes (your editor has substituted /n for /r/n) which should be undone. That might be fixed with the git core.autocrlf setting?
There's definitely still a bunch of files which are identical except for line ending whitespace changes (your editor has substituted
/nfor/r/n) which should be undone. That might be fixed with the gitcore.autocrlfsetting?
Thanks for the hint! I’ve fixed the CRLF issues — my editor had indeed introduced \r\n line endings.
I’ve converted the affected files back to consistent LF line endings and removed all trailing whitespace.
git show --check is now clean.
I’ve also updated my git config (core.autocrlf=false) to prevent this from happening again.
There's definitely still a bunch of files which are identical except for line ending whitespace changes (your editor has substituted
/nfor/r/n) which should be undone. That might be fixed with the gitcore.autocrlfsetting?Thanks for the hint! I’ve fixed the CRLF issues — my editor had indeed introduced
\r\nline endings.
Unfortunately I don't think they're fixed. docs/examples/tutorial/pure/A_equivalent.pyx for example is apparently identical but shows up with every line changed on the github UI
There's definitely still a bunch of files which are identical except for line ending whitespace changes (your editor has substituted
/nfor/r/n) which should be undone. That might be fixed with the gitcore.autocrlfsetting?Thanks for the hint! I’ve fixed the CRLF issues — my editor had indeed introduced
\r\nline endings.Unfortunately I don't think they're fixed. docs/examples/tutorial/pure/A_equivalent.pyx for example is apparently identical but shows up with every line changed on the github UI
Hi @da-woods, I've checked the files carefully and fixed the CRLF issues. All relevant files now have consistent Unix-style line endings (\n). For example, docs/examples/tutorial/pure/A_equivalent.pyx no longer contains any \r characters. Please let me know if you still see any issues.
Mostly fine now, but I also had a few comments. Once the remaining ones are resolved, I think this'll be done.
Thanks for the detailed feedback! I've incorporated the suggested changes and updated the PR. Happy to adjust further if needed.