Skip to content

Improve creating an Op documentation page #1086

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

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Nov 13, 2024

See commit message for list of changes.

The changes are based on feedback from helping other devs and users

Tagging @OriolAbril because I'm 100% sure I messed up some sphinx stuff (sorry)


📚 Documentation preview 📚: https://pytensor--1086.org.readthedocs.build/en/1086/

@ricardoV94 ricardoV94 changed the title Improve creating_an_op.rst Improve creating an op documentation page Nov 13, 2024
@@ -165,35 +151,6 @@ or :meth:`Op.make_thunk`.
:meth:`COp.c_code` and other related ``c_**`` methods. Note that an
:class:`Op` can provide both Python and C implementations.

:meth:`Op.make_thunk` method is another alternative to :meth:`Op.perform`.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is outdated, and tbh I don't think it's necessary for 99.9999% of the people reading this page

@ricardoV94 ricardoV94 mentioned this pull request Nov 13, 2024
@ricardoV94 ricardoV94 force-pushed the creating_an_op branch 4 times, most recently from d37103d to 1d9bc2b Compare November 19, 2024 11:03
@@ -1,40 +1,18 @@

.. _creating_an_op:

Creating a new :class:`Op`: Python implementation
Creating a new :ref:`op`: Python implementation
Copy link
Member

@OriolAbril OriolAbril Nov 19, 2024

Choose a reason for hiding this comment

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

Where do you want the :ref:`op`/:class:`Op` to point to? To https://pytensor--1086.org.readthedocs.build/en/1086/extending/op.html or to https://pytensor--1086.org.readthedocs.build/en/1086/extending/graphstructures.html#op?

I think many of the broken cross-references come from this page: https://pytensor--1086.org.readthedocs.build/en/1086/extending/op.html, which is wildly inconsistent with itself. If the cross-reference would ideally point there we should fix this page first.

Copy link
Member Author

@ricardoV94 ricardoV94 Nov 19, 2024

Choose a reason for hiding this comment

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

Will check. I just wanted it to point somewhere, it wasn't before

Copy link
Member Author

Choose a reason for hiding this comment

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

@OriolAbril extending op seems much more useful than the graphstructures#op, so I guess there.

fonnesbeck

This comment was marked as duplicate.

@ricardoV94 ricardoV94 force-pushed the creating_an_op branch 2 times, most recently from ec648b9 to ade5653 Compare February 13, 2025 09:12
@ricardoV94 ricardoV94 force-pushed the creating_an_op branch 2 times, most recently from f797c62 to c64736a Compare February 20, 2025 14:38
@ricardoV94 ricardoV94 changed the title Improve creating an op documentation page Improve creating an Op documentation page Feb 20, 2025
Copy link
Member

@fonnesbeck fonnesbeck left a comment

Choose a reason for hiding this comment

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

Just a few typos. LGTM.

Changes:
1. Remove references to c-code which apply to `COp` but not `Op`
2. Fix failing doctests
3. Improve explanation of `make_node`
4. Emphasize distinction between itypes/otypes and make-node
5. Show `L_op` instead of `grad`
6. Show how to test `L_op` and `infer_shape` implementation
7. Simplify explanation of `__props__` and illustrate in example.
8. Introduce more complex multi-output Op to drive these details home
9. Remove old references to numba/ random variable Ops
@ricardoV94 ricardoV94 merged commit e301a42 into pymc-devs:main Jun 10, 2025
17 checks passed
@ricardoV94 ricardoV94 deleted the creating_an_op branch June 10, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants