pymc-labs / pymc-marketing

Bayesian marketing toolbox in PyMC. Media Mix (MMM), customer lifetime value (CLV), buy-till-you-die (BTYD) models and more.
https://www.pymc-marketing.io/
Apache License 2.0
683 stars 190 forks source link

UML Diagrams #178

Closed ColtAllen closed 1 year ago

ColtAllen commented 1 year ago

I created some UML diagrams while working on https://github.com/pymc-labs/pymc-marketing/pull/177, which are shown below. Is it worth adding these to the new-release CI so they are auto-generated each time? Furthermore, are they worth adding to the documentation despite being rather developer-specific?

MMM

mmm_uml

CLV

clv_uml

MMM Tests

tests_mmm_uml

CLV Tests

tests_clv_uml

Note these diagrams only illustrate internal class methods/attributes and inheritance, and will not display imported function calls like clv.utils.to_xarray() and clv.utils.customer_lifetime_value().

To recreate these diagrams, install graphviz and pylint and run this CLI command:

$ pyreverse directory/path -f 'ALL' -o png

This will also create an additional packages.png file which should be deleted.

juanitorduz commented 1 year ago

From a developer's perspective, these diagrams look very useful! So +1 to add them in the docs in such a way that is not immediately visible to the average user (might look scary) :)

drbenvincent commented 1 year ago

I use this in CausalPy and have these saved and displayed. Do you propose to save and display the images similarly, or just to document that it is possible to create these images? Either way, I propose that this should happen in the new CONTRIBUTING.md which will appear when #203 is merged.

I don't have a strong opinion about which of the options we go with :)

ColtAllen commented 1 year ago

I use this in CausalPy and have these saved and displayed. Do you propose to save and display the images similarly, or just to document that it is possible to create these images? Either way, I propose that this should happen in the new CONTRIBUTING.md which will appear when #203 is merged.

I don't have a strong opinion about which of the options we go with :)

I think it would be a good addition to https://github.com/pymc-labs/pymc-marketing/issues/203. The lifetimes documentation has something similar.

drbenvincent commented 1 year ago

Did you want to take that on, or do you mind if I give it a go?

ColtAllen commented 1 year ago

@drbenvincent I'm busy with a few other PRs right now, so feel free to work on this one.

drbenvincent commented 1 year ago

Note to self: Do this after #207 is merged.