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

Add docstring and type hints to DistributionMeta #5353

Closed
canyon289 opened this issue Jan 14, 2022 · 3 comments
Closed

Add docstring and type hints to DistributionMeta #5353

canyon289 opened this issue Jan 14, 2022 · 3 comments
Labels

Comments

@canyon289
Copy link
Member

canyon289 commented Jan 14, 2022

Description of your problem

Please add more documentation to DistributionMeta. This code block controls the logic for basically all distributions but its unclear what exactly its doing, or why.

For example whats cls_dict, how is it created, why is it needed?
https://github.com/pymc-devs/pymc/blob/main/pymc/distributions/distribution.py#L76

Note: This not a beginner issue, one of the core devs should do it to ensure its fully descriptive and contains all nuances

@canyon289 canyon289 added the docs label Jan 14, 2022
@canyon289 canyon289 changed the title Add docstring and type hints to Distribution Meta Add docstring and type hints to DistributionMeta Jan 14, 2022
@canyon289
Copy link
Member Author

With some googling I'm realizing that clsdict seems to be some convention for ABCMeta functionality. Nonetheless I think we should still document it in PyMC for these following reasons

  1. It doesnt seem to be a common pattern so im not finding many examples
  2. This portion of the code is loaded with tons of "hardcore" python functionality, from Metaclasses to use of __new__ overwrite, to singledispatch
  3. A lot of this then references other libraries like AePPL, in particular using design choices that aren't immediately obvious

The subset of people in the world that have enough stats knowledge to contribute to PyMC, know Python well enough to know what each individual line does, and know the design patterns of PyMC, AePPL, and Aesara is very small. I'm definitely not one of them :)

Documentation will go a long way to help make this critical part of the library less challenging to understand!

https://programtalk.com/python-examples/abc.ABCMeta.__init__/

@ricardoV94
Copy link
Member

See #5308

@OriolAbril
Copy link
Member

It looks like this was addressed already. Can it be closed?

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

No branches or pull requests

3 participants