arviz-devs / preliz

A tool-box for prior elicitation.
https://preliz.readthedocs.io
Apache License 2.0
73 stars 9 forks source link

Manage optional import of PyMC and Bambi in the docs #464

Closed aloctavodia closed 1 month ago

aloctavodia commented 1 month ago

See #462, we should clarify that pymc and bambi are optional imports and user need to have those installed if they want to run some of the examples.

Additionally, for predictive_explorer it will be nice to have 3 tabs, one for a "preliz model", one for a PyMC model and one for the Bambi model, when rendering the docs it will be enough to run only the preliz-tab

rohanbabbar04 commented 1 month ago

Sounds great... I will pick this issue.

rohanbabbar04 commented 1 month ago

In this can we do something like this in observed_space_examples.ipynb,

In [2]:  !{sys.executable} -m pip install pymc    # To support pymc
In [3]:  !{sys.executable} -m pip install bambi    # To support bambi

With some text why we install it, what do you think is this better than going for 3 tabs.

aloctavodia commented 1 month ago

Tabs provides a better layout and organization of the example.

We are going to remove thebe (no more live docs), so no need for those import lines

A message saying that pymc or bambi are needed to run the Bambi and pymc examples should be enough. Additionally, if we want something fancy we can do something similar to what is done in pymc examples https://www.pymc.io/projects/examples/en/latest/bart/bart_categorical_hawks.html